diff --git a/sync/base.h b/sync/base.h index 8eab00a..f3eac93 100644 --- a/sync/base.h +++ b/sync/base.h @@ -7,7 +7,7 @@ /* configure inline keyword */ #if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) - #if defined(_MSC_VER) || defined(__GNUC__) + #if defined(_MSC_VER) || defined(__GNUC__) || defined(__SASC) #define inline __inline #else /* compiler does not support inline, make function static instead */ @@ -23,6 +23,8 @@ typedef unsigned int uint32_t; #elif defined(__GNUC__) #include +#elif defined(M68000) + typedef unsigned int uint32_t; #endif /* configure socket-stack */ @@ -31,6 +33,15 @@ #define NOMINMAX #include #include +#elif defined(USE_AMITCP) + #include + #include + #include + #include + #define SOCKET int + #define INVALID_SOCKET -1 + #define select(n,r,w,e,t) WaitSelect(n,r,w,e,t,0) + #define closesocket(x) CloseSocket(x) #else #include #include diff --git a/sync/device.c b/sync/device.c index 93deb5a..4f9c30d 100644 --- a/sync/device.c +++ b/sync/device.c @@ -21,6 +21,10 @@ static const char *sync_track_path(const char *base, const char *name) #ifndef SYNC_PLAYER +#ifdef USE_AMITCP +static struct Library *socket_base = NULL; +#endif + static SOCKET server_connect(const char *host, unsigned short nport) { struct hostent *he; @@ -36,6 +40,12 @@ static SOCKET server_connect(const char *host, unsigned short nport) return INVALID_SOCKET; need_init = 0; } +#elif defined(USE_AMITCP) + if (!socket_base) { + socket_base = OpenLibrary("bsdsocket.library", 4); + if (!socket_base) + return INVALID_SOCKET; + } #endif he = gethostbyname(host); @@ -101,6 +111,13 @@ void sync_destroy_device(struct sync_device *d) free(d->base); sync_data_deinit(&d->data); free(d); + +#if defined(USE_AMITCP) && !defined(SYNC_PLAYER) + if (socket_base) { + CloseLibrary(socket_base); + socket_base = NULL; + } +#endif } #ifdef SYNC_PLAYER