Commit 0c01ea5d authored by Stefan Behnel's avatar Stefan Behnel

Prepare automatically setting Py_LIMITED_API (once it's ready).

parent 0f03e47d
......@@ -665,7 +665,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln(json.dumps(metadata, indent=4, sort_keys=True))
code.putln("END: Cython Metadata */")
code.putln("")
code.putln("#define PY_SSIZE_T_CLEAN")
self._put_setup_code(code, "InitLimitedAPI")
for inc in sorted(env.c_includes.values(), key=IncludeCode.sortkey):
if inc.location == inc.INITIAL:
......
/////////////// InitLimitedAPI ///////////////
#if defined(CYTHON_LIMITED_API) && 0 /* disabled: enabling Py_LIMITED_API needs more work */
#ifndef Py_LIMITED_API
#if CYTHON_LIMITED_API+0 > 0
#define Py_LIMITED_API CYTHON_LIMITED_API
#else
#define Py_LIMITED_API 0x03030000
#endif
#endif
#endif
/////////////// CModulePreamble ///////////////
#include <stddef.h> /* For offsetof */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment