Author: Ronan Lamy <[email protected]>
Branch: release-5.x
Changeset: r85150:9618737a6b92
Date: 2016-06-09 18:42 +0100
http://bitbucket.org/pypy/pypy/changeset/9618737a6b92/
Log: Add include guards to pymem.h: fixes issue #2321 (grafted from
68486f0f79c649514bde51317d4ab97602d11713)
diff --git a/pypy/module/cpyext/include/pymem.h
b/pypy/module/cpyext/include/pymem.h
--- a/pypy/module/cpyext/include/pymem.h
+++ b/pypy/module/cpyext/include/pymem.h
@@ -1,5 +1,11 @@
#include <stdlib.h>
+#ifndef Py_PYMEM_H
+#define Py_PYMEM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define PyMem_MALLOC(n) malloc((n) ? (n) : 1)
#define PyMem_REALLOC(p, n) realloc((p), (n) ? (n) : 1)
@@ -44,3 +50,9 @@
*/
#define PyMem_Del PyMem_Free
#define PyMem_DEL PyMem_FREE
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !Py_PYMEM_H */
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit