MTek-GDL
0.100.4-muffintrap
Loading...
Searching...
No Matches
include
mgdl
rocket
device.h
1
#ifndef SYNC_DEVICE_H
2
#define SYNC_DEVICE_H
3
4
#ifdef __cplusplus
5
extern
"C"
{
6
#endif
7
8
#include "base.h"
9
#include "sync.h"
10
11
#ifndef N64
12
#ifndef SYNC_PLAYER
13
14
/* configure socket-stack */
15
#ifdef _WIN32
16
#define WIN32_LEAN_AND_MEAN
17
#define USE_GETADDRINFO
18
#ifndef NOMINMAX
19
#define NOMINMAX
20
#endif
21
/* TODO/FIXME: verify setsockopt(TCP_NODELAY) works w/WIN32 using just these headers,
22
* or add the necessary headers if possible, and add #define USE_NODELAY.
23
*/
24
#include <winsock2.h>
25
#include <ws2tcpip.h>
26
#include <windows.h>
27
#include <limits.h>
28
#elif defined(USE_AMITCP)
29
#include <sys/socket.h>
30
#include <proto/exec.h>
31
#include <proto/socket.h>
32
#include <netdb.h>
33
#define SOCKET int
34
#define INVALID_SOCKET -1
35
#define select(n,r,w,e,t) WaitSelect(n,r,w,e,t,0)
36
#define closesocket(x) CloseSocket(x)
37
#elif defined(GEKKO)
38
#include <gccore.h>
39
#include <network.h>
40
#define SOCKET s32
41
#ifndef INVALID_SOCKET
42
#define INVALID_SOCKET (-1)
43
#endif
44
#define closesocket(x) net_close(x)
45
#define send(s,b,l,f) net_send(s,b,l,f)
46
#define recv(s,b,l,f) net_recv(s,b,l,f)
47
#ifdef USE_GETADDRINFO
48
#error "getaddrinfo and libogc are incompatible with each other!"
49
#endif
50
#define gethostbyname(h) net_gethostbyname(h)
51
#define socket(f,t,x) net_socket(f,t,x)
52
#define connect(s,a,l) net_connect(s,a,l)
53
#else
54
#include <sys/socket.h>
55
#include <sys/time.h>
56
#include <netinet/in.h>
57
#ifdef USE_NODELAY
58
#include <netinet/tcp.h>
59
#endif
60
#include <netdb.h>
61
#include <unistd.h>
62
#define SOCKET int
63
#define INVALID_SOCKET -1
64
#define closesocket(x) close(x)
65
#endif
66
67
#endif
/* !defined(SYNC_PLAYER) */
68
69
struct
sync_device
{
70
char
*base;
71
struct
sync_track
**tracks;
72
size_t
num_tracks;
73
74
#ifndef SYNC_PLAYER
75
int
row;
76
SOCKET sock;
77
#endif
78
struct
sync_io_cb
io_cb;
79
};
80
#endif
/* !define(N64)*/
81
82
#ifdef __cplusplus
83
}
84
#endif
85
86
#endif
/* SYNC_DEVICE_H */
sync_device
Definition
device.h:69
sync_io_cb
Definition
sync.h:41
sync_track
Definition
track.h:26
Generated by
1.9.8