[pypy-commit] pypy default: Add include guards to pymem.h: fixes issue #2321
rlamy
pypy.commits at gmail.com
Thu Jun 9 13:42:25 EDT 2016
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch:
Changeset: r85061:68486f0f79c6
Date: 2016-06-09 18:42 +0100
http://bitbucket.org/pypy/pypy/changeset/68486f0f79c6/
Log: Add include guards to pymem.h: fixes issue #2321
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 */
More information about the pypy-commit
mailing list