_Noreturn.h 700 Bytes
Newer Older
Paul Eggert's avatar
Paul Eggert committed
1
#ifndef _Noreturn
Paul Eggert's avatar
Paul Eggert committed
2 3 4
# if (defined __cplusplus \
      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
          || (defined _MSC_VER && 1900 <= _MSC_VER)))
Paul Eggert's avatar
Paul Eggert committed
5
#  define _Noreturn [[noreturn]]
Paul Eggert's avatar
Paul Eggert committed
6 7 8
# elif ((!defined __cplusplus || defined __clang__)                     \
        && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0)  \
            || 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
Paul Eggert's avatar
Paul Eggert committed
9 10
   /* _Noreturn works as-is.  */
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
11
#  define _Noreturn __attribute__ ((__noreturn__))
Paul Eggert's avatar
Paul Eggert committed
12
# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
13 14 15 16 17
#  define _Noreturn __declspec (noreturn)
# else
#  define _Noreturn
# endif
#endif