1 // unix.h - duplicates some MS defines
14 #define _MAX_FNAME 255
18 #define MAX_FILENAME_LENGTH 64
21 #define __int64 long long
22 #define LARGE_INTEGER long long
23 #define stricmp strcasecmp
24 #define strnicmp strncasecmp
25 #define _strnicmp strncasecmp
29 #define _getcwd getcwd
31 #define _strlwr strlwr
32 #define _unlink unlink
35 #define byte unsigned char
37 #define __except catch
40 extern void strlwr (char *str);
41 extern int filelength (int fd);
42 extern int MulDiv (int, int, int);
44 extern void Sleep (int miliseconds);
45 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
46 extern void OutputDebugString (const char *);
47 extern int WSAGetLastError ();
49 typedef struct FILETIME_s {
52 } FILETIME, *PFILETIME;
54 extern void strlwr (char *str);
55 extern int filelength (int fd);
56 extern int MulDiv (int, int, int);
57 #define CRITICAL_SECTION SDL_mutex*
59 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
61 #define closesocket(A) close(A)
62 #define CopyMemory(A,B,C) memcpy(A,B,C)
63 #define UINT unsigned int
64 #define WORD unsigned short
66 #define SOCKADDR_IN struct sockaddr_in
67 #define SOCKADDR struct sockaddr
68 #define LPSOCKADDR struct sockaddr*
69 #define LPHOSTENT struct hostent*
70 #define HOSTENT struct hostent
71 #define LPINADDR struct in_addr*
72 #define LPIN_ADDR struct in_addr*
73 #define SOCKET_ERROR -1
74 #define INVALID_SOCKET -1
75 #define TIMEVAL struct timeval
76 #define SERVENT struct servent
79 #define WSAEALREADY EALREADY
80 #define WSAEINVAL EINVAL
81 #define WSAEWOULDBLOCK EAGAIN
82 #define WSAEISCONN EISCONN
83 #define WSAECONNRESET ECONNRESET
84 #define WSAECONNABORTED ECONNABORTED
85 #define WSAESHUTDOWN ESHUTDOWN