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 int filelength (int fd);
51 extern int MulDiv (int, int, int);
53 extern void Sleep (int miliseconds);
54 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
55 extern void OutputDebugString (const char *);
56 extern int WSAGetLastError ();
57 extern void _splitpath (const char *path, char *drive, char *dir, char *fname, char *ext);
59 typedef struct FILETIME_s {
62 } FILETIME, *PFILETIME;
64 #define WAVE_FORMAT_PCM 1
65 #define WAVE_FORMAT_ADPCM 2
67 // these structures are packed on WIN32 so do it here too
73 DWORD nAvgBytesPerSec;
86 DWORD nAvgBytesPerSec;
93 #define CRITICAL_SECTION SDL_mutex*
95 #define closesocket(A) close(A)
96 #define CopyMemory(A,B,C) memcpy(A,B,C)
97 #define UINT unsigned int
99 #define SOCKADDR_IN struct sockaddr_in
100 #define SOCKADDR struct sockaddr
101 #define LPSOCKADDR struct sockaddr*
102 #define LPHOSTENT struct hostent*
103 #define HOSTENT struct hostent
104 #define LPINADDR struct in_addr*
105 #define LPIN_ADDR struct in_addr*
106 #define SOCKET_ERROR -1
107 #define INVALID_SOCKET -1
108 #define TIMEVAL struct timeval
109 #define SERVENT struct servent
112 #define WSAEALREADY EALREADY
113 #define WSAEINVAL EINVAL
114 #define WSAEWOULDBLOCK EAGAIN
115 #define WSAEISCONN EISCONN
116 #define WSAECONNRESET ECONNRESET
117 #define WSAECONNABORTED ECONNABORTED
118 #define WSAESHUTDOWN ESHUTDOWN
119 #define WSAENOTSOCK ENOTSOCK