From f4cdf7ef0f4eb1808e850428debe982b73da31c1 Mon Sep 17 00:00:00 2001 From: Sir Richard Date: Sat, 23 Jan 2010 23:58:29 +0000 Subject: [PATCH] [PSDK]: Define DECLSPEC_NORETURN for MSVC and GCC. svn path=/trunk/; revision=45222 --- reactos/include/ddk/ntdef.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/include/ddk/ntdef.h b/reactos/include/ddk/ntdef.h index 49772bfe001..70c4bdad05e 100644 --- a/reactos/include/ddk/ntdef.h +++ b/reactos/include/ddk/ntdef.h @@ -193,8 +193,16 @@ typedef unsigned long POINTER_64; // FIXME! HACK!!! // Done the same way as in windef.h for now #define DECLSPEC_IMPORT __declspec(dllimport) -#define DECLSPEC_NORETURN __declspec(noreturn) +#ifndef DECLSPEC_NORETURN +#if (_MSC_VER >= 1200) && !defined(MIDL_PASS) +#define DECLSPEC_NORETURN __declspec(noreturn) +#else +/* On 4.5 we can use __builtin_unreachable instead of this hack */ +__attribute__ ((noreturn)) void exit(int s) {exit(s);} +#define DECLSPEC_NORETURN __attribute__((noreturn)) +#endif +#endif #ifndef DECLSPEC_ADDRSAFE #if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64))