summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2022-10-14 07:56:09 +0100
committerGitHub <noreply@github.com>2022-10-14 07:56:09 +0100
commit7334e9c16f11486ad969083d55ade76715403aa0 (patch)
tree14d8656ff70517c2146069b989054d3e33f27905
parent5f96d15943ccf3e588dccbe8a9c3267070b61bbe (diff)
parentc3f17b415dc63906218306135da49bf1f941588f (diff)
downloadswig-7334e9c16f11486ad969083d55ade76715403aa0.tar.gz
Merge pull request #2401 from hramrach/master
Define PY_SSIZE_T_CLEAN only when not defined yet
-rw-r--r--Lib/python/embed.i2
-rw-r--r--Lib/python/pyruntime.swg2
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