]> icculus.org git repositories - taylor/freespace2.git/blob - include/unix.h
updated
[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 DWORD int
12 #define _MAX_FNAME 255
13 #define _MAX_PATH 255
14 #define MAX_PATH 255
15 #define _MAX_DIR 256
16 #define MAX_FILENAME_LENGTH 64
17 #define _cdecl
18 #define __cdecl
19 #define __int64 long long
20 #define LARGE_INTEGER long long
21 #define stricmp strcasecmp
22 #define strnicmp strncasecmp
23 #define _strnicmp strncasecmp
24 #define _isnan isnan
25 #define HANDLE int
26 #define HINSTANCE int
27 #define _getcwd getcwd
28 #define _chdir chdir
29 #define _strlwr strlwr
30 #define _unlink unlink
31 #define _mkdir mkdir
32 #define _hypot hypot
33 #define byte unsigned char
34 #define __try try
35 #define __except catch
36
37 extern void strlwr (char *str);
38 extern int filelength (int fd);
39 extern int MulDiv (int, int, int);
40
41 extern void Sleep (int miliseconds);
42 extern unsigned long _beginthread (void (*pfuncStart)(void *), unsigned unStackSize, void* pArgList);
43 extern void OutputDebugString (const char *);
44
45 typedef struct FILETIME_s {
46             DWORD dwLowDateTime;
47             DWORD dwHighDateTime;
48 } FILETIME, *PFILETIME;
49
50 extern void strlwr (char *str);
51 extern int filelength (int fd);
52 extern int MulDiv (int, int, int);
53 #define CRITICAL_SECTION SDL_mutex*
54
55 #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
56
57 #define closesocket(A) close(A)
58 #define CopyMemory(A,B,C) memcpy(A,B,C)
59 #define UINT unsigned int
60 #define WORD unsigned short
61 #define SOCKET int
62 #define SOCKADDR_IN struct sockaddr_in
63 #define SOCKADDR struct sockaddr
64 #define LPSOCKADDR struct sockaddr*
65 #define LPHOSTENT struct hostent*
66 #define HOSTENT struct hostent
67 #define LPINADDR struct in_addr*
68 #define LPIN_ADDR struct in_addr*
69 #define SOCKET_ERROR -1
70 #define INVALID_SOCKET -1
71 #define TIMEVAL struct timeval
72 #define SERVENT struct servent
73 #define BOOL int
74
75 #endif