Mercurial > cpython-lru_cache-weakref
diff Mac/Python/macgetargv.c @ 18177:826000a40866 legacy-trunk
Adapted for Universal Headers 3.4: refcon type has changed (sigh) and use modern (UPP in stead of Proc) names for callback object creation.
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Wed, 20 Jun 2001 20:50:19 +0000 |
| parents | ea0cad92cfd2 |
| children | c93d7d0857a2 |
line wrap: on
line diff
--- a/Mac/Python/macgetargv.c Wed Jun 20 19:57:55 2001 +0000 +++ b/Mac/Python/macgetargv.c Wed Jun 20 20:50:19 2001 +0000 @@ -41,6 +41,12 @@ #include <Dialogs.h> #include <Windows.h> +#if UNIVERSAL_INTERFACES_VERSION >= 0x0340 +typedef long refcontype; +#else +typedef unsigned long refcontype; +#endif + #include "Python.h" #include "macglue.h" @@ -109,7 +115,7 @@ /* Handle the Print or Quit events (by failing) */ static pascal OSErr -handle_not(const AppleEvent *theAppleEvent, AppleEvent *reply, unsigned long refCon) +handle_not(const AppleEvent *theAppleEvent, AppleEvent *reply, refcontype refCon) { #pragma unused (reply, refCon) got_one = 1; @@ -119,7 +125,7 @@ /* Handle the Open Application event (by ignoring it) */ static pascal OSErr -handle_open_app(const AppleEvent *theAppleEvent, AppleEvent *reply, unsigned long refCon) +handle_open_app(const AppleEvent *theAppleEvent, AppleEvent *reply, refcontype refCon) { #pragma unused (reply, refCon) #if 0 @@ -132,7 +138,7 @@ /* Handle the Open Document event, by adding an argument */ static pascal OSErr -handle_open_doc(const AppleEvent *theAppleEvent, AppleEvent *reply, unsigned long refCon) +handle_open_doc(const AppleEvent *theAppleEvent, AppleEvent *reply, refcontype refCon) { #pragma unused (reply, refCon) OSErr err; @@ -170,9 +176,9 @@ static void set_ae_handlers() { - open_doc_upp = NewAEEventHandlerProc(handle_open_doc); - open_app_upp = NewAEEventHandlerProc(handle_open_app); - not_upp = NewAEEventHandlerProc(handle_not); + open_doc_upp = NewAEEventHandlerUPP(&handle_open_doc); + open_app_upp = NewAEEventHandlerUPP(&handle_open_app); + not_upp = NewAEEventHandlerUPP(&handle_not); AEInstallEventHandler(kCoreEventClass, kAEOpenApplication, open_app_upp, 0L, false);
