added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / compiler / include / aros / systypes.h
blob23a5dff812ee586f44087c38dd5702d503967070
1 #ifndef _AROS_SYSTYPES_H
2 #define _AROS_SYSTYPES_H
3 /*
4 Copyright © 1995-2002, The AROS Development Team. All rights reserved.
5 $Id$
7 AROS Header to define many important types without declaring them.
8 */
10 /* For the fixed-length types */
11 #include <exec/types.h>
14 Many types are expected to be declared in multiple header files. This
15 can cause many problems with multiple redefinition. The solution to this
16 is twofold.
18 1. Provide a system global version of this type that the headers which
19 declare the type can use.
20 2. Make the headers that declare the type declare it safely as
21 follows.
23 #ifdef _AROS_SIZE_T_
24 typedef _AROS_SIZE_T_ size_t;
25 #undef _AROS_SIZE_T_
26 #endif
28 This is the same method that *BSD uses. I do not know where it was
29 first applied.
32 #define _AROS_CLOCKID_T_ int
33 #define _AROS_CLOCK_T_ unsigned long
34 #define _AROS_OFF_T_ LONG /* XXX Large Files? */
35 #define _AROS_PID_T_ IPTR
36 #define _AROS_PTRDIFF_T_ signed long
37 #define _AROS_SIZE_T_ unsigned int
38 #define _AROS_SOCKLEN_T_ ULONG
39 #define _AROS_SSIZE_T_ int
40 #define _AROS_TIMER_T_ int
41 #define _AROS_TIME_T_ ULONG /* XXX Limiting */
42 #define _AROS_VA_LIST_ char *
45 These should be the same as the locale.library usage
46 They are not though. locale.library uses ULONG for it's character type.
47 That is a reasonable assumption, however it makes it difficult for us
48 to have the regular assumption about WEOF.
50 Not to mention that ISO 10646 defines a 31 bit character set, which
51 means that signed representation is quite reasonable.
53 The downside of all this is that we will end up with quite a few
54 signed/unsigned problems.
56 #define _AROS_WCHAR_T_ LONG
57 #define _AROS_WINT_T_ LONG
60 There are also some types which are used in multiple places, but only
61 declared in one place. The user of these types are not supposed to
62 declare the type.
64 In this case you can simply use the define without undefining it.
67 #define _AROS_UID_T_ ULONG
71 Both <stddef.h> and <sys/types.h> define this!
74 #define __offsetof(type,field) ((size_t)(&((type *)0)->field))
76 #endif /* _AROS_SYSTYPES_H */