]> icculus.org git repositories - taylor/freespace2.git/blob - include/unix.h
added a few files that needed to be compiled
[taylor/freespace2.git] / include / unix.h
1 // unix.h - duplicates some MS defines
2
3 #ifndef _UNIX_H
4 #define _UNIX_H
5
6 #include <stdio.h>
7 #include <sys/types.h>
8 #include <unistd.h>
9 #include "SDL.h"
10
11 #define TRUE 1
12 #define FALSE 0
13 #define DWORD int
14 #define _MAX_FNAME 255
15 #define _MAX_PATH 255
16 #define MAX_PATH 255
17 #define _MAX_DIR 256
18 #define MAX_FILENAME_LENGTH 64
19 #define _cdecl
20 #define __cdecl
21 #define __int64 long long
22 #define LARGE_INTEGER long long
23 #define stricmp strcasecmp
24 #define strnicmp strncasecmp
25 #define _strnicmp strncasecmp
26 #define _isnan isnan
27 #define HANDLE int
28 #define HINSTANCE int
29 #define _getcwd getcwd
30 #define _chdir chdir
31 #define _strlwr strlwr
32 #define _unlink unlink
33 #define _mkdir mkdir
34 #define _hypot hypot
35 #define _access access
36 #define byte unsigned char
37 #define __try try
38 #define __except catch
39 #define LPSTR char *
40 #define PASCAL
41
42 extern void strlwr (char *str);
43 extern int filelength (int fd);
44 extern int MulDiv (int, int, int);
45
46 extern void Sleep (int miliseconds);
47 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
48 extern void OutputDebugString (const char *);
49 extern int WSAGetLastError ();
50
51 typedef struct FILETIME_s {
52             DWORD dwLowDateTime;
53             DWORD dwHighDateTime;
54 } FILETIME, *PFILETIME;
55
56 extern void strlwr (char *str);
57 extern int filelength (int fd);
58 extern int MulDiv (int, int, int);
59 #define CRITICAL_SECTION SDL_mutex*
60
61 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
62
63 #define closesocket(A) close(A)
64 #define CopyMemory(A,B,C) memcpy(A,B,C)
65 #define UINT unsigned int
66 #define WORD unsigned short
67 #define SOCKET int
68 #define SOCKADDR_IN struct sockaddr_in
69 #define SOCKADDR struct sockaddr
70 #define LPSOCKADDR struct sockaddr*
71 #define LPHOSTENT struct hostent*
72 #define HOSTENT struct hostent
73 #define LPINADDR struct in_addr*
74 #define LPIN_ADDR struct in_addr*
75 #define SOCKET_ERROR -1
76 #define INVALID_SOCKET -1
77 #define TIMEVAL struct timeval
78 #define SERVENT struct servent
79 #define BOOL int
80
81 #define WSAEALREADY EALREADY
82 #define WSAEINVAL EINVAL
83 #define WSAEWOULDBLOCK EAGAIN
84 #define WSAEISCONN EISCONN
85 #define WSAECONNRESET ECONNRESET
86 #define WSAECONNABORTED ECONNABORTED
87 #define WSAESHUTDOWN ESHUTDOWN
88
89 #endif