config: fix build with external compiler by passing the sysroot where needed
[AROS.git] / arch / .unmaintained / morphos / Include / aros / system.h
blob94ee29a59d02160d76ef2b0954b0e42385894410
1 #pragma pack(2)
2 #ifndef AROS_SYSTEM_H
3 #define AROS_SYSTEM_H
5 /*
6 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
7 $Id$
9 Desc: Analyse the current kind of system and compiler.
10 Lang: english
13 #ifndef __AROS__
14 # define __AROS__
15 #endif
16 #ifndef AROS_MACHINE_H
17 # include <aros/machine.h>
18 #endif
20 /**************************************
21 Defines
22 **************************************/
23 /* 1. Analyze system: Specify a definitive define for each system */
24 #if defined(_AMIGA) || defined(AMIGA)
25 # ifndef _AMIGA /* One define for each system */
26 # define _AMIGA
27 # endif
28 #endif
31 * 2. Analyze compiler for STD C/C++.
33 * We test for the following:
34 * a. extern "C" linkage required for programs.
35 * b. inline, const, volatile, restrict keywords defined in
36 * newer C/C++ standards.
39 #if defined(__cplusplus)
40 # define EXTERN extern "C"
41 # define BEGIN_EXTERN extern "C" {
42 # define END_EXTERN };
43 #else
44 # define EXTERN extern
45 # define BEGIN_EXTERN
46 # define END_EXTERN
47 #endif
49 #if defined(__STDC__) || defined(__cplusplus)
50 #define __const__ const
51 #define __inline__ inline
52 #define __volatile__ volatile
55 * C99 defines a new keyword restrict that can help do optimisation where
56 * pointers are used in programs. We'd like to support optimisation :-)
58 #if defined(__STDC__VERSION__) && __STDC__VERSION__ >= 199901L
59 #define __restrict__ restrict
60 #else
61 #define __restrict__
62 #define restrict
63 #endif
65 #else
66 #define __const__
67 #define const
68 #define __inline__
69 #define inline
70 #define __volatile__
71 #define volatile
72 #define __restrict__
73 #define restrict
74 #endif
76 /* 3. Macros for making things more efficient */
77 #if __GNUC__ < 2 || __GNUC__ == 2 && __GNUC_MINOR__ < 5
78 #define __unused
79 #define __noreturn
80 #define __noeffect
81 #endif
82 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
83 #define __unused
84 #define __noreturn __attribute__((__noreturn__))
85 #define __noeffect __attribute__((__const__))
86 #endif
87 #if __GNUC__ == 2 && __GNUC_MINOR__ >= 7
88 #define __unused __attribute__((__unused__))
89 #define __noreturn __attribute__((__noreturn__))
90 #define __noeffect __attribute__((__const__))
91 #endif
93 /* 4. Makros for debugging and development */
94 #if !defined(TEST) && !defined(DEBUG)
95 # define NDEBUG
96 #endif
97 #pragma pack()
98 #include <assert.h>
99 #pragma pack(2)
101 /* 5. Sytem-specific files */
102 #ifdef _AMIGA
103 # include <aros/amiga.h>
104 #endif
105 #ifdef linux
106 # include <aros/linux.h>
107 #endif
108 #ifdef _OSF1
109 # include <aros/alpha.h>
110 #endif
111 #ifdef __FreeBSD__
112 # include <aros/freebsd.h>
113 #endif
114 #ifdef __NetBSD__
115 # include <aros/netbsd.h>
116 #endif
117 #ifdef __CYGWIN32__
118 # include <aros/cygwin.h>
119 #endif
121 /* 4. Calculated #defines */
122 #if !AROS_STACK_GROWS_DOWNWARDS
123 # define AROS_SLOWSTACKTAGS
124 # define AROS_SLOWSTACKMETHODS
125 #endif /* !AROS_STACK_GROWS_DOWNWARDS */
127 #endif /* AROS_SYSTEM_H */
128 #pragma pack()