|
|
1.1 root 1: /*
2: * UAE - The Un*x Amiga Emulator
3: *
4: * Try to include the right system headers and get other system-specific
5: * stuff right.
6: *
7: * Copyright 1996 Bernd Schmidt
8: */
9:
10: #include <stdio.h>
11: #include <stdlib.h>
12: #include <errno.h>
13: #include <assert.h>
14:
15: #ifdef HAVE_SYS_TYPES_H
16: #include <sys/types.h>
17: #endif
18:
19: #ifdef HAVE_VALUES_H
20: #include <values.h>
21: #endif
22:
23: #ifdef HAVE_STRINGS_H
24: #include <strings.h>
25: #endif
26: #ifdef HAVE_STRING_H
27: #include <string.h>
28: #endif
29:
30: #ifdef HAVE_UNISTD_H
31: #include <unistd.h>
32: #endif
33: #ifdef HAVE_FCNTL_H
34: #include <fcntl.h>
35: #endif
36:
37: #ifdef HAVE_UTIME_H
38: #include <utime.h>
39: #endif
40:
41: #ifdef HAVE_SYS_PARAM_H
42: #include <sys/param.h>
43: #endif
44:
45: #ifdef HAVE_SYS_MOUNT_H
46: #include <sys/mount.h>
47: #endif
48:
49: #ifdef HAVE_SYS_VFS_H
50: #include <sys/vfs.h>
51: #endif
52:
53: #ifdef HAVE_SYS_STAT_H
54: #include <sys/stat.h>
55: #endif
56:
57: #if 0 /* Maybe this should be something else... anything missing? */
58: #ifdef HAVE_SYS_MOUNT_H
59: #include <sys/mount.h>
60: #endif
61: #endif
62:
63: #ifdef HAVE_SYS_STATFS_H
64: #include <sys/statfs.h>
65: #endif
66:
67: #ifdef HAVE_SYS_STATVFS_H
68: #include <sys/statvfs.h>
69: #endif
70:
71: #if TIME_WITH_SYS_TIME
72: # include <sys/time.h>
73: # include <time.h>
74: #else
75: # if HAVE_SYS_TIME_H
76: # include <sys/time.h>
77: # else
78: # include <time.h>
79: # endif
80: #endif
81:
82: #if HAVE_DIRENT_H
83: # include <dirent.h>
84: #else
85: # define dirent direct
86: # if HAVE_SYS_NDIR_H
87: # include <sys/ndir.h>
88: # endif
89: # if HAVE_SYS_DIR_H
90: # include <sys/dir.h>
91: # endif
92: # if HAVE_NDIR_H
93: # include <ndir.h>
94: # endif
95: #endif
96:
97: #include <errno.h>
98: #include <assert.h>
99:
100: #ifdef HAVE_LINUX_JOYSTICK_H
101: #if BROKEN_JOYSTICK_H == 1
102: #include "joystick.h"
103: #else
104: #include <linux/joystick.h>
105: #endif
106: #endif
107:
108: #ifdef __NeXT__
109: #define S_IRUSR S_IREAD
110: #define S_IWUSR S_IWRITE
111: #define S_IXUSR S_IEXEC
112: #define S_ISDIR(val) (S_IFDIR & val)
113: struct utimbuf
114: {
115: time_t actime;
116: time_t modtime;
117: };
118: #endif
119:
120: #if defined(__SASC) && defined(AMIGA)
121: #include <sys/types.h>
122: #include <sys/stat.h>
123: #include <dirent.h>
124: #include <stdio.h>
125: #include <fcntl.h>
126: #include <time.h>
127:
128: int mkdir(const char *);
129: int rmdir(const char *);
130:
131: #define S_ISDIR(m) (m & S_IFDIR)
132: #define S_IRUSR ~S_IREAD
133: #define S_IWUSR ~(S_IWRITE|S_IDELETE)
134: #define S_IXUSR ~S_IEXECUTE
135:
136: typedef unsigned short mode_t;
137:
138: #define strcasecmp stricmp
139:
140: #endif
141:
142: #ifdef __DOS__
143: #include <pc.h>
144: #include <io.h>
145: #else
146: #undef O_BINARY
147: #define O_BINARY 0
148: #endif
149:
150: /* If char has more then 8 bits, good night. */
151: typedef unsigned char UBYTE;
152: typedef signed char BYTE;
153:
154: #if SIZEOF_SHORT == 2
155: typedef unsigned short UWORD;
156: typedef short WORD;
157: #elif SIZEOF_INT == 2
158: typedef unsigned int UWORD;
159: typedef int WORD;
160: #else
161: #error No 2 byte type, you lose.
162: #endif
163:
164: #if SIZEOF_INT == 4
165: typedef unsigned int ULONG;
166: typedef int LONG;
167: #elif SIZEOF_LONG == 4
168: typedef unsigned long ULONG;
169: typedef long LONG;
170: #else
171: #error No 4 byte type, you lose.
172: #endif
173: typedef ULONG CPTR;
174:
175: #if defined(__SASC) && defined(AMIGA)
176: #define chip rhubarb
177: #endif /* __SASC */
178:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.