view lib/_Noreturn.h @ 39961:4a9dba57ac9e

gnulib-common.m4: port _Noreturn to C++ Problem reported by Akim Demaille in: https://lists.gnu.org/r/bug-bison/2018-10/msg00067.html * m4/gnulib-common.m4 (gl_COMMON_BODY): If C++, use [[noreturn]]. Merge adjustments from _Noreturn.h and from glibc into the non-C++ version. * lib/_Noreturn.h: Match gnulib-common.
author Paul Eggert <eggert@cs.ucla.edu>
date Fri, 02 Nov 2018 14:09:35 -0700
parents a77371738a7e
children c34f677e6117
line wrap: on
line source

#ifndef _Noreturn
# if 201103 <= (defined __cplusplus ? __cplusplus : 0)
#  define _Noreturn [[noreturn]]
# elif (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
        || 4 < __GNUC__ + (7 <= __GNUC_MINOR__))
   /* _Noreturn works as-is.  */
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
#  define _Noreturn __attribute__ ((__noreturn__))
# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
#  define _Noreturn __declspec (noreturn)
# else
#  define _Noreturn
# endif
#endif