X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/76a5e5d21ee1a6230d777ce0209b2df4c6075f0f..84e7f94cb078e98b31c5ba592e10d8311b24f65b:/src/mac/gsocket.c?ds=sidebyside diff --git a/src/mac/gsocket.c b/src/mac/gsocket.c index 7fed13e8c4..f3985aee92 100644 --- a/src/mac/gsocket.c +++ b/src/mac/gsocket.c @@ -15,6 +15,7 @@ #ifndef __GSOCKET_STANDALONE__ #include "wx/setup.h" +#include "wx/platform.h" #endif #if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) @@ -35,7 +36,7 @@ #include #include #endif -#if TARGET_CARBON +#if TARGET_CARBON && !defined(OTAssert) #define OTAssert( str , cond ) /* does not exists in Carbon */ #endif @@ -86,6 +87,7 @@ extern pascal void OTDebugStr(const char* str); #endif InetSvcRef gInetSvcRef = 0 ; int gOTInited = 0 ; +OTNotifyUPP gOTNotifierUPP = NULL ; OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode); @@ -184,7 +186,7 @@ static void SetDefaultEndpointModes(EndpointRef ep , void *data ) junk = OTSetBlocking(ep); OTAssert("SetDefaultEndpointModes: Could not set blocking", junk == noErr); */ - junk = OTInstallNotifier(ep, OTInetEventHandler, data); + junk = OTInstallNotifier(ep, gOTNotifierUPP, data); OTAssert("SetDefaultEndpointModes: Could not install notifier", junk == noErr); /* junk = OTUseSyncIdleEvents(ep, true); @@ -228,6 +230,7 @@ int GSocket_Verify_Inited() OTAssert("Could not open Inet Services", err == noErr); return FALSE ; } + gOTNotifierUPP = NewOTNotifyUPP( OTInetEventHandler ) ; return TRUE ; } @@ -242,6 +245,8 @@ void GSocket_Cleanup() #else CloseOpenTransport() ; #endif + if ( gOTNotifierUPP ) + DisposeOTNotifyUPP( gOTNotifierUPP ) ; } } @@ -472,9 +477,6 @@ GAddress *GSocket_GetPeer(GSocket *socket) */ GSocketError GSocket_SetServer(GSocket *sck) { - int type; - int arg = 1; - assert(sck != NULL); /* must not be in use */ @@ -544,9 +546,6 @@ GSocketError GSocket_SetServer(GSocket *sck) GSocket *GSocket_WaitConnection(GSocket *socket) { GSocket *connection = NULL ; - GSocketError err; - - int arg = 1; assert(socket != NULL); @@ -639,8 +638,6 @@ GSocket *GSocket_WaitConnection(GSocket *socket) */ GSocketError GSocket_SetNonOriented(GSocket *sck) { - int arg = 1; - assert(sck != NULL); if (sck->m_endpoint != kOTInvalidEndpointRef ) @@ -725,12 +722,9 @@ GSocketError GSocket_SetNonOriented(GSocket *sck) */ GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream) { - int ret; - int arg = 1; InetAddress addr ; TEndpointInfo info; - OTFlags flags = 0; - OSStatus err = kOTNoError; + OSStatus err = kOTNoError; TCall peer ; assert(sck != NULL); @@ -931,7 +925,6 @@ int GSocket_Write(GSocket *socket, const char *buffer, int size) */ GSocketEventFlags GSocket_Select(GSocket *socket, GSocketEventFlags flags) { - OTResult state ; assert(socket != NULL); wxMacProcessNotifierEvents() ; /* @@ -1326,8 +1319,6 @@ GSocketError GAddress_INET_SetAnyAddress(GAddress *address) GSocketError GAddress_INET_SetHostAddress(GAddress *address, unsigned long hostaddr) { - struct in_addr *addr; - assert(address != NULL); CHECK_ADDRESS(address, INET, GSOCK_INVADDR); @@ -1353,7 +1344,6 @@ service_entry gServices[] = GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, const char *protocol) { - InetAddress *addr; int i ; assert(address != NULL); @@ -1388,8 +1378,6 @@ GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port, GSocketError GAddress_INET_SetPort(GAddress *address, unsigned short port) { - InetAddress *addr; - assert(address != NULL); CHECK_ADDRESS(address, INET, GSOCK_INVADDR); address->m_port = port ; @@ -1649,10 +1637,12 @@ void _GSocket_Internal_Proc(unsigned long e , void* d ) /* Hack added for Mac OS X */ GSocketError GAddress_UNIX_GetPath(GAddress *addr, char *path, size_t buf) { + return GSOCK_INVADDR; } GSocketError GAddress_UNIX_SetPath(GAddress *addr, const char *path) { + return GSOCK_INVADDR; } #endif /* wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) */