123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #ifndef lib_funcattrs_h
- #define lib_funcattrs_h
- #ifndef __has_attribute
-
- #define __has_attribute(x) 0
- #endif
- #if __has_attribute(noreturn) \
- || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \
- || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) \
- || (defined(__xlC__) && __xlC__ >= 0x0A01) \
- || (defined(__HP_aCC) && __HP_aCC >= 61000)
-
- #define NORETURN __attribute((noreturn))
- #elif defined(_MSC_VER)
-
- #define NORETURN __declspec(noreturn)
- #else
- #define NORETURN
- #endif
- #if __has_attribute(__format__) \
- || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203)) \
- || (defined(__xlC__) && __xlC__ >= 0x0A01) \
- || (defined(__HP_aCC) && __HP_aCC >= 61000)
-
- #define PRINTFLIKE(x,y) __attribute__((__format__(__printf__,x,y)))
- #else
- #define PRINTFLIKE(x,y)
- #endif
- #if _MSC_VER >= 1400
- #include <sal.h>
- #if _MSC_VER > 1400
- #define FORMAT_STRING(p) _Printf_format_string_ p
- #else
- #define FORMAT_STRING(p) __format_string p
- #endif
- #else
- #define FORMAT_STRING(p) p
- #endif
- #endif
|