summaryrefslogtreecommitdiffstats
path: root/Mac/Python
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-06-20 20:50:19 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-06-20 20:50:19 (GMT)
commit5daef3135553228d6a16f97dda21547a7ce71820 (patch)
tree2e53c4d79de43f3c3ac91ae8c35e11070e30137b /Mac/Python
parentd700d79a73be8e2af31c5adf8ec81457be1c32f3 (diff)
downloadcpython-5daef3135553228d6a16f97dda21547a7ce71820.zip
cpython-5daef3135553228d6a16f97dda21547a7ce71820.tar.gz
cpython-5daef3135553228d6a16f97dda21547a7ce71820.tar.bz2
Adapted for Universal Headers 3.4: refcon type has changed (sigh) and use modern (UPP in stead of Proc) names for callback object creation.
Diffstat (limited to 'Mac/Python')
-rw-r--r--Mac/Python/macgetargv.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/Mac/Python/macgetargv.c b/Mac/Python/macgetargv.c
index ac4e286..1bd57ad 100644
--- a/Mac/Python/macgetargv.c
+++ b/Mac/Python/macgetargv.c
@@ -41,6 +41,12 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#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 @@ static int got_one; /* Flag that we can stop getting events */
/* 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_not(const AppleEvent *theAppleEvent, AppleEvent *reply, unsigned long ref
/* 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_open_app(const AppleEvent *theAppleEvent, AppleEvent *reply, unsigned lon
/* 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 @@ AEEventHandlerUPP not_upp;
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);