scripts: prepare new configuration for x86_64 on vault13 server using pre build cross...
[AROS.git] / compiler / include / exec / types.h
blob24ee90a6518c96256c5c47a6d7680c3c986e5b48
1 #ifndef EXEC_TYPES_H
2 #define EXEC_TYPES_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Data typing - must be included before any other file.
9 Lang: english
11 This version of exec/types.h does not contain any of the definitions
12 of obsolete types (eg SHORT, CPTR, ...). If your code contains any
13 of these they should have been changed a long time ago.
16 #ifndef AROS_SYSTEM_H
17 # include <aros/system.h>
18 #endif
20 /*************************************
21 ***** Basic Data types *****
22 *************************************/
24 #ifndef __typedef_APTR
25 # define __typedef_APTR
26 typedef void * APTR; /* memory pointer */
27 #endif
29 #ifndef __typedef_CONST_APTR
30 # define __typedef_CONST_APTR
31 typedef const void * CONST_APTR; /* const memory pointer */
32 #endif
34 /* Distinguish between 64 and 32bit systems */
35 #ifndef __typedef_LONG
36 # define __typedef_LONG
37 typedef signed AROS_32BIT_TYPE LONG; /* signed 32-bit value */
38 typedef unsigned AROS_32BIT_TYPE ULONG; /* unsigned 32-bit value */
39 #endif
41 #ifndef __typedef_QUAD
42 # define __typedef_QUAD
43 # ifdef AROS_64BIT_TYPE
44 typedef signed AROS_64BIT_TYPE QUAD; /* signed 64-bit value */
45 typedef unsigned AROS_64BIT_TYPE UQUAD; /* unsigned 64-bit-value */
46 # else
47 typedef struct { LONG high, low; } QUAD; /* signed 64-bit value */
48 typedef struct { ULONG high, low; } UQUAD; /* unsigned 64-bit value */
49 # endif /* AROS_64BIT_TYPE */
50 #endif
52 #ifndef __typedef_WORD
53 # define __typedef_WORD
54 typedef signed AROS_16BIT_TYPE WORD; /* signed 16-bit value */
55 typedef unsigned AROS_16BIT_TYPE UWORD; /* unsigned 16-bit-value */
56 #endif
58 #ifndef __typedef_BYTE
59 # define __typedef_BYTE
60 typedef signed char BYTE; /* signed 8-bit value */
61 typedef unsigned char UBYTE; /* unsigned 8-bit value */
62 #endif
64 /* An unsigned integer which can store a pointer */
65 #ifndef __typedef_IPTR
66 # define __typedef_IPTR
67 typedef unsigned AROS_INTPTR_TYPE IPTR;
68 #endif
70 /* A signed type that can store a pointer */
71 #ifndef __typedef_SIPTR
72 # define __typedef_SIPTR
73 typedef signed AROS_INTPTR_TYPE SIPTR;
74 #endif
76 /* An integer on the stack which can store a pointer */
77 #ifndef __typedef_STACKIPTR
78 # define __typedef_STACKIPTR
79 typedef unsigned AROS_INTPTR_STACKTYPE STACKIPTR;
80 #endif
82 /* Distinguish between 64 and 32bit systems on the stack */
83 #ifndef __typedef_STACKLONG
84 # define __typedef_STACKLONG
85 typedef signed AROS_32BIT_STACKTYPE STACKLONG; /* signed 32-bit value */
86 typedef unsigned AROS_32BIT_STACKTYPE STACKULONG; /* unsigned 32-bit value */
87 #endif
89 #ifndef __typedef_STACKQUAD
90 # define __typedef_STACKQUAD
91 # ifdef AROS_64BIT_STACKTYPE
92 typedef signed AROS_64BIT_STACKTYPE STACKQUAD; /* signed 64-bit value */
93 typedef unsigned AROS_64BIT_STACKTYPE STACKUQUAD; /* unsigned 64-bit-value */
94 # else
95 typedef struct { LONG high, low; } STACKQUAD; /* signed 64-bit value */
96 typedef struct { ULONG high, low; } STACKUQUAD; /* unsigned 64-bit value */
97 # endif /* AROS_64BIT_STACKTYPE */
98 #endif
100 #ifndef __typedef_STACKWORD
101 # define __typedef_STACKWORD
102 typedef signed AROS_16BIT_STACKTYPE STACKWORD; /* signed 16-bit value */
103 typedef unsigned AROS_16BIT_STACKTYPE STACKUWORD; /* unsigned 16-bit-value */
104 #endif
106 #ifndef __typedef_STACKBYTE
107 # define __typedef_STACKBYTE
108 typedef signed AROS_8BIT_STACKTYPE STACKBYTE; /* signed 8-bit value */
109 typedef unsigned AROS_8BIT_STACKTYPE STACKUBYTE; /* unsigned 8-bit value */
110 #endif
112 #ifndef __typedef_STACKFLOAT
113 # define __typedef_STACKFLOAT
114 typedef AROS_FLOAT_STACKTYPE STACKFLOAT; /* signed 32-bit floating point value */
115 #endif
117 #ifndef __typedef_STACKDOUBLE
118 # define __typedef_STACKDOUBLE
119 typedef AROS_DOUBLE_STACKTYPE STACKDOUBLE; /* signed 64-bit floating point value */
120 #endif
122 /*************************************
123 ***** Other interesting types *****
124 *************************************/
125 /* C++ doesn't like strings being treated nor as signed nor as unsigned char's arrays,
126 it wants them to be simply "char" arrays. This is because
127 the char type has undefined sign, unless explicitely specified. */
128 #ifdef __cplusplus
129 # define __AROS_CPP_BYTE char
130 #else
131 # define __AROS_CPP_BYTE UBYTE
132 #endif
134 #ifndef __typedef_STRPTR
135 # define __typedef_STRPTR
136 typedef __AROS_CPP_BYTE * STRPTR; /* Pointer to string (NULL terminated) */
137 #endif
139 #ifndef __typedef_CONST_STRPTR
140 # define __typedef_CONST_STRPTR
141 typedef const __AROS_CPP_BYTE * CONST_STRPTR; /* Pointer to constant string (NULL terminated) */
142 #endif
144 #undef __AROS_CPP_BYTE
146 #ifndef __typedef_TEXT
147 # define __typedef_TEXT
148 typedef unsigned char TEXT;
149 #endif
151 #ifndef __typedef_BOOL
152 # define __typedef_BOOL
153 typedef short BOOL; /* A Boolean value */
154 #endif
156 #ifndef __typedef_FLOAT
157 # define __typedef_FLOAT
158 typedef float FLOAT; /* 32bit IEEE floating point value */
159 #endif
161 #ifndef __typedef_DOUBLE
162 # define __typedef_DOUBLE
163 typedef double DOUBLE; /* 64bit IEEE floating point value */
164 #endif
166 #ifndef __typedef_LONGBITS
167 # define __typedef_LONGBITS
168 typedef ULONG LONGBITS;
169 #endif
171 #ifndef __typedef_WORDBITS
172 # define __typedef_WORDBITS
173 typedef UWORD WORDBITS;
174 #endif
176 #ifndef __typedef_BYTEBITS
177 # define __typedef_BYTEBITS
178 typedef UBYTE BYTEBITS;
179 #endif
181 #ifndef __typedef_RAWARG
182 # define __typedef_RAWARG /* Type of 'datastream' of RawDoFmt */
183 typedef struct RAWARG_s { } *RAWARG;
184 #endif
186 /*************************************
187 ***** Some useful definitions *****
188 *************************************/
190 #ifndef FALSE
191 # define FALSE 0L
192 #endif
194 #ifndef TRUE
195 # define TRUE 1L
196 #endif
198 #ifndef NULL
199 # define NULL 0L
200 #endif
202 #ifndef VOID
203 # define VOID void
204 #endif
206 #define GLOBAL extern
207 #define IMPORT extern
208 #define STATIC static
209 #define REGISTER register
211 #ifndef CONST
212 #if __STDC__
213 #define CONST const
214 #else
215 #define CONST
216 #endif
217 #endif
219 #ifndef VOLATILE
220 #if __STDC__
221 #define VOLATILE volatile
222 #else
223 #define VOLATILE
224 #endif
225 #endif
227 #ifndef RESTRICT
228 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
229 #define RESTRICT restrict
230 #else
231 #define RESTRICT
232 #endif
233 #endif
236 Provide a workaround for non-ANSI compilers that do not understand
237 prototypes in function pointer members of structure/union types.
239 From NDK3.9.
241 #if defined(__STDC__)
242 # define __CLIB_PROTOTYPE(a) a
243 #else
244 # define __CLIB_PROTOTYPE(a)
245 #endif
248 Minimum support library version. AROS doesn't have system libraries
249 below V40
251 #define LIBRARY_MINIMUM 40
254 The current version of the includes. Do not use this value in calls
255 to OpenLibrary(). Some system libraries may not be at this version. */
256 #define INCLUDE_VERSION 40
258 #endif /* exec/types.h */