diff options
author | Michal Suchanek <msuchanek@suse.de> | 2022-10-13 23:25:52 +0200 |
---|---|---|
committer | Michal Suchanek <msuchanek@suse.de> | 2022-10-13 23:26:58 +0200 |
commit | c3f17b415dc63906218306135da49bf1f941588f (patch) | |
tree | d6eefe6fe9f39ca1c19b1d81580aae62c3aa75ab /Lib/python | |
parent | 752b7e82cd61a80eb0f5dd80f134ba80bcae4973 (diff) | |
download | swig-c3f17b415dc63906218306135da49bf1f941588f.tar.gz |
Define PY_SSIZE_T_CLEAN only when not defined yet
Users of swig 4.0.2 and python 3.10 will likely define the
PY_SSIZE_T_CLEAN macro by hand when relevant because their bindings
won't build otherwise.
Unconditionally defining PY_SSIZE_T_CLEAN in swig 4.10 will lead to
macro redefinition warning.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Diffstat (limited to 'Lib/python')
-rw-r--r-- | Lib/python/embed.i | 2 | ||||
-rw-r--r-- | Lib/python/pyruntime.swg | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/python/embed.i b/Lib/python/embed.i index 505dd9b57..3fc2d14e5 100644 --- a/Lib/python/embed.i +++ b/Lib/python/embed.i @@ -29,7 +29,7 @@ As far as I know, this module is C++ safe. #endif %wrapper %{ -#ifndef SWIG_NO_PY_SSIZE_T_CLEAN +#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) #define PY_SSIZE_T_CLEAN #endif diff --git a/Lib/python/pyruntime.swg b/Lib/python/pyruntime.swg index aa2ecfe08..1d028adaf 100644 --- a/Lib/python/pyruntime.swg +++ b/Lib/python/pyruntime.swg @@ -4,7 +4,7 @@ # include <math.h> #endif -#ifndef SWIG_NO_PY_SSIZE_T_CLEAN +#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) #define PY_SSIZE_T_CLEAN #endif |