1 // unix.h - duplicates some MS defines
13 #define _MAX_FNAME 255
17 #define MAX_FILENAME_LENGTH 64
20 #define __int64 long long
21 #define LARGE_INTEGER long long
22 #define stricmp strcasecmp
23 #define strnicmp strncasecmp
24 #define _strnicmp strncasecmp
28 #define _getcwd getcwd
30 #define _strlwr strlwr
31 #define _unlink unlink
34 #define _access access
35 #define byte unsigned char
37 #define __except catch
42 typedef unsigned long DWORD;
43 typedef unsigned short WORD;
45 extern void strlwr (char *str);
46 extern int filelength (int fd);
47 extern int MulDiv (int, int, int);
49 extern void Sleep (int miliseconds);
50 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
51 extern void OutputDebugString (const char *);
52 extern int WSAGetLastError ();
53 extern void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext);
55 typedef struct FILETIME_s {
58 } FILETIME, *PFILETIME;
60 #define WAVE_FORMAT_PCM 1
61 #define WAVE_FORMAT_ADPCM 2
63 // these structures are packed on WIN32 so do it here too
69 DWORD nAvgBytesPerSec;
82 DWORD nAvgBytesPerSec;
89 #define CRITICAL_SECTION SDL_mutex*
91 #define closesocket(A) close(A)
92 #define CopyMemory(A,B,C) memcpy(A,B,C)
93 #define UINT unsigned int
95 #define SOCKADDR_IN struct sockaddr_in
96 #define SOCKADDR struct sockaddr
97 #define LPSOCKADDR struct sockaddr*
98 #define LPHOSTENT struct hostent*
99 #define HOSTENT struct hostent
100 #define LPINADDR struct in_addr*
101 #define LPIN_ADDR struct in_addr*
102 #define SOCKET_ERROR -1
103 #define INVALID_SOCKET -1
104 #define TIMEVAL struct timeval
105 #define SERVENT struct servent
108 #define WSAEALREADY EALREADY
109 #define WSAEINVAL EINVAL
110 #define WSAEWOULDBLOCK EAGAIN
111 #define WSAEISCONN EISCONN
112 #define WSAECONNRESET ECONNRESET
113 #define WSAECONNABORTED ECONNABORTED
114 #define WSAESHUTDOWN ESHUTDOWN
115 #define WSAENOTSOCK ENOTSOCK