Author: jcatena
Date: Tue Jan 26 21:25:31 2010
New Revision: 45274
URL:
http://svn.reactos.org/svn/reactos?rev=45274&view=rev
Log:
added UNREACHABLE defs
Modified:
branches/jcatena-branch/include/reactos/gnuc/i386/platf.h
branches/jcatena-branch/include/reactos/i386/reactos_cfg.h
branches/jcatena-branch/include/reactos/msc/i386/msc.h
branches/jcatena-branch/include/reactos/msc/i386/platf.h
Modified: branches/jcatena-branch/include/reactos/gnuc/i386/platf.h
URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/include/reactos/…
==============================================================================
--- branches/jcatena-branch/include/reactos/gnuc/i386/platf.h [iso-8859-1] (original)
+++ branches/jcatena-branch/include/reactos/gnuc/i386/platf.h [iso-8859-1] Tue Jan 26
21:25:31 2010
@@ -23,6 +23,7 @@
#define _LOADDS _ERR_UNSUPPORTED
#define _DLLEXPORT __declspec(dllexport)
#define _DLLIMPORT __declspec(dllimport)
+#define _NORETURN __declspec(noreturn)
#define _ALIGN(x) __declspec(aligned(x))
#define _PACK(x) __pragma(pack(push, x))
@@ -41,6 +42,7 @@
#define _NOWARN_POP
#define _NOWARN_MSC(x)
#define _NOWARN_GNUC(x)
+#define _ASSUME(x)
#define _SECTION(x) __declspec((section(sectn)))
#define _SECTION_FN(sectn, fn) __declspec((section(sectn)))
@@ -185,15 +187,22 @@
#define SIZTMAX 0xFFFFFFFF
typedef i32u sizt, *psizt, _NEAR *npsizt, _FAR *npsizt, _FARH *hpsizt;
-/*************************************************************************
-
-*************************************************************************/
// debug
#if _DEBUG
#define dbgref TX("(") TX(__FILE__) TX(":") TX(sfy(__LINE__))
TX(":") TX(__FUNCTION__) TX(")")
#else
#define dbgref 0
#endif
+
+//
+#ifdef __GNUC__
+#if __GNUC__ * 100 + __GNUC_MINOR__ >= 405
+#define _UNREACHABLE __builtin_unreachable()
+#else
+#define _UNREACHABLE __builtin_trap()
+#endif
+#define UNREACHABLE _UNREACHABLE
+#define _noreturn() _UNREACHABLE
#define _ReturnAddress() (__builtin_return_address(0))
#define ReturnAddress _ReturnAddress
Modified: branches/jcatena-branch/include/reactos/i386/reactos_cfg.h
URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/include/reactos/…
==============================================================================
--- branches/jcatena-branch/include/reactos/i386/reactos_cfg.h [iso-8859-1] (original)
+++ branches/jcatena-branch/include/reactos/i386/reactos_cfg.h [iso-8859-1] Tue Jan 26
21:25:31 2010
@@ -8,12 +8,11 @@
// #define CONFIG_SMP
#define __REACTOS__
+#define _X86_
-#if defined(_M_IX86)
#define KERNEL_STACK_SIZE 0x6000
#define KERNEL_LARGE_STACK_SIZE 0xf000
#define KERNEL_LARGE_STACK_COMMIT 0x6000
-#endif
#include <osver.h>
#include <platf.h>
Modified: branches/jcatena-branch/include/reactos/msc/i386/msc.h
URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/include/reactos/…
==============================================================================
--- branches/jcatena-branch/include/reactos/msc/i386/msc.h [iso-8859-1] (original)
+++ branches/jcatena-branch/include/reactos/msc/i386/msc.h [iso-8859-1] Tue Jan 26
21:25:31 2010
@@ -14,6 +14,8 @@
#define __inline__ _INLINE
#define FORCEINLINE _INLINEF
+#define DECLSPEC_NORETURN _NORETURN
+#define FASTCALL _FASTCALL
#define __attribute__(packed)
#endif
Modified: branches/jcatena-branch/include/reactos/msc/i386/platf.h
URL:
http://svn.reactos.org/svn/reactos/branches/jcatena-branch/include/reactos/…
==============================================================================
--- branches/jcatena-branch/include/reactos/msc/i386/platf.h [iso-8859-1] (original)
+++ branches/jcatena-branch/include/reactos/msc/i386/platf.h [iso-8859-1] Tue Jan 26
21:25:31 2010
@@ -22,6 +22,7 @@
#define _LOADDS _ERR_UNSUPPORTED
#define _DLLEXPORT __declspec(dllexport)
#define _DLLIMPORT __declspec(dllimport)
+#define _NORETURN __declspec(noreturn)
#define _ALIGN(x) __declspec(align(x))
#define _PACKN(x) __pragma(pack(push, x))
@@ -38,6 +39,7 @@
#define _NOWARN_POP __pragma(warning(pop))
#define _NOWARN_MSC(x) __pragma(warning(disable: x))
#define _NOWARN_GNUC(x)
+#define _ASSUME(x) __assume(x)
#define _SECTION(x) __declspec(allocate(x))
#define _SECTION_FN(sectn, fn) __pragma(alloc_text(sectn, fn))
@@ -182,15 +184,17 @@
#define SIZTMAX 0xFFFFFFFF
typedef i32u sizt, *psizt, _NEAR *npsizt, _FAR *lpsizt, _FARH *hpsizt;
-/*************************************************************************
-
-*************************************************************************/
// debug
#if _DEBUG
#define dbgref TX("(") TX(__FILE__) TX(":") TX(sfy(__LINE__))
TX(":") TX(__FUNCTION__) TX(")")
#else
#define dbgref 0
#endif
+
+//
+_NORETURN _INLINEF void _noreturn(void) {_ASSUME(0);};
+#define _UNREACHABLE _ASSUME(0); _noreturn()
+#define UNREACHABLE _UNREACHABLE
pvoid _ReturnAddress(void);
#pragma intrinsic(_ReturnAddress)
@@ -199,5 +203,5 @@
#define ReturnAddressn _ReturnAddressn
#define __builtin_expect(x, v) (x)
-#include <msc.h> // additional compatibility defs that would not be needed if code
uses macros defined here instead of compiler specific directives
-
+#include <msc.h> // should not be needed if code uses above macros instead of
compiler dependent directives
+