From c3bd4fd1d7a1543791347cefee6a6feba900d752 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 2 Oct 2017 07:10:48 -0600 Subject: [PATCH] stdnoreturn.h: Definitions removed from compiler.h below here --- include/stdnoreturn.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/include/stdnoreturn.h b/include/stdnoreturn.h index be4e0ebe23..36b3aead5f 100644 --- a/include/stdnoreturn.h +++ b/include/stdnoreturn.h @@ -40,10 +40,26 @@ * Included Files ****************************************************************************/ -/* If the noreturn keyword is support by this toolchain, then keywork will be - * defined in compiler.h. - */ +#ifdef __GNUC__ -#include +/* C11 adds _Noreturn keyword that the function will not return. */ + +# if __cplusplus >= 201103L +# define noreturn _Noreturn +# else +# define noreturn +# endif + +#elif defined(SDCC) || defined(__SDCC) + +/* Current SDCC supports noreturn via C11 _Noreturn keyword. */ + +# define noreturn _Noreturn + +#else + +# define noreturn + +#endif #endif /* __INCLUDE_STDNORETURN_H */