]> icculus.org git repositories - taylor/freespace2.git/blob - include/unix.h
Fix some minor stuff
[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 byte unsigned char
36 #define __try try
37 #define __except catch
38 #define LPSTR char *
39
40 extern void strlwr (char *str);
41 extern int filelength (int fd);
42 extern int MulDiv (int, int, int);
43
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 ();
48
49 typedef struct FILETIME_s {
50             DWORD dwLowDateTime;
51             DWORD dwHighDateTime;
52 } FILETIME, *PFILETIME;
53
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*
58
59 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
60
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
65 #define SOCKET int
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
77 #define BOOL int
78
79 #define WSAEALREADY EALREADY
80 #define WSAEINVAL EINVAL
81 #define WSAEWOULDBLOCK EWOULDBLOCK
82 #define WSAEISCONN EISCONN
83
84 #endif