diff options
author | Andrew V. Jones <andrew.jones@vector.com> | 2021-04-08 15:05:09 +0100 |
---|---|---|
committer | Andrew V. Jones <andrew.jones@vector.com> | 2021-04-08 15:05:09 +0100 |
commit | 3ccd94754e49ce7281c2a2826193df517491da2a (patch) | |
tree | c121ffa250d8a8e75134bf2ebe2678cf0aabb0a7 | |
parent | 217a93e7b139ab49815ea9ca34142b3e2a116a08 (diff) | |
download | cython-3ccd94754e49ce7281c2a2826193df517491da2a.tar.gz |
Only #define PY_SSIZE_T_CLEAN if it is not already #defined
Signed-off-by: Andrew V. Jones <andrew.jones@vector.com>
-rw-r--r-- | Cython/Compiler/ModuleNode.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py index 2c47e98fd..77a92368c 100644 --- a/Cython/Compiler/ModuleNode.py +++ b/Cython/Compiler/ModuleNode.py @@ -705,7 +705,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): code.putln("END: Cython Metadata */") code.putln("") + code.putln("#ifndef PY_SSIZE_T_CLEAN") code.putln("#define PY_SSIZE_T_CLEAN") + code.putln("#endif /* PY_SSIZE_T_CLEAN */") self._put_setup_code(code, "InitLimitedAPI") for inc in sorted(env.c_includes.values(), key=IncludeCode.sortkey): |