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 #if ( defined(__x86_64__) || defined(_WIN64) )
43 typedef unsigned int DWORD;
45 typedef unsigned long DWORD;
47 typedef unsigned short WORD;
49 extern void strlwr (char *str);
50 extern void strupr (char *str);
51 extern int filelength (int fd);
52 extern int MulDiv (int, int, int);
54 extern void Sleep (int miliseconds);
55 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
56 extern void OutputDebugString (const char *);
57 extern int WSAGetLastError ();
58 extern void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext);
60 typedef struct FILETIME_s {
63 } FILETIME, *PFILETIME;
65 #define WAVE_FORMAT_PCM 1
66 #define WAVE_FORMAT_ADPCM 2
68 // these structures are packed on WIN32 so do it here too
74 DWORD nAvgBytesPerSec;
87 DWORD nAvgBytesPerSec;
94 #define CRITICAL_SECTION SDL_mutex*
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