Skip to content

Commit 2bdc7f5

Browse files
author
Victor Stinner
committed
Move code related to compile from Python.h to compile.h
1 parent 6394188 commit 2bdc7f5

2 files changed

Lines changed: 12 additions & 21 deletions

File tree

Include/Python.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -127,30 +127,11 @@
127127
#include "dtoa.h"
128128
#include "fileutils.h"
129129

130-
#ifdef __cplusplus
131-
extern "C" {
132-
#endif
133-
134-
/* _Py_Mangle is defined in compile.c */
135-
#ifndef Py_LIMITED_API
136-
PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
137-
#endif
138-
139-
#ifdef __cplusplus
140-
}
141-
#endif
142-
143130
/* Argument must be a char or an int in [-128, 127] or [0, 255]. */
144131
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
145132

146133
#include "pyfpe.h"
147134

148-
/* These definitions must match corresponding definitions in graminit.h.
149-
There's code in compile.c that checks that they are the same. */
150-
#define Py_single_input 256
151-
#define Py_file_input 257
152-
#define Py_eval_input 258
153-
154135
/* Define macros for inline documentation. */
155136
#define PyDoc_VAR(name) static char name[]
156137
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)

Include/compile.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#ifndef Py_LIMITED_API
21
#ifndef Py_COMPILE_H
32
#define Py_COMPILE_H
43

4+
#ifndef Py_LIMITED_API
55
#include "code.h"
66

77
#ifdef __cplusplus
@@ -38,9 +38,19 @@ PyAPI_FUNC(PyCodeObject *) PyAST_CompileEx(
3838
PyArena *arena);
3939
PyAPI_FUNC(PyFutureFeatures *) PyFuture_FromAST(struct _mod *, const char *);
4040

41+
/* _Py_Mangle is defined in compile.c */
42+
PyAPI_FUNC(PyObject*) _Py_Mangle(PyObject *p, PyObject *name);
4143

4244
#ifdef __cplusplus
4345
}
4446
#endif
45-
#endif /* !Py_COMPILE_H */
47+
4648
#endif /* !Py_LIMITED_API */
49+
50+
/* These definitions must match corresponding definitions in graminit.h.
51+
There's code in compile.c that checks that they are the same. */
52+
#define Py_single_input 256
53+
#define Py_file_input 257
54+
#define Py_eval_input 258
55+
56+
#endif /* !Py_COMPILE_H */

0 commit comments

Comments
 (0)