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
43 extern void strlwr (char *str);
44 extern int filelength (int fd);
45 extern int MulDiv (int, int, int);
47 extern void Sleep (int miliseconds);
48 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
49 extern void OutputDebugString (const char *);
50 extern int WSAGetLastError ();
52 typedef struct FILETIME_s {
55 } FILETIME, *PFILETIME;
61 DWORD nAvgBytesPerSec;
66 extern void strlwr (char *str);
67 extern int filelength (int fd);
68 extern int MulDiv (int, int, int);
69 #define CRITICAL_SECTION SDL_mutex*
71 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
73 #define closesocket(A) close(A)
74 #define CopyMemory(A,B,C) memcpy(A,B,C)
75 #define UINT unsigned int
77 #define SOCKADDR_IN struct sockaddr_in
78 #define SOCKADDR struct sockaddr
79 #define LPSOCKADDR struct sockaddr*
80 #define LPHOSTENT struct hostent*
81 #define HOSTENT struct hostent
82 #define LPINADDR struct in_addr*
83 #define LPIN_ADDR struct in_addr*
84 #define SOCKET_ERROR -1
85 #define INVALID_SOCKET -1
86 #define TIMEVAL struct timeval
87 #define SERVENT struct servent
90 #define WSAEALREADY EALREADY
91 #define WSAEINVAL EINVAL
92 #define WSAEWOULDBLOCK EAGAIN
93 #define WSAEISCONN EISCONN
94 #define WSAECONNRESET ECONNRESET
95 #define WSAECONNABORTED ECONNABORTED
96 #define WSAESHUTDOWN ESHUTDOWN