[pypy-commit] pypy pypy-pyarray: - cpyext/include: Add a few definitions needed by PyCXX to headers (for

shmuller noreply at buildbot.pypy.org
Mon Aug 26 22:02:48 CEST 2013


Author: Stefan H. Muller <shmueller2 at gmail.com>
Branch: pypy-pyarray
Changeset: r66337:aabf1cc286a7
Date: 2013-07-31 00:42 +0200
http://bitbucket.org/pypy/pypy/changeset/aabf1cc286a7/

Log:	- cpyext/include: Add a few definitions needed by PyCXX to headers
	(for matplotlib build).
	- NEW: cpyext/include/missing.h: Temporary place to put definitions
	from missing header files.

diff --git a/pypy/module/cpyext/include/Python.h b/pypy/module/cpyext/include/Python.h
--- a/pypy/module/cpyext/include/Python.h
+++ b/pypy/module/cpyext/include/Python.h
@@ -126,6 +126,9 @@
 #include "pysignals.h"
 #include "pythread.h"
 
+/* Missing definitions */
+#include "missing.h"
+
 // XXX This shouldn't be included here
 #include "structmember.h"
 
diff --git a/pypy/module/cpyext/include/funcobject.h b/pypy/module/cpyext/include/funcobject.h
--- a/pypy/module/cpyext/include/funcobject.h
+++ b/pypy/module/cpyext/include/funcobject.h
@@ -12,6 +12,8 @@
     PyObject *func_name;	/* The __name__ attribute, a string object */
 } PyFunctionObject;
 
+PyAPI_DATA(PyTypeObject) PyFunction_Type;
+
 #define PyFunction_GET_CODE(obj) PyFunction_GetCode((PyObject*)(obj))
 
 #define PyMethod_GET_FUNCTION(obj) PyMethod_Function((PyObject*)(obj))
diff --git a/pypy/module/cpyext/include/missing.h b/pypy/module/cpyext/include/missing.h
new file mode 100644
--- /dev/null
+++ b/pypy/module/cpyext/include/missing.h
@@ -0,0 +1,15 @@
+
+/* Definitions from missing header files */
+
+#ifndef Py_MISSING_H
+#define Py_MISSING_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+PyAPI_DATA(PyTypeObject) PyMethod_Type, PyRange_Type, PyTraceBack_Type;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py_MISSING_H */
diff --git a/pypy/module/cpyext/include/modsupport.h b/pypy/module/cpyext/include/modsupport.h
--- a/pypy/module/cpyext/include/modsupport.h
+++ b/pypy/module/cpyext/include/modsupport.h
@@ -56,6 +56,7 @@
 #define PyMODINIT_FUNC void
 #endif
 
+PyAPI_DATA(char *) _Py_PackageContext;
 
 #ifdef __cplusplus
 }
diff --git a/pypy/module/cpyext/include/pythonrun.h b/pypy/module/cpyext/include/pythonrun.h
--- a/pypy/module/cpyext/include/pythonrun.h
+++ b/pypy/module/cpyext/include/pythonrun.h
@@ -6,14 +6,41 @@
 extern "C" {
 #endif
 
-  void Py_FatalError(const char *msg);
+void Py_FatalError(const char *msg);
 
 /* the -3 option will probably not be implemented */
+/*
 #define Py_Py3kWarningFlag 0
 
 #define Py_FrozenFlag 0
 #define Py_VerboseFlag 0
 #define Py_DebugFlag 1
+*/
+
+/* taken from Python-2.7.3/Include/pydebug.h */
+PyAPI_DATA(int) Py_DebugFlag;
+PyAPI_DATA(int) Py_VerboseFlag;
+PyAPI_DATA(int) Py_InteractiveFlag;
+PyAPI_DATA(int) Py_InspectFlag;
+PyAPI_DATA(int) Py_OptimizeFlag;
+PyAPI_DATA(int) Py_NoSiteFlag;
+PyAPI_DATA(int) Py_BytesWarningFlag;
+PyAPI_DATA(int) Py_UseClassExceptionsFlag;
+PyAPI_DATA(int) Py_FrozenFlag;
+PyAPI_DATA(int) Py_TabcheckFlag;
+PyAPI_DATA(int) Py_UnicodeFlag;
+PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
+PyAPI_DATA(int) Py_DivisionWarningFlag;
+PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
+PyAPI_DATA(int) Py_NoUserSiteDirectory;
+/* _XXX Py_QnewFlag should go away in 3.0.  It's true iff -Qnew is passed,
+ *   on the command line, and is used in 2.2 by ceval.c to make all "/" divisions
+ *     true divisions (which they will be in 3.0). */
+PyAPI_DATA(int) _Py_QnewFlag;
+/* Warn about 3.x issues */
+PyAPI_DATA(int) Py_Py3kWarningFlag;
+PyAPI_DATA(int) Py_HashRandomizationFlag;
+
 
 typedef struct {
     int cf_flags;  /* bitmask of CO_xxx flags relevant to future */


More information about the pypy-commit mailing list