]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Add `extern "C"` around `PyTraceMalloc_` functions. (GH-127772) (#127815)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 11 Dec 2024 13:07:44 +0000 (14:07 +0100)
committerGitHub <noreply@github.com>
Wed, 11 Dec 2024 13:07:44 +0000 (14:07 +0100)
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 2cdeb61b57e638ae46a04386330a12abe9cddf2c)

Co-authored-by: Peter Hawkins <hawkinsp@cs.stanford.edu>
Include/cpython/tracemalloc.h

index 61a16ea9a9f3ebd63ba9226f3c4c9d217fa19e86..6d094291ae2e906451675b94836919b63a7c29f0 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef Py_LIMITED_API
 #ifndef Py_TRACEMALLOC_H
 #define Py_TRACEMALLOC_H
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Track an allocated memory block in the tracemalloc module.
    Return 0 on success, return -1 on error (failed to allocate memory to store
@@ -22,5 +25,8 @@ PyAPI_FUNC(int) PyTraceMalloc_Untrack(
     unsigned int domain,
     uintptr_t ptr);
 
+#ifdef __cplusplus
+}
+#endif
 #endif  // !Py_TRACEMALLOC_H
 #endif  // !Py_LIMITED_API