#ifndef __GSOCKET_STANDALONE__
#include "wx/setup.h"
+#include "wx/platform.h"
#endif
#if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__)
#define TRUE 1
#endif
#else
+ #include <MacHeaders.c>
#define OTUNIXERRORS 1
#include <OpenTransport.h>
#include <OpenTransportProviders.h>
#include <OTDebug.h>
#endif
InetSvcRef gInetSvcRef = 0 ;
-
+int gOTInited = 0 ;
OSStatus DoNegotiateIPReuseAddrOption(EndpointRef ep, Boolean enableReuseIPMode);
return TRUE ;
InitOpenTransportInContext(kInitOTForApplicationMask, &clientcontext);
+ gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServicesInContext(kDefaultInternetServicesPath,
NULL, &err, clientcontext);
#else
return TRUE ;
InitOpenTransport() ;
+ gOTInited = 1 ;
gInetSvcRef = OTOpenInternetServices(kDefaultInternetServicesPath, NULL, &err);
#endif
if ( gInetSvcRef == NULL || err != kOTNoError )
void GSocket_Cleanup()
{
- if ( gInetSvcRef != NULL )
- OTCloseProvider( gInetSvcRef );
-#if TARGET_CARBON
- CloseOpenTransportInContext( NULL ) ;
-#else
- CloseOpenTransport() ;
-#endif
+ if ( gOTInited != 0 )
+ {
+ if ( gInetSvcRef != NULL )
+ OTCloseProvider( gInetSvcRef );
+ #if TARGET_CARBON
+ CloseOpenTransportInContext( NULL ) ;
+ #else
+ CloseOpenTransport() ;
+ #endif
+ }
}
/* Constructors / Destructors for GSocket */
/* 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__) */