[Checkins] SVN: zope.interface/trunk/ Specify return value type for C optimizations module init under Python 3.

Tres Seaver tseaver at palladion.com
Mon Nov 15 14:22:22 EST 2010


Log message for revision 118418:
  Specify return value type for C optimizations module init under Python 3.
  
  Undeclared value caused warnings, and segfaults on some 64 bit architectures.
  
  Also, remove redundant conditional define of PyMODINIT_FUNC:  it is present
  in 'pyport.h' on all Python versions we care about, and the conditional
  version here was wrong for Python 3.
  
  Fixes LP # 675064.
  

Changed:
  U   zope.interface/trunk/CHANGES.txt
  U   zope.interface/trunk/src/zope/interface/_zope_interface_coptimizations.c

-=-
Modified: zope.interface/trunk/CHANGES.txt
===================================================================
--- zope.interface/trunk/CHANGES.txt	2010-11-15 19:17:54 UTC (rev 118417)
+++ zope.interface/trunk/CHANGES.txt	2010-11-15 19:22:22 UTC (rev 118418)
@@ -5,9 +5,10 @@
 3.6.2 (unreleased)
 ==================
 
-- Nothing changed yet.
+- LP # 675064:  Specify return value type for C optimizations module init
+  under Python 3:  undeclared value caused warnings, and segfaults on some
+  64 bit architectures.
 
-
 3.6.1 (2010-05-03)
 ==================
 

Modified: zope.interface/trunk/src/zope/interface/_zope_interface_coptimizations.c
===================================================================
--- zope.interface/trunk/src/zope/interface/_zope_interface_coptimizations.c	2010-11-15 19:17:54 UTC (rev 118417)
+++ zope.interface/trunk/src/zope/interface/_zope_interface_coptimizations.c	2010-11-15 19:22:22 UTC (rev 118418)
@@ -1580,9 +1580,6 @@
 };
 #endif
 
-#ifndef PyMODINIT_FUNC	/* declarations for DLL import/export */
-#define PyMODINIT_FUNC void
-#endif
 static PyObject *
 init(void)
 {
@@ -1671,8 +1668,8 @@
   return m;
 }
 
-#if PY_MAJOR_VERSION < 3
 PyMODINIT_FUNC
+#if PY_MAJOR_VERSION < 3
 init_zope_interface_coptimizations(void)
 {
   init();



More information about the checkins mailing list