cdefs.h (139825) | cdefs.h (143063) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Berkeley Software Design, Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 16 unchanged lines hidden (view full) --- 25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * SUCH DAMAGE. 31 * 32 * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 |
33 * $FreeBSD: head/sys/sys/cdefs.h 139825 2005-01-07 02:29:27Z imp $ | 33 * $FreeBSD: head/sys/sys/cdefs.h 143063 2005-03-02 21:33:29Z joerg $ |
34 */ 35 36#ifndef _SYS_CDEFS_H_ 37#define _SYS_CDEFS_H_ 38 39#if defined(__cplusplus) 40#define __BEGIN_DECLS extern "C" { 41#define __END_DECLS } 42#else 43#define __BEGIN_DECLS 44#define __END_DECLS 45#endif 46 47/* | 34 */ 35 36#ifndef _SYS_CDEFS_H_ 37#define _SYS_CDEFS_H_ 38 39#if defined(__cplusplus) 40#define __BEGIN_DECLS extern "C" { 41#define __END_DECLS } 42#else 43#define __BEGIN_DECLS 44#define __END_DECLS 45#endif 46 47/* |
48 * This code has been put in place to help reduce the addition of 49 * compiler specific defines in FreeBSD code. It helps to aid in 50 * having a compiler-agnostic source tree. 51 */ 52 53#if defined(__GNUC__) || defined(__INTEL_COMPILER) 54 55#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) 56#define __GNUCLIKE_ASM 3 57#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS 58#else 59#define __GNUCLIKE_ASM 2 60#endif 61#define __GNUCLIKE___TYPEOF 1 62#define __GNUCLIKE___OFFSETOF 1 63#define __GNUCLIKE___SECTION 1 64 65#define __GNUCLIKE_ATTRIBUTE_PRINTF 1 66#define __GNUCLIKE_ATTRIBUTE_MODE_DI 1 67 68#ifndef __INTEL_COMPILER 69# define __GNUCLIKE_CTOR_SECTION_HANDLING 1 70#endif 71 72#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 73# if defined(__INTEL_COMPILER) && defined(__cplusplus) \ 74 && __INTEL_COMPILER < 800 75# undef __GNUCLIKE_BUILTIN_CONSTANT_P 76# endif 77 78#if __GNUC_MINOR__ > 95 || __GNUC__ >= 3 || defined(__INTEL_COMPILER) 79# define __GNUCLIKE_BUILTIN_VARARGS 1 80#endif 81#define __GNUCLIKE_BUILTIN_VAALIST 1 82 83#if defined(__GNUC__) 84# define __GNUC_VA_LIST_COMPATIBILITY 1 85#endif 86 87#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER) 88# define __GNUCLIKE_BUILTIN_STDARG 1 89#endif 90 91#ifndef __INTEL_COMPILER 92# define __GNUCLIKE_BUILTIN_NEXT_ARG 1 93# define __GNUCLIKE_MATH_BUILTIN_RELOPS 94#endif 95 96#define __GNUCLIKE_BUILTIN_MEMCPY 1 97 98/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ 99#define __CC_SUPPORTS_INLINE 1 100#define __CC_SUPPORTS___INLINE 1 101#define __CC_SUPPORTS___INLINE__ 1 102 103#define __CC_SUPPORTS___FUNC__ 1 104#define __CC_SUPPORTS_WARNING 1 105 106#define __CC_SUPPORTS_FORWARD_REFERENCE_CONSTRUCT 1 107 108#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ 109 110#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 111 112/* XXX: sys/dev/mpt/mpilib/mpi_type.h uses it, someone should review it */ 113#define __CC_INT_IS_32BIT 1 114 115#endif /* __GNUC__ || __INTEL_COMPILER */ 116 117/* |
|
48 * Macro to test if we're using a specific version of gcc or later. 49 */ 50#if defined(__GNUC__) && !defined(__INTEL_COMPILER) 51#define __GNUC_PREREQ__(ma, mi) \ 52 (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) 53#else 54#define __GNUC_PREREQ__(ma, mi) 0 55#endif --- 18 unchanged lines hidden (view full) --- 74#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ 75 76#define __const const /* define reserved names to standard */ 77#define __signed signed 78#define __volatile volatile 79#if defined(__cplusplus) 80#define __inline inline /* convert to C++ keyword */ 81#else | 118 * Macro to test if we're using a specific version of gcc or later. 119 */ 120#if defined(__GNUC__) && !defined(__INTEL_COMPILER) 121#define __GNUC_PREREQ__(ma, mi) \ 122 (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) 123#else 124#define __GNUC_PREREQ__(ma, mi) 0 125#endif --- 18 unchanged lines hidden (view full) --- 144#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ 145 146#define __const const /* define reserved names to standard */ 147#define __signed signed 148#define __volatile volatile 149#if defined(__cplusplus) 150#define __inline inline /* convert to C++ keyword */ 151#else |
82#if !(defined(__GNUC__) || defined(__INTEL_COMPILER)) | 152#if !(defined(__CC_SUPPORTS___INLINE)) |
83#define __inline /* delete GCC keyword */ | 153#define __inline /* delete GCC keyword */ |
84#endif /* !(__GNUC__ || __INTEL_COMPILER) */ | 154#endif /* ! __CC_SUPPORTS___INLINE */ |
85#endif /* !__cplusplus */ 86 87#else /* !(__STDC__ || __cplusplus) */ 88#define __P(protos) () /* traditional C preprocessor */ 89#define __CONCAT(x,y) x/**/y 90#define __STRING(x) "x" 91 | 155#endif /* !__cplusplus */ 156 157#else /* !(__STDC__ || __cplusplus) */ 158#define __P(protos) () /* traditional C preprocessor */ 159#define __CONCAT(x,y) x/**/y 160#define __STRING(x) "x" 161 |
92#if !(defined(__GNUC__) || defined(__INTEL_COMPILER)) | 162#if !defined(__CC_SUPPORTS___INLINE) |
93#define __const /* delete pseudo-ANSI C keywords */ 94#define __inline 95#define __signed 96#define __volatile 97/* 98 * In non-ANSI C environments, new programs will want ANSI-only C keywords 99 * deleted from the program and old programs will want them left alone. 100 * When using a compiler other than gcc, programs using the ANSI C keywords 101 * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. 102 * When using "gcc -traditional", we assume that this is the intent; if 103 * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. 104 */ 105#ifndef NO_ANSI_KEYWORDS 106#define const /* delete ANSI C keywords */ 107#define inline 108#define signed 109#define volatile 110#endif /* !NO_ANSI_KEYWORDS */ | 163#define __const /* delete pseudo-ANSI C keywords */ 164#define __inline 165#define __signed 166#define __volatile 167/* 168 * In non-ANSI C environments, new programs will want ANSI-only C keywords 169 * deleted from the program and old programs will want them left alone. 170 * When using a compiler other than gcc, programs using the ANSI C keywords 171 * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. 172 * When using "gcc -traditional", we assume that this is the intent; if 173 * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. 174 */ 175#ifndef NO_ANSI_KEYWORDS 176#define const /* delete ANSI C keywords */ 177#define inline 178#define signed 179#define volatile 180#endif /* !NO_ANSI_KEYWORDS */ |
111#endif /* !(__GNUC__ || __INTEL_COMPILER) */ | 181#endif /* !__CC_SUPPORTS___INLINE */ |
112#endif /* !(__STDC__ || __cplusplus) */ 113 114/* 115 * Compiler-dependent macros to help declare dead (non-returning) and 116 * pure (no side effects) functions, and unused variables. They are 117 * null except for versions of gcc that are known to support the features 118 * properly (old versions of gcc-2 supported the dead and pure features 119 * in a different (wrong) way). If we do not provide an implementation --- 183 unchanged lines hidden (view full) --- 303 */ 304#define __IDSTRING(name,string) static const char name[] __unused = string 305#endif 306 307/* 308 * Embed the rcs id of a source file in the resulting library. Note that in 309 * more recent ELF binutils, we use .ident allowing the ID to be stripped. 310 * Usage: | 182#endif /* !(__STDC__ || __cplusplus) */ 183 184/* 185 * Compiler-dependent macros to help declare dead (non-returning) and 186 * pure (no side effects) functions, and unused variables. They are 187 * null except for versions of gcc that are known to support the features 188 * properly (old versions of gcc-2 supported the dead and pure features 189 * in a different (wrong) way). If we do not provide an implementation --- 183 unchanged lines hidden (view full) --- 373 */ 374#define __IDSTRING(name,string) static const char name[] __unused = string 375#endif 376 377/* 378 * Embed the rcs id of a source file in the resulting library. Note that in 379 * more recent ELF binutils, we use .ident allowing the ID to be stripped. 380 * Usage: |
311 * __FBSDID("$FreeBSD: head/sys/sys/cdefs.h 139825 2005-01-07 02:29:27Z imp $"); | 381 * __FBSDID("$FreeBSD: head/sys/sys/cdefs.h 143063 2005-03-02 21:33:29Z joerg $"); |
312 */ 313#ifndef __FBSDID 314#if !defined(lint) && !defined(STRIP_FBSDID) 315#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) 316#else 317#define __FBSDID(s) struct __hack 318#endif 319#endif --- 151 unchanged lines hidden --- | 382 */ 383#ifndef __FBSDID 384#if !defined(lint) && !defined(STRIP_FBSDID) 385#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s) 386#else 387#define __FBSDID(s) struct __hack 388#endif 389#endif --- 151 unchanged lines hidden --- |