1 // unix.h - duplicates some MS defines
15 #define _MAX_FNAME 255
19 #define MAX_FILENAME_LENGTH 64
22 #define __int64 long long
23 #define LARGE_INTEGER long long
24 #define stricmp strcasecmp
25 #define strnicmp strncasecmp
26 #define _strnicmp strncasecmp
30 #define _getcwd getcwd
32 #define _strlwr strlwr
33 #define _unlink unlink
36 #define _access access
37 #define byte unsigned char
39 #define __except catch
44 extern void strlwr (char *str);
45 extern int filelength (int fd);
46 extern int MulDiv (int, int, int);
48 extern void Sleep (int miliseconds);
49 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
50 extern void OutputDebugString (const char *);
51 extern int WSAGetLastError ();
53 typedef struct FILETIME_s {
56 } FILETIME, *PFILETIME;
62 DWORD nAvgBytesPerSec;
67 extern void strlwr (char *str);
68 extern int filelength (int fd);
69 extern int MulDiv (int, int, int);
70 #define CRITICAL_SECTION SDL_mutex*
73 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
78 #define closesocket(A) close(A)
79 #define CopyMemory(A,B,C) memcpy(A,B,C)
80 #define UINT unsigned int
82 #define SOCKADDR_IN struct sockaddr_in
83 #define SOCKADDR struct sockaddr
84 #define LPSOCKADDR struct sockaddr*
85 #define LPHOSTENT struct hostent*
86 #define HOSTENT struct hostent
87 #define LPINADDR struct in_addr*
88 #define LPIN_ADDR struct in_addr*
89 #define SOCKET_ERROR -1
90 #define INVALID_SOCKET -1
91 #define TIMEVAL struct timeval
92 #define SERVENT struct servent
95 #define WSAEALREADY EALREADY
96 #define WSAEINVAL EINVAL
97 #define WSAEWOULDBLOCK EAGAIN
98 #define WSAEISCONN EISCONN
99 #define WSAECONNRESET ECONNRESET
100 #define WSAECONNABORTED ECONNABORTED
101 #define WSAESHUTDOWN ESHUTDOWN
104 #define gr_d3d_bitmap gr_opengl_bitmap
105 #define gr_d3d_init gr_opengl_init
106 #define gr_d3d_activate gr_opengl_activate
107 #define gr_d3d_cleanup gr_opengl_cleanup
108 #define gr_d3d_bitmap_ex gr_opengl_bitmap_ex
109 #define gr_d3d_preload_init gr_opengl_preload_init
110 //#define gr_d3d_FOO gr_opengl_FOO