extern "C" {
#endif
+#ifndef Py_LIMITED_API
#include "asdl.h"
#undef Yield /* undefine macro conflicting with <winbase.h> */
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
}
+#ifndef Py_LIMITED_API
#ifndef Py_ASDL_H
#define Py_ASDL_H
#endif
#endif /* !Py_ASDL_H */
+#endif /* Py_LIMITED_API */
+#ifndef Py_LIMITED_API
#ifndef Py_AST_H
#define Py_AST_H
#ifdef __cplusplus
PyObject *filename,
PyArena *arena);
-#ifndef Py_LIMITED_API
-
/* _PyAST_ExprAsUnicode is defined in ast_unparse.c */
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 */
--- /dev/null
+Exclude Python-ast.h, ast.h and asdl.h from the limited API.
f.write('extern "C" {\n')
f.write('#endif\n')
f.write('\n')
+ f.write('#ifndef Py_LIMITED_API\n')
f.write('#include "asdl.h"\n')
f.write('\n')
f.write('#undef Yield /* undefine macro conflicting with <winbase.h> */\n')
f.write("PyObject* PyAST_mod2obj(mod_ty t);\n")
f.write("mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode);\n")
f.write("int PyAST_Check(PyObject* obj);\n")
+ f.write("#endif /* !Py_LIMITED_API */\n")
f.write('\n')
f.write('#ifdef __cplusplus\n')
f.write('}\n')