[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] Problem with Pygame c api (bad crashes)
John Popplewell wrote:
> this happens when 'pygame.h' is included into a '.cpp' file (or when
> the VC++ /Tp or /TP switches are used).
right, the pygame headers are _not_ C++ safe, you will need to wrap them
inside an extern "C" {} block.
> This line *is* a bit strange:
> void** localptr = (void*)PyCObject_AsVoidPtr(c_api);
> ^^^^^^ ^^^^^
> On general principle, shouldn't that be:
> void** localptr = (void**)PyCObject_AsVoidPtr(c_api);
> ^^^^^^ ^^^^^^
absolutely correct, this should be stern warning, but i think you are
right, many compilers relax their warnings a bit on void pointers. in any
event, the code should be "safe", because on the other side of the picture
we are assigning the PyCObject a "void* c_api[]".
i'm not exactly sure where i lost the extra "*", all the reference i'm
going back and looking at definitely has "**". i'm going back to patch
everything to the proper type-age.
____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org