summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2019-09-12 09:27:14 (GMT)
committerMark Shannon <mark@hotpy.org>2019-09-12 09:27:14 (GMT)
commit421a72af4deaec96a49a79951b9c2546a2faa13d (patch)
tree482c622c1573f91cf16e23f4171c12ac83fb5881 /Include
parent6954be815a16fad11d1d66be576865bbbeb2b97d (diff)
downloadcpython-421a72af4deaec96a49a79951b9c2546a2faa13d.zip
cpython-421a72af4deaec96a49a79951b9c2546a2faa13d.tar.gz
cpython-421a72af4deaec96a49a79951b9c2546a2faa13d.tar.bz2
bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API (#14634)
The PyArena type is not part of the limited API, so these headers shouldn't be part of it either.
Diffstat (limited to 'Include')
-rw-r--r--Include/Python-ast.h2
-rw-r--r--Include/asdl.h2
-rw-r--r--Include/ast.h6
3 files changed, 6 insertions, 4 deletions
diff --git a/Include/Python-ast.h b/Include/Python-ast.h
index 5fe4f2b..b9232b1 100644
--- a/Include/Python-ast.h
+++ b/Include/Python-ast.h
@@ -6,6 +6,7 @@
extern "C" {
#endif
+#ifndef Py_LIMITED_API
#include "asdl.h"
#undef Yield /* undefine macro conflicting with <winbase.h> */
@@ -708,6 +709,7 @@ type_ignore_ty _Py_TypeIgnore(int lineno, string tag, PyArena *arena);
PyObject* PyAST_mod2obj(mod_ty t);
mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);
int PyAST_Check(PyObject* obj);
+#endif /* !Py_LIMITED_API */
#ifdef __cplusplus
}
diff --git a/Include/asdl.h b/Include/asdl.h
index fc6d223..549df2a 100644
--- a/Include/asdl.h
+++ b/Include/asdl.h
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
#ifndef Py_ASDL_H
#define Py_ASDL_H
@@ -44,3 +45,4 @@ asdl_int_seq *_Py_asdl_int_seq_new(Py_ssize_t size, PyArena *arena);
#endif
#endif /* !Py_ASDL_H */
+#endif /* Py_LIMITED_API */
diff --git a/Include/ast.h b/Include/ast.h
index 1347fcf..a8c52af 100644
--- a/Include/ast.h
+++ b/Include/ast.h
@@ -1,3 +1,4 @@
+#ifndef Py_LIMITED_API
#ifndef Py_AST_H
#define Py_AST_H
#ifdef __cplusplus
@@ -19,8 +20,6 @@ PyAPI_FUNC(mod_ty) PyAST_FromNodeObject(
PyObject *filename,
PyArena *arena);
-#ifndef Py_LIMITED_API
-
/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
@@ -29,9 +28,8 @@ PyAPI_FUNC(PyObject *) _PyAST_ExprAsUnicode(expr_ty);
Doesn't set exception. */
PyAPI_FUNC(PyObject *) _PyAST_GetDocString(asdl_seq *);
-#endif /* !Py_LIMITED_API */
-
#ifdef __cplusplus
}
#endif
#endif /* !Py_AST_H */
+#endif /* !Py_LIMITED_API */