LaunchAPPLServer: fix for PPC

This commit is contained in:
Wolfgang Thaller 2018-05-06 12:40:45 +02:00
parent 3c071a0772
commit c29a932f4d
2 changed files with 11 additions and 10 deletions

View File

@ -4,6 +4,7 @@ SEGMENT Serial
SEGMENT Launcher
*/AppLauncher.*
*/ToolLauncher.*
SEGMENT libstdc++
*/libstdc++.a:*

View File

@ -9,15 +9,6 @@ class ToolLauncher : public AppLauncher
bool replyReceived;
AEEventHandlerUPP replyHandler = nullptr;
static pascal OSErr handleReply(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon)
{
ToolLauncher *self = (ToolLauncher*)handlerRefcon;
self->replyReceived = true;
AERemoveEventHandler(kCoreEventClass, kAEAnswer, handleReply, false);
return noErr;
}
Handle buildCommandLine(ConstStr255Param name)
{
CInfoPBRec pb;
@ -70,12 +61,21 @@ class ToolLauncher : public AppLauncher
return text;
}
static pascal OSErr handleReply(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon)
{
ToolLauncher *self = (ToolLauncher*)handlerRefcon;
self->replyReceived = true;
AERemoveEventHandler(kCoreEventClass, kAEAnswer, self->replyHandler, false);
return noErr;
}
public:
virtual bool Launch(ConstStr255Param name)
{
if(!replyHandler)
replyHandler = NewAEEventHandlerUPP(&handleReply);
AEInstallEventHandler(kCoreEventClass, kAEAnswer, handleReply, (long)this, false);
AEInstallEventHandler(kCoreEventClass, kAEAnswer, replyHandler, (long)this, false);
AEAddressDesc address;