[Zope3-checkins] CVS: Zope3/src/zope/interface - _zope_interface_ospec.c:1.4

Godefroid Chapelle gotcha@swing.be
Wed, 21 May 2003 14:21:40 -0400


Update of /cvs-repository/Zope3/src/zope/interface
In directory cvs.zope.org:/tmp/cvs-serv5065

Modified Files:
	_zope_interface_ospec.c 
Log Message:
changes to allow this to compile under cygwin.

cygwin gcc was giving errors such as:

initializer element is not constant

when PyType_GenericNew and such-like were used in the type-definition
struct-initialiser. (Or whatever it is properly called...)



=== Zope3/src/zope/interface/_zope_interface_ospec.c 1.3 => 1.4 ===
--- Zope3/src/zope/interface/_zope_interface_ospec.c:1.3	Fri May 16 08:46:38 2003
+++ Zope3/src/zope/interface/_zope_interface_ospec.c	Wed May 21 14:21:40 2003
@@ -85,7 +85,7 @@
         /* tp_dictoffset     */ 0,
         /* tp_init           */ (initproc)0,
         /* tp_alloc          */ (allocfunc)0,
-        /* tp_new            */ (newfunc)PyType_GenericNew,
+        /* tp_new            */ (newfunc)0 /*PyType_GenericNew*/,
 };
 
 typedef struct {
@@ -360,7 +360,7 @@
         /* tp_dictoffset     */ 0,
         /* tp_init           */ (initproc)OSpec_init,
         /* tp_alloc          */ (allocfunc)0,
-        /* tp_new            */ (newfunc)PyType_GenericNew,
+        /* tp_new            */ (newfunc)0 /*PyType_GenericNew*/,
 };
 
 /* List of methods defined in the module */
@@ -424,12 +424,16 @@
     return;
 
   Py_DECREF(module);
+ 
+  OSpecType.tp_new = PyType_GenericNew;
+  ISBType.tp_new = PyType_GenericNew;
   
   /* Initialize types: */  
   if (PyType_Ready(&ISBType) < 0)
     return;
   if (PyType_Ready(&OSpecType) < 0)
     return;
+
 
   /* Create the module and add the functions */
   module = Py_InitModule3("_zope_interface_ospec", module_methods,