ctypes on Mac OS X 10.4 with gcc 4.0

Posted on January 22, 2006 by oubiwann


Blog post image

python :: programming :: macosx



I had some trouble installing ctypes on a 10.4 server tonight, and found
this
little post

that gave a patch for it. Unfortunately, this was for the file in 2004
and I had to manually edit the current 4000+ line file.

Apparently, this was in CVS in 2004 but hasn't made it into a distro
since...

For the search engines, I will post the error message (where xxx are
your line numbers):


source/ctypes.c:xxx: error: static declaration of 'PointerType'
follows non-static declaration
source/ctypes.h:xxx: error: previous declaration of 'Pointer_Type' was
here

And here's a copy of my diff against _ctypes.c in ctypes 0.9.6:


— third-party/ctypes-0.9.6/source/_ctypes.c (revision 53)
+++ third-party/ctypes-0.9.6/source/_ctypes.c (working copy)
@@ -2449,7 +2449,7 @@
"sO|O" - function name, dll object (with an integer handle)
"is|O" - vtable index, method name, creates callable calling COM vtbl
/
-static PyObject

+PyObject *
CFuncPtr_new(PyTypeObject type, PyObject args, PyObject *kwds)
{
CFuncPtrObject *self;
@@ -3880,7 +3880,7 @@
(inquiry)Pointernonzero, / nbnonzero /
};

-static PyTypeObject PointerType = {
+PyTypeObject Pointer
Type = {
PyObjectHEADINIT(NULL)
0,
"ctypes.Pointer",


Author oubiwann
Date January 22, 2006
Time 04:02:08
Category
Tags
Line Count 1
Word Count 198
Character Count 1720

Comments?
This blog doesn't use standard (embedded) comments; however, since the site is hosted on Github, if there is something you'd like to share, please do so by opening a "comment" ticket!