[ros-diffs] [sir_richard] 45222: [PSDK]: Define DECLSPEC_NORETURN for MSVC and GCC.

sir_richard at svn.reactos.org sir_richard at svn.reactos.org
Sun Jan 24 00:58:29 CET 2010


Author: sir_richard
Date: Sun Jan 24 00:58:29 2010
New Revision: 45222

URL: http://svn.reactos.org/svn/reactos?rev=45222&view=rev
Log:
[PSDK]: Define DECLSPEC_NORETURN for MSVC and GCC.

Modified:
    trunk/reactos/include/ddk/ntdef.h

Modified: trunk/reactos/include/ddk/ntdef.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ntdef.h?rev=45222&r1=45221&r2=45222&view=diff
==============================================================================
--- trunk/reactos/include/ddk/ntdef.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/ntdef.h [iso-8859-1] Sun Jan 24 00:58:29 2010
@@ -193,8 +193,16 @@
 
 // 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))




More information about the Ros-diffs mailing list