Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/cdefs.h
Show All 34 Lines | |||||
#ifndef _SYS_CDEFS_H_ | #ifndef _SYS_CDEFS_H_ | ||||
#define _SYS_CDEFS_H_ | #define _SYS_CDEFS_H_ | ||||
/* | /* | ||||
* Testing against Clang-specific extensions. | * Testing against Clang-specific extensions. | ||||
*/ | */ | ||||
#ifndef __has_attribute | |||||
#define __has_attribute(x) 0 | |||||
#endif | |||||
#ifndef __has_extension | #ifndef __has_extension | ||||
#define __has_extension __has_feature | #define __has_extension __has_feature | ||||
#endif | #endif | ||||
#ifndef __has_feature | #ifndef __has_feature | ||||
#define __has_feature(x) 0 | #define __has_feature(x) 0 | ||||
#endif | #endif | ||||
#ifndef __has_include | #ifndef __has_include | ||||
#define __has_include(x) 0 | #define __has_include(x) 0 | ||||
▲ Show 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | |||||
* 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. | ||||
*/ | */ | ||||
#ifdef lint | #ifdef lint | ||||
#define __dead2 | #define __dead2 | ||||
#define __pure2 | #define __pure2 | ||||
#define __unused | #define __unused | ||||
#define __packed | #define __packed | ||||
#define __w_unused_result | |||||
#define __aligned(x) | #define __aligned(x) | ||||
#define __alloc_size(...) | |||||
#define __section(x) | #define __section(x) | ||||
#define __weak | #define __weak | ||||
#else | #else | ||||
#define __weak __attribute__((__weak__)) | #define __weak __attribute__((__weak__)) | ||||
#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) | #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) | ||||
#define __dead2 | #define __dead2 | ||||
#define __pure2 | #define __pure2 | ||||
#define __unused | #define __unused | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | |||||
#if __GNUC_PREREQ__(3, 3) | #if __GNUC_PREREQ__(3, 3) | ||||
#define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__))) | #define __nonnull(...) __attribute__((__nonnull__(__VA_ARGS__))) | ||||
#else | #else | ||||
#define __nonnull(...) | #define __nonnull(...) | ||||
#endif | #endif | ||||
#if __GNUC_PREREQ__(3, 4) | #if __GNUC_PREREQ__(3, 4) | ||||
#define __fastcall __attribute__((__fastcall__)) | #define __fastcall __attribute__((__fastcall__)) | ||||
#define __w_unused_result __attribute__((__warn_unused_result__)) | |||||
#else | #else | ||||
#define __fastcall | #define __fastcall | ||||
#define __w_unused_result | |||||
#endif | #endif | ||||
#if __GNUC_PREREQ__(4, 1) | #if __GNUC_PREREQ__(4, 1) | ||||
#define __returns_twice __attribute__((__returns_twice__)) | #define __returns_twice __attribute__((__returns_twice__)) | ||||
#else | #else | ||||
#define __returns_twice | #define __returns_twice | ||||
#endif | |||||
#if __has_attribute(alloc_size) || __GNUC_PREREQ__(4, 3) | |||||
#define __alloc_size(...) __attribute__((alloc_size(__VA_ARGS__))) | |||||
#else | |||||
#define __alloc_size(...) | |||||
#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) && !defined(__INTEL_COMPILER) | ||||
#define __func__ NULL | #define __func__ NULL | ||||
#endif | #endif | ||||
#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 | #if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 | ||||
▲ Show 20 Lines • Show All 426 Lines • Show Last 20 Lines |