INN commit: trunk (m4/python.m4 nnrpd/python.c)

INN Commit rra at isc.org
Sun Jun 14 15:31:12 UTC 2015


    Date: Sunday, June 14, 2015 @ 08:31:12
  Author: iulius
Revision: 9901

Fix the build for Python < 2.5.0

Fix (old) commit [9297] where Py_ssize_t was set to ssize_t for Python
versions anterior to 2.5.0 whereas it was an int.  We therefore had an
incompatible pointer type when calling PyDict_Next().

As INN is supposed to work on 2.2.0, this bug is now fixed.

Also use "0" and "1" instead of "False" and "True" that did not exist
in 2.2.0 for the distutils module.

Modified:
  trunk/m4/python.m4
  trunk/nnrpd/python.c

----------------+
 m4/python.m4   |    2 +-
 nnrpd/python.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Modified: m4/python.m4
===================================================================
--- m4/python.m4	2015-06-14 12:23:50 UTC (rev 9900)
+++ m4/python.m4	2015-06-14 15:31:12 UTC (rev 9901)
@@ -27,7 +27,7 @@
      PYTHON_CPPFLAGS="-I$py_include"
      py_ver=`$PYTHON -c 'import sys; print(sys.version[[:3]])'`
      py_libdir=`$PYTHON -c 'import distutils.sysconfig; \
-         print(distutils.sysconfig.get_python_lib(False, True))'`
+         print(distutils.sysconfig.get_python_lib(0, 1))'`
      py_linkage=`$PYTHON -c 'import distutils.sysconfig; \
          print(" ".join(distutils.sysconfig.get_config_vars("LIBS", \
              "LIBC", "LIBM", "LOCALMODLIBS", "BASEMODLIBS", \

Modified: nnrpd/python.c
===================================================================
--- nnrpd/python.c	2015-06-14 12:23:50 UTC (rev 9900)
+++ nnrpd/python.c	2015-06-14 15:31:12 UTC (rev 9901)
@@ -26,7 +26,7 @@
 /*  Python redefines _POSIX_C_SOURCE, so undef it to suppress warnings. */
 #undef _POSIX_C_SOURCE
 
-/*  Make "s#" use Py_ssize_t rather than signed size_t. */
+/*  Make "s#" use Py_ssize_t rather than int. */
 #define PY_SSIZE_T_CLEAN
 
 /*  Python.h must be included after having defined PY_SSIZE_T_CLEAN,
@@ -37,7 +37,7 @@
 
 /*  Define Py_ssize_t when it does not exist (Python < 2.5.0). */
 #if PY_VERSION_HEX < 0x02050000
-  typedef ssize_t Py_ssize_t;
+  typedef int Py_ssize_t;
 #endif
 
 #include "clibrary.h"



More information about the inn-committers mailing list