1 /* Provide support for both ANSI and non-ANSI environments. */
3 /* To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will
4 "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header
5 files aren't affected). */
11 #include <sys/config.h>
16 #if !(defined(_BEGIN_STD_C) && defined(_END_STD_C))
18 #define _BEGIN_STD_C namespace std { extern "C" {
19 #define _END_STD_C } }
21 #define _BEGIN_STD_C extern "C" {
24 #if __GNUC_PREREQ (3, 3)
25 #define _NOTHROW __attribute__ ((__nothrow__))
27 #define _NOTHROW throw()
37 #define _LONG_DOUBLE long double
40 /* Support gcc's __attribute__ facility. */
43 #define _ATTRIBUTE(attrs) __attribute__ (attrs)
45 #define _ATTRIBUTE(attrs)
48 /* The traditional meaning of 'extern inline' for GCC is not
49 to emit the function body unless the address is explicitly
50 taken. However this behaviour is changing to match the C99
51 standard, which uses 'extern inline' to indicate that the
52 function body *must* be emitted. Likewise, a function declared
53 without either 'extern' or 'static' defaults to extern linkage
54 (C99 6.2.2p5), and the compiler may choose whether to use the
55 inline version or call the extern linkage version (6.7.4p6).
56 If we are using GCC, but do not have the new behaviour, we need
57 to use extern inline; if we are using a new GCC with the
58 C99-compatible behaviour, or a non-GCC compiler (which we will
59 have to hope is C99, since there is no other way to achieve the
60 effect of omitting the function if it isn't referenced) we use
61 'static inline', which c99 defines to mean more-or-less the same
62 as the Gnu C 'extern inline'. */
63 #if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
64 /* We're using GCC, but without the new C99-compatible behaviour. */
65 #define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__))
67 /* We're using GCC in C99 mode, or an unknown compiler which
68 we just have to hope obeys the C99 semantics of inline. */
69 #define _ELIDABLE_INLINE static __inline__
72 #if __GNUC_PREREQ (3, 1)
73 #define _NOINLINE __attribute__ ((__noinline__))
74 #define _NOINLINE_STATIC _NOINLINE static
76 /* On non-GNU compilers and GCC prior to version 3.1 the compiler can't be
77 trusted not to inline if it is static. */
79 #define _NOINLINE_STATIC
82 #endif /* _ANSIDECL_H_ */