Skip to content

Commit 9df48fe

Browse files
committed
Add extern "C" around PyTraceMalloc_ functions.
Pretty much everything else exported by Python.h has an extern "C" annotation, yet this header appears to be missing one.
1 parent 5c89adf commit 9df48fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Include/cpython/tracemalloc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#ifndef Py_TRACEMALLOC_H
33
#define Py_TRACEMALLOC_H
44

5+
#ifdef __cplusplus
6+
extern "C" {
7+
#endif
8+
59
/* Track an allocated memory block in the tracemalloc module.
610
Return 0 on success, return -1 on error (failed to allocate memory to store
711
the trace).
@@ -22,5 +26,9 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack(
2226
unsigned int domain,
2327
uintptr_t ptr);
2428

29+
#ifdef __cplusplus
30+
}
31+
#endif
32+
2533
#endif // !Py_TRACEMALLOC_H
2634
#endif // !Py_LIMITED_API

0 commit comments

Comments
 (0)