]> granicus.if.org Git - python/commitdiff
Move code related to compile from Python.h to compile.h
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 28 Sep 2011 23:04:08 +0000 (01:04 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 28 Sep 2011 23:04:08 +0000 (01:04 +0200)
Include/Python.h
Include/compile.h

index 17d3d5ce59ee24d3e32fd3884755a22de73fc13d..63043f2b9d5a94fba80912f628ef0b960f8cf98c 100644 (file)
 #include "dtoa.h"
 #include "fileutils.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* _Py_Mangle is defined in compile.c */
-#ifndef Py_LIMITED_API
-PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
 /* Argument must be a char or an int in [-128, 127] or [0, 255]. */
 #define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
 
 #include "pyfpe.h"
 
-/* These definitions must match corresponding definitions in graminit.h.
-   There's code in compile.c that checks that they are the same. */
-#define Py_single_input 256
-#define Py_file_input 257
-#define Py_eval_input 258
-
 /* Define macros for inline documentation. */
 #define PyDoc_VAR(name) static char name[]
 #define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
index bc53b39239072ab15423affcec0eabbf3871bb43..ac2636dfc93db6e1cde928b2fd9e5610c3a7258c 100644 (file)
@@ -1,7 +1,7 @@
-#ifndef Py_LIMITED_API
 #ifndef Py_COMPILE_H
 #define Py_COMPILE_H
 
+#ifndef Py_LIMITED_API
 #include "code.h"
 
 #ifdef __cplusplus
@@ -38,9 +38,19 @@ PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
     PyArena *arena);
 PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
 
+/* _Py_Mangle is defined in compile.c */
+PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
 
 #ifdef __cplusplus
 }
 #endif
-#endif /* !Py_COMPILE_H */
+
 #endif /* !Py_LIMITED_API */
+
+/* These definitions must match corresponding definitions in graminit.h.
+   There's code in compile.c that checks that they are the same. */
+#define Py_single_input 256
+#define Py_file_input 257
+#define Py_eval_input 258
+
+#endif /* !Py_COMPILE_H */