]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Adapted to Universal Headers 3.4: new refcontype and use UPP names in stead of Proc...
authorJack Jansen <jack.jansen@cwi.nl>
Wed, 20 Jun 2001 20:53:38 +0000 (20:53 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Wed, 20 Jun 2001 20:53:38 +0000 (20:53 +0000)
Mac/Modules/ae/AEmodule.c
Mac/Modules/ae/aesupport.py

index 9fd51fee4fba2b53509186eba0c16773de97d2a9..236bbd490804030cdf8bc4631f9255b6f0dd675f 100644 (file)
@@ -1204,9 +1204,14 @@ static PyMethodDef AE_methods[] = {
 };
 
 
+#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
+typedef long refcontype;
+#else
+typedef unsigned long refcontype;
+#endif
 
 static pascal OSErr
-GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long refcon)
+GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
 {
        PyObject *handler = (PyObject *)refcon;
        AEDescObject *requestObject, *replyObject;
@@ -1244,7 +1249,7 @@ void initAE(void)
 
 
                upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
-               upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
+               upp_GenericEventHandler = NewAEEventHandlerUPP(&GenericEventHandler);
                PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
                PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
 
index 321a21070919ff26a504ee15f94d467b3a73492f..eacbee7aee2b662b8c81c3d73d7d1382f5670129 100644 (file)
@@ -116,8 +116,14 @@ AEIdleUPP upp_AEIdleProc;
 """
 
 finalstuff = finalstuff + """
+#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
+typedef long refcontype;
+#else
+typedef unsigned long refcontype;
+#endif
+
 static pascal OSErr
-GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long refcon)
+GenericEventHandler(const AppleEvent *request, AppleEvent *reply, refcontype refcon)
 {
        PyObject *handler = (PyObject *)refcon;
        AEDescObject *requestObject, *replyObject;
@@ -149,7 +155,11 @@ GenericEventHandler(const AppleEvent *request, AppleEvent *reply, unsigned long
 
 initstuff = initstuff + """
        upp_AEIdleProc = NewAEIdleUPP(AEIdleProc);
+#if UNIVERSAL_INTERFACES_VERSION >= 0x0340
+       upp_GenericEventHandler = NewAEEventHandlerUPP(&GenericEventHandler);
+#else
        upp_GenericEventHandler = NewAEEventHandlerUPP(GenericEventHandler);
+#endif
        PyMac_INIT_TOOLBOX_OBJECT_NEW(AEDesc *, AEDesc_New);
        PyMac_INIT_TOOLBOX_OBJECT_CONVERT(AEDesc, AEDesc_Convert);
 """