mirror of
https://github.com/python/cpython.git
synced 2026-01-03 22:12:27 +00:00
Adapted to Universal Headers 3.4: new refcontype and use UPP names in stead of Proc names for callback creation.
This commit is contained in:
parent
5daef31355
commit
ff75c214ef
2 changed files with 18 additions and 3 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -116,8 +116,14 @@ def passInput(self, name):
|
|||
"""
|
||||
|
||||
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 @@ def passInput(self, name):
|
|||
|
||||
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);
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue