mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
bug #42100, Carbon compatibility. r=gordon, saari, pinkerton, sfraser
This commit is contained in:
parent
db78352c83
commit
bb42c05858
Binary file not shown.
@ -40,4 +40,4 @@
|
||||
#define FORCE_PR_LOG 1
|
||||
#define NSPR20 1
|
||||
#define NSPR_AS_SHARED_LIB
|
||||
|
||||
#define TARGET_CARBON 0
|
||||
|
@ -560,7 +560,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
|
||||
}
|
||||
#endif /* WIN32 || WIN16 */
|
||||
|
||||
#if defined(XP_MAC) && GENERATINGCFM
|
||||
#if defined(XP_MAC) && TARGET_RT_MAC_CFM
|
||||
{
|
||||
OSErr err;
|
||||
Ptr main;
|
||||
@ -682,10 +682,8 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
|
||||
cFileName = &(cMacPath[index + 1]);
|
||||
|
||||
/* Convert the path and name into Pascal strings */
|
||||
strcpy((char*) &pName, cMacPath);
|
||||
c2pstr((char*) &pName);
|
||||
strcpy((char*) &fileSpec.name, cFileName);
|
||||
c2pstr((char*) &fileSpec.name);
|
||||
PStrFromCStr(cMacPath, pName);
|
||||
PStrFromCStr(cFileName, fileSpec.name);
|
||||
strcpy(cName, cFileName);
|
||||
PR_DELETE(cMacPath);
|
||||
cMacPath = NULL;
|
||||
@ -729,7 +727,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
|
||||
lm->next = pr_loadmap;
|
||||
pr_loadmap = lm;
|
||||
}
|
||||
#elif defined(XP_MAC) && !GENERATINGCFM
|
||||
#elif defined(XP_MAC) && !TARGET_RT_MAC_CFM
|
||||
{
|
||||
|
||||
}
|
||||
@ -1013,7 +1011,7 @@ PR_UnloadLibrary(PRLibrary *lib)
|
||||
}
|
||||
#endif /* XP_PC */
|
||||
|
||||
#if defined(XP_MAC) && GENERATINGCFM
|
||||
#if defined(XP_MAC) && TARGET_RT_MAC_CFM
|
||||
/* Close the connection */
|
||||
CloseConnection(&(lib->dlh));
|
||||
#endif
|
||||
|
@ -70,8 +70,8 @@ static struct {
|
||||
static PRBool gOTInitialized;
|
||||
|
||||
static pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie);
|
||||
static pascal void NotifierRoutine(void * contextPtr, OTEventCode code,
|
||||
OTResult result, void * cookie);
|
||||
static pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie);
|
||||
static pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie);
|
||||
|
||||
static PRBool GetState(PRFileDesc *fd, PRBool *readReady, PRBool *writeReady, PRBool *exceptReady);
|
||||
|
||||
@ -81,24 +81,20 @@ extern void DoneWaitingOnThisThread(PRThread *thread);
|
||||
#if TARGET_CARBON
|
||||
OTClientContextPtr clientContext = NULL;
|
||||
|
||||
OTNotifyUPP DNSNotifierRoutineUPP;
|
||||
OTNotifyUPP notifierRoutineUPP;
|
||||
|
||||
#define DNS_NOTIFIER_ROUTINE DNSNotifierRoutineUPP
|
||||
#define NOTIFIER_ROUTINE notifierRoutineUPP
|
||||
#define INIT_OPEN_TRANSPORT() InitOpenTransport(clientContext, kInitOTForExtensionMask)
|
||||
#define OT_OPEN_INTERNET_SERVICES(config, flags, err) OTOpenInternetServices(config, flags, err, clientContext)
|
||||
#define OT_OPEN_ENDPOINT(config, flags, info, err) OTOpenEndpoint(config, flags, info, err, clientContext)
|
||||
#define INIT_OPEN_TRANSPORT() InitOpenTransportInContext(kInitOTForExtensionMask, &clientContext)
|
||||
#define OT_OPEN_INTERNET_SERVICES(config, flags, err) OTOpenInternetServicesInContext(config, flags, err, clientContext)
|
||||
#define OT_OPEN_ENDPOINT(config, flags, info, err) OTOpenEndpointInContext(config, flags, info, err, clientContext)
|
||||
|
||||
#else
|
||||
|
||||
#define DNS_NOTIFIER_ROUTINE DNSNotifierRoutine
|
||||
#define NOTIFIER_ROUTINE NotifierRoutine
|
||||
#define INIT_OPEN_TRANSPORT() InitOpenTransport()
|
||||
#define OT_OPEN_INTERNET_SERVICES(config, flags, err) OTOpenInternetServices(config, flags, err)
|
||||
#define OT_OPEN_ENDPOINT(config, flags, info, err) OTOpenEndpoint(config, flags, info, err)
|
||||
#endif /* TARGET_CARBON */
|
||||
|
||||
static OTNotifyUPP DNSNotifierRoutineUPP;
|
||||
static OTNotifyUPP NotifierRoutineUPP;
|
||||
static OTNotifyUPP RawEndpointNotifierRoutineUPP;
|
||||
|
||||
void _MD_InitNetAccess()
|
||||
{
|
||||
@ -119,14 +115,9 @@ void _MD_InitNetAccess()
|
||||
|
||||
PR_ASSERT(hasOTTCPIP == PR_TRUE);
|
||||
|
||||
#if TARGET_CARBON
|
||||
DNSNotifierRoutineUPP = NewOTNotifyUPP(DNSNotifierRoutine);
|
||||
notifierRoutineUPP = NewOTNotifyUPP(NotifierRoutine);
|
||||
|
||||
errOT = OTAllocClientContext((UInt32)0, &clientContext);
|
||||
PR_ASSERT(err == kOTNoError);
|
||||
#endif
|
||||
|
||||
NotifierRoutineUPP = NewOTNotifyUPP(NotifierRoutine);
|
||||
RawEndpointNotifierRoutineUPP = NewOTNotifyUPP(RawEndpointNotifierRoutine);
|
||||
|
||||
errOT = INIT_OPEN_TRANSPORT();
|
||||
PR_ASSERT(err == kOTNoError);
|
||||
@ -151,7 +142,7 @@ static void _MD_FinishInitNetAccess()
|
||||
PR_ASSERT((dnsContext.serviceRef != NULL) && (errOT == kOTNoError));
|
||||
|
||||
/* Install notify function for DNR Address To String completion */
|
||||
errOT = OTInstallNotifier(dnsContext.serviceRef, DNS_NOTIFIER_ROUTINE, &dnsContext);
|
||||
errOT = OTInstallNotifier(dnsContext.serviceRef, DNSNotifierRoutineUPP, &dnsContext);
|
||||
PR_ASSERT(errOT == kOTNoError);
|
||||
|
||||
/* Put us into async mode */
|
||||
@ -162,7 +153,7 @@ static void _MD_FinishInitNetAccess()
|
||||
}
|
||||
|
||||
|
||||
pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
|
||||
static pascal void DNSNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
|
||||
{
|
||||
#pragma unused(contextPtr)
|
||||
_PRCPU * cpu = _PR_MD_CURRENT_CPU();
|
||||
@ -284,7 +275,7 @@ WakeUpNotifiedThread(PRThread *thread, OTResult result)
|
||||
// Notification routine
|
||||
// Async callback routine.
|
||||
// A5 is OK. Cannot allocate memory here
|
||||
pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
|
||||
static pascal void NotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
|
||||
{
|
||||
PRFilePrivate *secret = (PRFilePrivate *) contextPtr;
|
||||
_MDFileDesc * md = &(secret->md);
|
||||
@ -1059,7 +1050,7 @@ typedef struct RawEndpointAndThread
|
||||
// Notification routine for raw endpoints not yet attached to a PRFileDesc.
|
||||
// Async callback routine.
|
||||
// A5 is OK. Cannot allocate memory here
|
||||
pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
|
||||
static pascal void RawEndpointNotifierRoutine(void * contextPtr, OTEventCode code, OTResult result, void * cookie)
|
||||
{
|
||||
RawEndpointAndThread *endthr = (RawEndpointAndThread *) contextPtr;
|
||||
PRThread * thread = endthr->thread;
|
||||
@ -1216,7 +1207,7 @@ PRInt32 _MD_accept(PRFileDesc *fd, PRNetAddr *addr, PRUint32 *addrlen, PRInterva
|
||||
endthr->thread = me;
|
||||
endthr->endpoint = (EndpointRef) newosfd;
|
||||
|
||||
err = OTInstallNotifier((ProviderRef) newosfd, RawEndpointNotifierRoutine, endthr);
|
||||
err = OTInstallNotifier((ProviderRef) newosfd, RawEndpointNotifierRoutineUPP, endthr);
|
||||
PR_ASSERT(err == kOTNoError);
|
||||
|
||||
err = OTSetAsynchronous((EndpointRef) newosfd);
|
||||
@ -1816,7 +1807,7 @@ void _MD_makenonblock(PRFileDesc *fd)
|
||||
// fd changes, but the secret structure does not;
|
||||
// (b) the notifier func refers only to the secret data structure
|
||||
// anyway.
|
||||
err = OTInstallNotifier(endpointRef, NOTIFIER_ROUTINE, fd->secret);
|
||||
err = OTInstallNotifier(endpointRef, NotifierRoutineUPP, fd->secret);
|
||||
PR_ASSERT(err == kOTNoError);
|
||||
|
||||
// Now that we have a NotifierRoutine installed, we can make the endpoint asynchronous
|
||||
|
@ -360,7 +360,7 @@ void PR_InitMemory(void) {
|
||||
|
||||
#if TARGET_CARBON
|
||||
extern OTClientContextPtr clientContext;
|
||||
#define CLOSE_OPEN_TRANSPORT() CloseOpenTransport(clientContext)
|
||||
#define CLOSE_OPEN_TRANSPORT() CloseOpenTransportInContext(clientContext)
|
||||
|
||||
#else
|
||||
|
||||
@ -755,7 +755,7 @@ extern long _MD_GetArchitecture(char *buf, long count)
|
||||
{
|
||||
long len;
|
||||
|
||||
#if defined(GENERATINGPOWERPC) && GENERATINGPOWERPC
|
||||
#if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
|
||||
len = PR_snprintf(buf, count, "PowerPC");
|
||||
#else
|
||||
len = PR_snprintf(buf, count, "Motorola68k");
|
||||
|
Loading…
Reference in New Issue
Block a user