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 ();
52 extern void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext);
54 typedef struct FILETIME_s {
57 } FILETIME, *PFILETIME;
59 #define WAVE_FORMAT_PCM 1
60 #define WAVE_FORMAT_ADPCM 2
66 DWORD nAvgBytesPerSec;
79 DWORD nAvgBytesPerSec;
85 extern void strlwr (char *str);
86 extern int filelength (int fd);
87 extern int MulDiv (int, int, int);
88 #define CRITICAL_SECTION SDL_mutex*
91 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
96 #define closesocket(A) close(A)
97 #define CopyMemory(A,B,C) memcpy(A,B,C)
98 #define UINT unsigned int
100 #define SOCKADDR_IN struct sockaddr_in
101 #define SOCKADDR struct sockaddr
102 #define LPSOCKADDR struct sockaddr*
103 #define LPHOSTENT struct hostent*
104 #define HOSTENT struct hostent
105 #define LPINADDR struct in_addr*
106 #define LPIN_ADDR struct in_addr*
107 #define SOCKET_ERROR -1
108 #define INVALID_SOCKET -1
109 #define TIMEVAL struct timeval
110 #define SERVENT struct servent
113 #define WSAEALREADY EALREADY
114 #define WSAEINVAL EINVAL
115 #define WSAEWOULDBLOCK EAGAIN
116 #define WSAEISCONN EISCONN
117 #define WSAECONNRESET ECONNRESET
118 #define WSAECONNABORTED ECONNABORTED
119 #define WSAESHUTDOWN ESHUTDOWN
120 #define WSAENOTSOCK ENOTSOCK