[Zope3-checkins] CVS: Zope3/src/zope/hookable - _zope_hookable.c:1.2

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


Update of /cvs-repository/Zope3/src/zope/hookable
In directory cvs.zope.org:/tmp/cvs-serv5227

Modified Files:
	_zope_hookable.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/hookable/_zope_hookable.c 1.1 => 1.2 ===
--- Zope3/src/zope/hookable/_zope_hookable.c:1.1	Sun May 18 14:03:55 2003
+++ Zope3/src/zope/hookable/_zope_hookable.c	Wed May 21 14:22:11 2003
@@ -176,8 +176,8 @@
         /* tp_dictoffset     */ 0,
         /* tp_init           */ (initproc)hookable_init,
         /* tp_alloc          */ (allocfunc)0,
-        /* tp_new            */ (newfunc)PyType_GenericNew,
-	/* tp_free           */ _PyObject_GC_Del, 
+        /* tp_new            */ (newfunc)0 /*PyType_GenericNew*/,
+	/* tp_free           */ 0/*_PyObject_GC_Del*/, 
 };
 
 static struct PyMethodDef zch_methods[] = {
@@ -191,7 +191,11 @@
 init_zope_hookable(void)
 {
   PyObject *m;
-        
+
+
+  hookabletype.tp_new = PyType_GenericNew;
+  hookabletype.tp_free = _PyObject_GC_Del;
+  
   if (PyType_Ready(&hookabletype) < 0)
     return;