123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- #ifndef _XFUNCPROTO_H_
- #define _XFUNCPROTO_H_
- #ifndef NeedFunctionPrototypes
- #define NeedFunctionPrototypes 1
- #endif
- #ifndef NeedVarargsPrototypes
- #define NeedVarargsPrototypes 1
- #endif
- #if NeedFunctionPrototypes
- #ifndef NeedNestedPrototypes
- #define NeedNestedPrototypes 1
- #endif
- #ifndef _Xconst
- #define _Xconst const
- #endif
- #ifndef NARROWPROTO
- #define NARROWPROTO
- #endif
- #ifndef FUNCPROTO
- #define FUNCPROTO 15
- #endif
- #ifndef NeedWidePrototypes
- #ifdef NARROWPROTO
- #define NeedWidePrototypes 0
- #else
- #define NeedWidePrototypes 1
- #endif
- #endif
- #endif
- #ifndef _XFUNCPROTOBEGIN
- #if defined(__cplusplus) || defined(c_plusplus)
- #define _XFUNCPROTOBEGIN extern "C" {
- #define _XFUNCPROTOEND }
- #else
- #define _XFUNCPROTOBEGIN
- #define _XFUNCPROTOEND
- #endif
- #endif
- #ifndef __has_attribute
- # define __has_attribute(x) 0
- #endif
- #if __has_attribute(__sentinel__) || (defined(__GNUC__) && (__GNUC__ >= 4))
- # define _X_SENTINEL(x) __attribute__ ((__sentinel__(x)))
- #else
- # define _X_SENTINEL(x)
- #endif
- #if (__has_attribute(visibility) || (defined(__GNUC__) && (__GNUC__ >= 4))) \
- && !defined(__CYGWIN__) && !defined(__MINGW32__)
- # define _X_EXPORT __attribute__((visibility("default")))
- # define _X_HIDDEN __attribute__((visibility("hidden")))
- # define _X_INTERNAL __attribute__((visibility("internal")))
- #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
- # define _X_EXPORT __global
- # define _X_HIDDEN __hidden
- # define _X_INTERNAL __hidden
- #else
- # define _X_EXPORT
- # define _X_HIDDEN
- # define _X_INTERNAL
- #endif
- #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
- # define _X_LIKELY(x) __builtin_expect(!!(x), 1)
- # define _X_UNLIKELY(x) __builtin_expect(!!(x), 0)
- #else
- # define _X_LIKELY(x) (x)
- # define _X_UNLIKELY(x) (x)
- #endif
- #if __has_attribute(__cold__) || \
- (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403))
- # define _X_COLD __attribute__((__cold__))
- #else
- # define _X_COLD
- #endif
- #if __has_attribute(deprecated) \
- || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \
- || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130))
- # define _X_DEPRECATED __attribute__((deprecated))
- #else
- # define _X_DEPRECATED
- #endif
- #if __has_attribute(noreturn) \
- || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
- || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
- # define _X_NORETURN __attribute((noreturn))
- #else
- # define _X_NORETURN
- #endif
- #if __has_attribute(__format__) \
- || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)
- # define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y)))
- #else
- # define _X_ATTRIBUTE_PRINTF(x,y)
- #endif
- #if __has_attribute(nonnull) \
- && defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)
- #define _X_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
- #elif __has_attribute(nonnull) \
- || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303)
- #define _X_NONNULL(args...) __attribute__((nonnull(args)))
- #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)
- #define _X_NONNULL(...)
- #endif
- #if __has_attribute(__unused__) \
- || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)
- #define _X_UNUSED __attribute__((__unused__))
- #else
- #define _X_UNUSED
- #endif
- #if defined(inline) || \
- (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) || \
- (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550))
- # define _X_INLINE inline
- #elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
- # define _X_INLINE __inline__
- #else
- # define _X_INLINE
- #endif
- #ifndef _X_RESTRICT_KYWD
- # if defined(restrict) || \
- (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) \
- && !defined(__cplusplus))
- # define _X_RESTRICT_KYWD restrict
- # elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
- # define _X_RESTRICT_KYWD __restrict__
- # else
- # define _X_RESTRICT_KYWD
- # endif
- #endif
- #endif
|