#include <OpenTransportProviders.h>
#include <OpenTptInternet.h>
#endif
-#if TARGET_CARBON
+#if TARGET_CARBON && !defined(OTAssert)
#define OTAssert( str , cond ) /* does not exists in Carbon */
#endif
#endif /* __GSOCKET_STANDALONE__ */
+#ifndef ntohl
+#define ntohl(x) (x)
+#define ntohs(x) (x)
+#define htonl(x) (x)
+#define htons(x) (x)
+#endif
+
void wxCYield() ;
#ifdef __WXDEBUG__
#define qDebug 1
/* Global initialisers */
+void GSocket_SetGUIFunctions(struct GSocketGUIFunctionsTable *table)
+{
+ // do nothing, wxMac doesn't have wxBase-GUI separation yet
+}
+
int GSocket_Init()
{
return TRUE;
OTByteCount sz = 0 ;
OTCountDataBytes( socket->m_endpoint , &sz ) ;
- if ( size > sz )
+ if ( size > (int)sz )
size = sz ;
res = OTRcv( socket->m_endpoint , buffer , size , &flags ) ;
if ( res < 0 )
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
- address->m_host = hostaddr ;
+ address->m_host = htonl(hostaddr) ;
return GSOCK_NOERROR;
}
GSocketError GAddress_INET_SetPortName(GAddress *address, const char *port,
const char *protocol)
{
- int i ;
+ size_t i ;
assert(address != NULL);
CHECK_ADDRESS(address, INET, GSOCK_INVADDR);
assert(address != NULL);
CHECK_ADDRESS(address, INET, 0);
- return address->m_host;
+ return ntohl(address->m_host);
}
unsigned short GAddress_INET_GetPort(GAddress *address)