Enable -Wundef

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2018-04-02 00:25:26 +01:00
parent 29253046d5
commit 95ccc48d0c
2 changed files with 23 additions and 11 deletions

View File

@@ -9,16 +9,28 @@
#ifndef EXTERN_STDNORETURN_H
#define EXTERN_STDNORETURN_H
#if __STDC_VERSION__ >= 201112L
/* C11 or newer */
#define noreturn _Noreturn
#elif __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ >= 5))
/* GCC 2.5 or newer */
#define noreturn __attribute__ ((noreturn))
#elif _MSC_VER >= 1310
/* MS Visual Studio 2003/.NET Framework 1.1 or newer */
#define noreturn _declspec(noreturn)
#else
#if defined(__STDC_VERSION__)
#if __STDC_VERSION__ >= 201112L
/* C11 or newer */
#define noreturn _Noreturn
#endif
#endif
#if defined(__GNUC__) && !defined(noreturn)
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ >= 5))
/* GCC 2.5 or newer */
#define noreturn __attribute__ ((noreturn))
#endif
#endif
#if defined(_MSC_VER) && !defined(noreturn)
#if _MSC_VER >= 1310
/* MS Visual Studio 2003/.NET Framework 1.1 or newer */
#define noreturn _declspec(noreturn)
#endif
#endif
#if !defined(noreturn)
/* Unsupported, but no need to throw a fit */
#define noreturn
#endif