player: amiga-support
Proper Amiga-suport is supplied by using the AmiTCP stack when USE_AMITCP is enabled. Add explicit OpenLibrary/CloseLibrary calls, for those people who don't link against auto-opening libs ala VBCC's auto.s. Add a typedef for uint32_t (needed for network communication) for Motorola 68k platforms. Also add a SAS/C support for the 'inline' keyword. Thanks to Aske Simon Christensen for help with the SAS/C support.
This commit is contained in:
parent
dbe3cc7dcf
commit
b3825514b2
13
sync/base.h
13
sync/base.h
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
/* configure inline keyword */
|
/* configure inline keyword */
|
||||||
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
|
#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
|
||||||
#if defined(_MSC_VER) || defined(__GNUC__)
|
#if defined(_MSC_VER) || defined(__GNUC__) || defined(__SASC)
|
||||||
#define inline __inline
|
#define inline __inline
|
||||||
#else
|
#else
|
||||||
/* compiler does not support inline, make function static instead */
|
/* compiler does not support inline, make function static instead */
|
||||||
@ -23,6 +23,8 @@
|
|||||||
typedef unsigned int uint32_t;
|
typedef unsigned int uint32_t;
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif defined(M68000)
|
||||||
|
typedef unsigned int uint32_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* configure socket-stack */
|
/* configure socket-stack */
|
||||||
@ -31,6 +33,15 @@
|
|||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
#elif defined(USE_AMITCP)
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <proto/exec.h>
|
||||||
|
#include <proto/socket.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#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
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|||||||
@ -21,6 +21,10 @@ static const char *sync_track_path(const char *base, const char *name)
|
|||||||
|
|
||||||
#ifndef SYNC_PLAYER
|
#ifndef SYNC_PLAYER
|
||||||
|
|
||||||
|
#ifdef USE_AMITCP
|
||||||
|
static struct Library *socket_base = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
static SOCKET server_connect(const char *host, unsigned short nport)
|
static SOCKET server_connect(const char *host, unsigned short nport)
|
||||||
{
|
{
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
@ -36,6 +40,12 @@ static SOCKET server_connect(const char *host, unsigned short nport)
|
|||||||
return INVALID_SOCKET;
|
return INVALID_SOCKET;
|
||||||
need_init = 0;
|
need_init = 0;
|
||||||
}
|
}
|
||||||
|
#elif defined(USE_AMITCP)
|
||||||
|
if (!socket_base) {
|
||||||
|
socket_base = OpenLibrary("bsdsocket.library", 4);
|
||||||
|
if (!socket_base)
|
||||||
|
return INVALID_SOCKET;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
he = gethostbyname(host);
|
he = gethostbyname(host);
|
||||||
@ -101,6 +111,13 @@ void sync_destroy_device(struct sync_device *d)
|
|||||||
free(d->base);
|
free(d->base);
|
||||||
sync_data_deinit(&d->data);
|
sync_data_deinit(&d->data);
|
||||||
free(d);
|
free(d);
|
||||||
|
|
||||||
|
#if defined(USE_AMITCP) && !defined(SYNC_PLAYER)
|
||||||
|
if (socket_base) {
|
||||||
|
CloseLibrary(socket_base);
|
||||||
|
socket_base = NULL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SYNC_PLAYER
|
#ifdef SYNC_PLAYER
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user