Cross-compiler noreturn support.

This commit is contained in:
stag019
2014-12-31 04:11:06 -05:00
parent 9b4959cb75
commit f0e5c5ccc8
4 changed files with 26 additions and 9 deletions

16
include/extern/stdnoreturn.h vendored Normal file
View File

@@ -0,0 +1,16 @@
#if _MSC_VER >= 1310
// MS Visual Studio 2003/.NET Framework 1.1 or newer
#define noreturn _declspec( noreturn)
#elif __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ >= 5))
// GCC 2.5 or newer
#define noreturn __attribute__ ((noreturn))
#elif __cplusplus >= 201103L
// C++11 or newer
#define noreturn [[noreturn]]
#elif __STDC_VERSION__ >= 201112L
// C11 or newer
#define noreturn _Noreturn
#else
// unsupported, but no need to throw a fit
#define noreturn
#endif