summaryrefslogtreecommitdiffstats
path: root/Mac/Modules/ae
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-06-20 20:53:38 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-06-20 20:53:38 (GMT)
commitff75c214efefff451d00c8ba1656cc26d3b72fe1 (patch)
treeccbd606735c6b6490ad6d169437aeb9862c9e392 /Mac/Modules/ae
parent5daef3135553228d6a16f97dda21547a7ce71820 (diff)
downloadcpython-ff75c214efefff451d00c8ba1656cc26d3b72fe1.zip
cpython-ff75c214efefff451d00c8ba1656cc26d3b72fe1.tar.gz
cpython-ff75c214efefff451d00c8ba1656cc26d3b72fe1.tar.bz2
Adapted to Universal Headers 3.4: new refcontype and use UPP names in stead of Proc names for callback creation.
Diffstat (limited to 'Mac/Modules/ae')
-rw-r--r--Mac/Modules/ae/AEmodule.c9
-rw-r--r--Mac/Modules/ae/aesupport.py12
2 files changed, 18 insertions, 3 deletions
diff --git a/Mac/Modules/ae/AEmodule.c b/Mac/Modules/ae/AEmodule.c
index 9fd51fe..236bbd4 100644
--- a/Mac/Modules/ae/AEmodule.c
+++ b/Mac/Modules/ae/AEmodule.c
@@ -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);
diff --git a/Mac/Modules/ae/aesupport.py b/Mac/Modules/ae/aesupport.py
index 321a210..eacbee7 100644
--- a/Mac/Modules/ae/aesupport.py
+++ b/Mac/Modules/ae/aesupport.py
@@ -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);
"""