added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / compiler / include / exec / types.h
blobb914846b4d8ec4d9e5e7af3fe193d9c5e1d84cb4
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 /*************************************
182 ***** Some useful definitions *****
183 *************************************/
185 #ifndef FALSE
186 # define FALSE 0L
187 #endif
189 #ifndef TRUE
190 # define TRUE 1L
191 #endif
193 #ifndef NULL
194 # define NULL 0L
195 #endif
197 #ifndef VOID
198 # define VOID void
199 #endif
201 #define GLOBAL extern
202 #define IMPORT extern
203 #define STATIC static
204 #define REGISTER register
206 #ifndef CONST
207 #if __STDC__
208 #define CONST const
209 #else
210 #define CONST
211 #endif
212 #endif
214 #ifndef VOLATILE
215 #if __STDC__
216 #define VOLATILE volatile
217 #else
218 #define VOLATILE
219 #endif
220 #endif
222 #ifndef RESTRICT
223 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
224 #define RESTRICT restrict
225 #else
226 #define RESTRICT
227 #endif
228 #endif
231 Provide a workaround for non-ANSI compilers that do not understand
232 prototypes in function pointer members of structure/union types.
234 From NDK3.9.
236 #if defined(__STDC__)
237 # define __CLIB_PROTOTYPE(a) a
238 #else
239 # define __CLIB_PROTOTYPE(a)
240 #endif
243 Minimum support library version. AROS doesn't have system libraries
244 below V40
246 #define LIBRARY_MINIMUM 40
249 The current version of the includes. Do not use this value in calls
250 to OpenLibrary(). Some system libraries may not be at this version. */
251 #define INCLUDE_VERSION 40
253 /* Import the C++ definitions, if possible. */
254 #if defined(__cplusplus)
255 # include <c++/exec/types.hpp>
256 #endif
258 #endif /* exec/types.h */