[Pythonmac-SIG] Building Mac extensions for Apple Python
Tony Lownds
tony@lownds.com
Sun, 5 Jan 2003 20:41:53 -0800
At 9:37 PM +0100 1/3/03, Jack Jansen wrote:
>PyObject_Del is declared for python 2.2 (in
>/usr/include/python2.2/objimpl.h) so I really have no idea why it
>would fail...
I think the problem is that PyObject_Del is defined in python2.2 as a
macro with arguments:
#define PyObject_Del(op) _PyObject_Del((PyObject *)(op))
So, it can't be used to provide a function pointer for the AEDesc_Type struct.
Fixing that one module isn't hard:
diff -u -r1.18 _AEmodule.c
--- ../Modules/ae/_AEmodule.c 23 Dec 2002 23:16:20 -0000 1.18
+++ ../Modules/ae/_AEmodule.c 6 Jan 2003 04:27:23 -0000
@@ -875,8 +875,10 @@
return self;
}
-#define AEDesc_tp_free PyObject_Del
-
+static void AEDesc_tp_free(PyObject *self)
+{
+ PyObject_Del(self);
+}
PyTypeObject AEDesc_Type = {
PyObject_HEAD_INIT(NULL)
But aren't those modules generated by something?
-Tony