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*
92 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
97 #define closesocket(A) close(A)
98 #define CopyMemory(A,B,C) memcpy(A,B,C)
99 #define UINT unsigned int
101 #define SOCKADDR_IN struct sockaddr_in
102 #define SOCKADDR struct sockaddr
103 #define LPSOCKADDR struct sockaddr*
104 #define LPHOSTENT struct hostent*
105 #define HOSTENT struct hostent
106 #define LPINADDR struct in_addr*
107 #define LPIN_ADDR struct in_addr*
108 #define SOCKET_ERROR -1
109 #define INVALID_SOCKET -1
110 #define TIMEVAL struct timeval
111 #define SERVENT struct servent
114 #define WSAEALREADY EALREADY
115 #define WSAEINVAL EINVAL
116 #define WSAEWOULDBLOCK EAGAIN
117 #define WSAEISCONN EISCONN
118 #define WSAECONNRESET ECONNRESET
119 #define WSAECONNABORTED ECONNABORTED
120 #define WSAESHUTDOWN ESHUTDOWN
121 #define WSAENOTSOCK ENOTSOCK