Skip to content

Commit 78dfc28

Browse files
[3.13] Add extern "C" around PyTraceMalloc_ functions. (GH-127772) (#127815)
Add `extern "C"` around `PyTraceMalloc_` functions. (GH-127772) Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one. (cherry picked from commit 2cdeb61) Co-authored-by: Peter Hawkins <[email protected]>
1 parent acf05aa commit 78dfc28

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Include/cpython/tracemalloc.h

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#ifndef Py_LIMITED_API
22
#ifndef Py_TRACEMALLOC_H
33
#define Py_TRACEMALLOC_H
4+
#ifdef __cplusplus
5+
extern "C" {
6+
#endif
47

58
/* Track an allocated memory block in the tracemalloc module.
69
Return 0 on success, return -1 on error (failed to allocate memory to store
@@ -22,5 +25,8 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack(
2225
unsigned int domain,
2326
uintptr_t ptr);
2427

28+
#ifdef __cplusplus
29+
}
30+
#endif
2531
#endif // !Py_TRACEMALLOC_H
2632
#endif // !Py_LIMITED_API

0 commit comments

Comments
 (0)