|
|
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.3 root 38: #include <SDL_types.h>
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: */
89: /* We're mapping them to the SDL types, I hope this will work on all systems... */
90: typedef Uint8 uae_u8;
91: typedef Sint8 uae_s8;
1.1 root 92:
1.1.1.3 root 93: typedef Uint16 uae_u16;
94: typedef Sint16 uae_s16;
95:
96: typedef Uint32 uae_u32;
97: typedef Sint32 uae_s32;
1.1 root 98:
99: typedef uae_u32 uaecptr;
100:
101: #undef uae_s64
102: #undef uae_u64
103:
1.1.1.5 ! root 104: #if defined(SDL_HAS_64BIT_TYPE)
! 105: # define uae_s64 Sint64
! 106: # define uae_u64 Uint64
! 107: # if defined(__GNUC__) || defined(__MWERKS__) || defined(__SUNPRO_C)
! 108: # define VAL64(a) (a ## LL)
! 109: # define UVAL64(a) (a ## ULL)
! 110: # else
! 111: # define VAL64(a) (a ## L)
! 112: # define UVAL64(a) (a ## UL)
! 113: # endif
1.1 root 114: #endif
115:
116:
117: /* We can only rely on GNU C getting enums right. Mickeysoft VSC++ is known
118: * to have problems, and it's likely that other compilers choke too. */
119: #ifdef __GNUC__
120: #define ENUMDECL typedef enum
121: #define ENUMNAME(name) name
122: #else
123: #define ENUMDECL enum
124: #define ENUMNAME(name) ; typedef int name
125: #endif
126:
1.1.1.5 ! root 127: /* When using GNU C, make abort more useful. */
! 128: #ifdef __GNUC__
! 129: #define abort() \
! 130: do { \
! 131: fprintf(stderr, "Internal error; file %s, line %d\n", __FILE__, __LINE__); \
! 132: (abort) (); \
! 133: } while (0)
! 134: #endif
! 135:
1.1 root 136:
137: #if defined USE_COMPILER
138: #undef NO_PREFETCH_BUFFER
139: #undef NO_EXCEPTION_3
140: #define NO_EXCEPTION_3
141: #define NO_PREFETCH_BUFFER
142: #endif
143:
144: #ifndef O_BINARY
145: #define O_BINARY 0
146: #endif
147:
148: #ifndef STATIC_INLINE
149: #define STATIC_INLINE static __inline__
150: #endif
151:
152: /*
153: * You can specify numbers from 0 to 5 here. It is possible that higher
154: * numbers will make the CPU emulation slightly faster, but if the setting
155: * is too high, you will run out of memory while compiling.
156: * Best to leave this as it is.
157: */
158: #define CPU_EMU_SIZE 0
159:
160: #ifndef REGPARAM
161: # define REGPARAM
162: #endif
163: #ifndef REGPARAM2
164: # define REGPARAM2
165: #endif
166:
1.1.1.4 root 167: #endif /* ifndef UAE_SYSDEPS_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.