Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/cdefs.h
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
/* | /* | ||||
* This code has been put in place to help reduce the addition of | * This code has been put in place to help reduce the addition of | ||||
* compiler specific defines in FreeBSD code. It helps to aid in | * compiler specific defines in FreeBSD code. It helps to aid in | ||||
* having a compiler-agnostic source tree. | * having a compiler-agnostic source tree. | ||||
*/ | */ | ||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER) | #if defined(__GNUC__) | ||||
#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) | #if __GNUC__ >= 3 | ||||
#define __GNUCLIKE_ASM 3 | #define __GNUCLIKE_ASM 3 | ||||
#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS | #define __GNUCLIKE_MATH_BUILTIN_CONSTANTS | ||||
#else | #else | ||||
#define __GNUCLIKE_ASM 2 | #define __GNUCLIKE_ASM 2 | ||||
#endif | #endif | ||||
#define __GNUCLIKE___TYPEOF 1 | #define __GNUCLIKE___TYPEOF 1 | ||||
#define __GNUCLIKE___OFFSETOF 1 | #define __GNUCLIKE___OFFSETOF 1 | ||||
#define __GNUCLIKE___SECTION 1 | #define __GNUCLIKE___SECTION 1 | ||||
#ifndef __INTEL_COMPILER | |||||
#define __GNUCLIKE_CTOR_SECTION_HANDLING 1 | #define __GNUCLIKE_CTOR_SECTION_HANDLING 1 | ||||
#endif | |||||
#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 | #define __GNUCLIKE_BUILTIN_CONSTANT_P 1 | ||||
#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \ | |||||
__INTEL_COMPILER < 800 | |||||
#undef __GNUCLIKE_BUILTIN_CONSTANT_P | |||||
#endif | |||||
#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) | #if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) | ||||
#define __GNUCLIKE_BUILTIN_VARARGS 1 | #define __GNUCLIKE_BUILTIN_VARARGS 1 | ||||
#define __GNUCLIKE_BUILTIN_STDARG 1 | #define __GNUCLIKE_BUILTIN_STDARG 1 | ||||
#define __GNUCLIKE_BUILTIN_VAALIST 1 | #define __GNUCLIKE_BUILTIN_VAALIST 1 | ||||
#endif | #endif | ||||
#if defined(__GNUC__) | #if defined(__GNUC__) | ||||
#define __GNUC_VA_LIST_COMPATIBILITY 1 | #define __GNUC_VA_LIST_COMPATIBILITY 1 | ||||
#endif | #endif | ||||
/* | /* | ||||
* Compiler memory barriers, specific to gcc and clang. | * Compiler memory barriers, specific to gcc and clang. | ||||
*/ | */ | ||||
#if defined(__GNUC__) | #if defined(__GNUC__) | ||||
#define __compiler_membar() __asm __volatile(" " : : : "memory") | #define __compiler_membar() __asm __volatile(" " : : : "memory") | ||||
#endif | #endif | ||||
#ifndef __INTEL_COMPILER | |||||
#define __GNUCLIKE_BUILTIN_NEXT_ARG 1 | #define __GNUCLIKE_BUILTIN_NEXT_ARG 1 | ||||
#define __GNUCLIKE_MATH_BUILTIN_RELOPS | #define __GNUCLIKE_MATH_BUILTIN_RELOPS | ||||
#endif | |||||
#define __GNUCLIKE_BUILTIN_MEMCPY 1 | #define __GNUCLIKE_BUILTIN_MEMCPY 1 | ||||
/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ | /* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ | ||||
#define __CC_SUPPORTS_INLINE 1 | #define __CC_SUPPORTS_INLINE 1 | ||||
#define __CC_SUPPORTS___INLINE 1 | #define __CC_SUPPORTS___INLINE 1 | ||||
#define __CC_SUPPORTS___INLINE__ 1 | #define __CC_SUPPORTS___INLINE__ 1 | ||||
#define __CC_SUPPORTS___FUNC__ 1 | #define __CC_SUPPORTS___FUNC__ 1 | ||||
#define __CC_SUPPORTS_WARNING 1 | #define __CC_SUPPORTS_WARNING 1 | ||||
#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ | #define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ | ||||
#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 | #define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 | ||||
#endif /* __GNUC__ || __INTEL_COMPILER */ | #endif /* __GNUC__ */ | ||||
/* | /* | ||||
* Macro to test if we're using a specific version of gcc or later. | * Macro to test if we're using a specific version of gcc or later. | ||||
*/ | */ | ||||
#if defined(__GNUC__) && !defined(__INTEL_COMPILER) | #if defined(__GNUC__) | ||||
#define __GNUC_PREREQ__(ma, mi) \ | #define __GNUC_PREREQ__(ma, mi) \ | ||||
(__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) | (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) | ||||
#else | #else | ||||
#define __GNUC_PREREQ__(ma, mi) 0 | #define __GNUC_PREREQ__(ma, mi) 0 | ||||
#endif | #endif | ||||
/* | /* | ||||
* The __CONCAT macro is used to concatenate parts of symbol names, e.g. | * The __CONCAT macro is used to concatenate parts of symbol names, e.g. | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
* pure (no side effects) functions, and unused variables. They are | * pure (no side effects) functions, and unused variables. They are | ||||
* null except for versions of gcc that are known to support the features | * null except for versions of gcc that are known to support the features | ||||
* properly (old versions of gcc-2 supported the dead and pure features | * properly (old versions of gcc-2 supported the dead and pure features | ||||
* in a different (wrong) way). If we do not provide an implementation | * in a different (wrong) way). If we do not provide an implementation | ||||
* for a given compiler, let the compile fail if it is told to use | * for a given compiler, let the compile fail if it is told to use | ||||
* a feature that we cannot live without. | * a feature that we cannot live without. | ||||
*/ | */ | ||||
#define __weak_symbol __attribute__((__weak__)) | #define __weak_symbol __attribute__((__weak__)) | ||||
#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) | #if !__GNUC_PREREQ__(2, 5) | ||||
#define __dead2 | #define __dead2 | ||||
#define __pure2 | #define __pure2 | ||||
#define __unused | #define __unused | ||||
#endif | #endif | ||||
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) | #if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 | ||||
#define __dead2 __attribute__((__noreturn__)) | #define __dead2 __attribute__((__noreturn__)) | ||||
#define __pure2 __attribute__((__const__)) | #define __pure2 __attribute__((__const__)) | ||||
#define __unused | #define __unused | ||||
/* XXX Find out what to do for __packed, __aligned and __section */ | /* XXX Find out what to do for __packed, __aligned and __section */ | ||||
#endif | #endif | ||||
#if __GNUC_PREREQ__(2, 7) || defined(__INTEL_COMPILER) | #if __GNUC_PREREQ__(2, 7) | ||||
#define __dead2 __attribute__((__noreturn__)) | #define __dead2 __attribute__((__noreturn__)) | ||||
#define __pure2 __attribute__((__const__)) | #define __pure2 __attribute__((__const__)) | ||||
#define __unused __attribute__((__unused__)) | #define __unused __attribute__((__unused__)) | ||||
#define __used __attribute__((__used__)) | #define __used __attribute__((__used__)) | ||||
#define __packed __attribute__((__packed__)) | #define __packed __attribute__((__packed__)) | ||||
#define __aligned(x) __attribute__((__aligned__(x))) | #define __aligned(x) __attribute__((__aligned__(x))) | ||||
#define __section(x) __attribute__((__section__(x))) | #define __section(x) __attribute__((__section__(x))) | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
#if __GNUC_PREREQ__(2, 96) | #if __GNUC_PREREQ__(2, 96) | ||||
#define __malloc_like __attribute__((__malloc__)) | #define __malloc_like __attribute__((__malloc__)) | ||||
#define __pure __attribute__((__pure__)) | #define __pure __attribute__((__pure__)) | ||||
#else | #else | ||||
#define __malloc_like | #define __malloc_like | ||||
#define __pure | #define __pure | ||||
#endif | #endif | ||||
#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) | #if __GNUC_PREREQ__(3, 1) | ||||
#define __always_inline __attribute__((__always_inline__)) | #define __always_inline __attribute__((__always_inline__)) | ||||
#else | #else | ||||
#define __always_inline | #define __always_inline | ||||
#endif | #endif | ||||
#if __GNUC_PREREQ__(3, 1) | #if __GNUC_PREREQ__(3, 1) | ||||
#define __noinline __attribute__ ((__noinline__)) | #define __noinline __attribute__ ((__noinline__)) | ||||
#else | #else | ||||
Show All 16 Lines | |||||
#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) | #if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable) | ||||
#define __unreachable() __builtin_unreachable() | #define __unreachable() __builtin_unreachable() | ||||
#else | #else | ||||
#define __unreachable() ((void)0) | #define __unreachable() ((void)0) | ||||
#endif | #endif | ||||
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */ | /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ | ||||
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) | #if !__GNUC_PREREQ__(2, 7) | ||||
#define __func__ NULL | #define __func__ NULL | ||||
#endif | #endif | ||||
#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 | #if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 | ||||
#define __LONG_LONG_SUPPORTED | #define __LONG_LONG_SUPPORTED | ||||
#endif | #endif | ||||
/* C++11 exposes a load of C99 stuff */ | /* C++11 exposes a load of C99 stuff */ | ||||
#if defined(__cplusplus) && __cplusplus >= 201103L | #if defined(__cplusplus) && __cplusplus >= 201103L | ||||
#define __LONG_LONG_SUPPORTED | #define __LONG_LONG_SUPPORTED | ||||
#ifndef __STDC_LIMIT_MACROS | #ifndef __STDC_LIMIT_MACROS | ||||
#define __STDC_LIMIT_MACROS | #define __STDC_LIMIT_MACROS | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
/* | /* | ||||
* Compiler-dependent macros to declare that functions take printf-like | * Compiler-dependent macros to declare that functions take printf-like | ||||
* or scanf-like arguments. They are null except for versions of gcc | * or scanf-like arguments. They are null except for versions of gcc | ||||
* that are known to support the features properly (old versions of gcc-2 | * that are known to support the features properly (old versions of gcc-2 | ||||
* didn't permit keeping the keywords out of the application namespace). | * didn't permit keeping the keywords out of the application namespace). | ||||
*/ | */ | ||||
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) | #if !__GNUC_PREREQ__(2, 7) | ||||
#define __printflike(fmtarg, firstvararg) | #define __printflike(fmtarg, firstvararg) | ||||
#define __scanflike(fmtarg, firstvararg) | #define __scanflike(fmtarg, firstvararg) | ||||
#define __format_arg(fmtarg) | #define __format_arg(fmtarg) | ||||
#define __strfmonlike(fmtarg, firstvararg) | #define __strfmonlike(fmtarg, firstvararg) | ||||
#define __strftimelike(fmtarg, firstvararg) | #define __strftimelike(fmtarg, firstvararg) | ||||
#else | #else | ||||
#define __printflike(fmtarg, firstvararg) \ | #define __printflike(fmtarg, firstvararg) \ | ||||
__attribute__((__format__ (__printf__, fmtarg, firstvararg))) | __attribute__((__format__ (__printf__, fmtarg, firstvararg))) | ||||
#define __scanflike(fmtarg, firstvararg) \ | #define __scanflike(fmtarg, firstvararg) \ | ||||
__attribute__((__format__ (__scanf__, fmtarg, firstvararg))) | __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) | ||||
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg))) | #define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg))) | ||||
#define __strfmonlike(fmtarg, firstvararg) \ | #define __strfmonlike(fmtarg, firstvararg) \ | ||||
__attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) | __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) | ||||
#define __strftimelike(fmtarg, firstvararg) \ | #define __strftimelike(fmtarg, firstvararg) \ | ||||
__attribute__((__format__ (__strftime__, fmtarg, firstvararg))) | __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) | ||||
#endif | #endif | ||||
/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ | /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ | ||||
#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ | #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ | ||||
defined(__GNUC__) && !defined(__INTEL_COMPILER) | defined(__GNUC__) | ||||
#define __printf0like(fmtarg, firstvararg) \ | #define __printf0like(fmtarg, firstvararg) \ | ||||
__attribute__((__format__ (__printf0__, fmtarg, firstvararg))) | __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) | ||||
#else | #else | ||||
#define __printf0like(fmtarg, firstvararg) | #define __printf0like(fmtarg, firstvararg) | ||||
#endif | #endif | ||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER) | #if defined(__GNUC__) | ||||
#ifndef __INTEL_COMPILER | |||||
#define __strong_reference(sym,aliassym) \ | #define __strong_reference(sym,aliassym) \ | ||||
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) | extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) | ||||
#endif | |||||
#ifdef __STDC__ | #ifdef __STDC__ | ||||
#define __weak_reference(sym,alias) \ | #define __weak_reference(sym,alias) \ | ||||
__asm__(".weak " #alias); \ | __asm__(".weak " #alias); \ | ||||
__asm__(".equ " #alias ", " #sym) | __asm__(".equ " #alias ", " #sym) | ||||
#define __warn_references(sym,msg) \ | #define __warn_references(sym,msg) \ | ||||
__asm__(".section .gnu.warning." #sym); \ | __asm__(".section .gnu.warning." #sym); \ | ||||
__asm__(".asciz \"" msg "\""); \ | __asm__(".asciz \"" msg "\""); \ | ||||
__asm__(".previous") | __asm__(".previous") | ||||
Show All 9 Lines | #define __warn_references(sym,msg) \ | ||||
__asm__(".section .gnu.warning.sym"); \ | __asm__(".section .gnu.warning.sym"); \ | ||||
__asm__(".asciz \"msg\""); \ | __asm__(".asciz \"msg\""); \ | ||||
__asm__(".previous") | __asm__(".previous") | ||||
#define __sym_compat(sym,impl,verid) \ | #define __sym_compat(sym,impl,verid) \ | ||||
__asm__(".symver impl, sym@verid") | __asm__(".symver impl, sym@verid") | ||||
#define __sym_default(impl,sym,verid) \ | #define __sym_default(impl,sym,verid) \ | ||||
__asm__(".symver impl, sym@@@verid") | __asm__(".symver impl, sym@@@verid") | ||||
#endif /* __STDC__ */ | #endif /* __STDC__ */ | ||||
#endif /* __GNUC__ || __INTEL_COMPILER */ | #endif /* __GNUC__ */ | ||||
#define __GLOBL1(sym) __asm__(".globl " #sym) | #define __GLOBL1(sym) __asm__(".globl " #sym) | ||||
#define __GLOBL(sym) __GLOBL1(sym) | #define __GLOBL(sym) __GLOBL1(sym) | ||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER) | #if defined(__GNUC__) | ||||
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") | #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") | ||||
#else | #else | ||||
/* | /* | ||||
* The following definition might not work well if used in header files, | * The following definition might not work well if used in header files, | ||||
* but it should be better than nothing. If you want a "do nothing" | * but it should be better than nothing. If you want a "do nothing" | ||||
* version, then it should generate some harmless declaration, such as: | * version, then it should generate some harmless declaration, such as: | ||||
* #define __IDSTRING(name,string) struct __hack | * #define __IDSTRING(name,string) struct __hack | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 310 Lines • Show Last 20 Lines |