|
|
1.1 root 1: /*
1.1.1.2 root 2: * UAE - The Un*x Amiga Emulator - CPU core
1.1 root 3: *
4: * Try to include the right system headers and get other system-specific
5: * stuff right & other collected kludges.
6: *
7: * If you think about modifying this, think twice. Some systems rely on
8: * the exact order of the #include statements. That's also the reason
9: * why everything gets included unconditionally regardless of whether
10: * it's actually needed by the .c file.
11: *
12: * Copyright 1996, 1997 Bernd Schmidt
1.1.1.2 root 13: *
14: * Adaptation to Hatari by Thomas Huth
15: *
1.1.1.5 root 16: * This file is distributed under the GNU Public License, version 2 or at
17: * your option any later version. Read the file gpl.txt for details.
1.1 root 18: */
19:
1.1.1.4 root 20: #ifndef UAE_SYSDEPS_H
21: #define UAE_SYSDEPS_H
1.1 root 22:
23: #include <stdio.h>
24: #include <stdlib.h>
25: #include <errno.h>
26: #include <assert.h>
27: #include <limits.h>
28:
29: #ifndef __STDC__
30: #error "Your compiler is not ANSI. Get a real one."
31: #endif
32:
33: #include <stdarg.h>
34:
35: #include <errno.h>
36: #include <assert.h>
37:
1.1.1.7 ! root 38: #include <stdint.h>
1.1.1.3 root 39:
40:
1.1 root 41: #if EEXIST == ENOTEMPTY
42: #define BROKEN_OS_PROBABLY_AIX
43: #endif
44:
45: #ifdef __NeXT__
46: #define S_IRUSR S_IREAD
47: #define S_IWUSR S_IWRITE
48: #define S_IXUSR S_IEXEC
49: #define S_ISDIR(val) (S_IFDIR & val)
50: struct utimbuf
51: {
52: time_t actime;
53: time_t modtime;
54: };
55: #endif
56:
57:
58: #if defined(WARPUP)
59: #include "devices/timer.h"
60: #include "osdep/posixemu.h"
61: #define REGPARAM
62: #define REGPARAM2
63: #define RETSIGTYPE
64: #define USE_ZFILE
65: #define strcasecmp stricmp
66: #define memcpy q_memcpy
67: #define memset q_memset
68: #define strdup my_strdup
69: #define random rand
70: #define creat(x,y) open("T:creat",O_CREAT|O_RDWR|O_TRUNC,777)
71: extern void* q_memset(void*,int,size_t);
72: extern void* q_memcpy(void*,const void*,size_t);
73: #endif
74:
75:
76: /* Acorn specific stuff */
77: #ifdef ACORN
78:
79: #define S_IRUSR S_IREAD
80: #define S_IWUSR S_IWRITE
81: #define S_IXUSR S_IEXEC
82:
83: #define strcasecmp stricmp
84:
85: #endif
86:
87:
1.1.1.3 root 88: /* The variable-types used in the CPU core: */
1.1.1.7 ! root 89: typedef uint8_t uae_u8;
! 90: typedef int8_t uae_s8;
1.1 root 91:
1.1.1.7 ! root 92: typedef uint16_t uae_u16;
! 93: typedef int16_t uae_s16;
1.1.1.3 root 94:
1.1.1.7 ! root 95: typedef uint32_t uae_u32;
! 96: typedef int32_t uae_s32;
1.1 root 97:
98: typedef uae_u32 uaecptr;
99:
100: #undef uae_s64
101: #undef uae_u64
102:
1.1.1.7 ! root 103: #if defined(INT64_MAX)
! 104: # define uae_u64 uint64_t
! 105: # define uae_s64 int64_t
1.1.1.5 root 106: # if defined(__GNUC__) || defined(__MWERKS__) || defined(__SUNPRO_C)
107: # define VAL64(a) (a ## LL)
108: # define UVAL64(a) (a ## ULL)
109: # else
110: # define VAL64(a) (a ## L)
111: # define UVAL64(a) (a ## UL)
112: # endif
1.1 root 113: #endif
114:
115:
116: /* We can only rely on GNU C getting enums right. Mickeysoft VSC++ is known
117: * to have problems, and it's likely that other compilers choke too. */
118: #ifdef __GNUC__
119: #define ENUMDECL typedef enum
120: #define ENUMNAME(name) name
121: #else
122: #define ENUMDECL enum
123: #define ENUMNAME(name) ; typedef int name
124: #endif
125:
1.1.1.5 root 126: /* When using GNU C, make abort more useful. */
127: #ifdef __GNUC__
128: #define abort() \
129: do { \
130: fprintf(stderr, "Internal error; file %s, line %d\n", __FILE__, __LINE__); \
131: (abort) (); \
132: } while (0)
133: #endif
134:
1.1 root 135:
136: #ifndef O_BINARY
137: #define O_BINARY 0
138: #endif
139:
140: #ifndef STATIC_INLINE
141: #define STATIC_INLINE static __inline__
142: #endif
143:
144: /*
145: * You can specify numbers from 0 to 5 here. It is possible that higher
146: * numbers will make the CPU emulation slightly faster, but if the setting
147: * is too high, you will run out of memory while compiling.
148: * Best to leave this as it is.
149: */
150: #define CPU_EMU_SIZE 0
151:
152: #ifndef REGPARAM
153: # define REGPARAM
154: #endif
155: #ifndef REGPARAM2
156: # define REGPARAM2
157: #endif
158:
1.1.1.4 root 159: #endif /* ifndef UAE_SYSDEPS_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.