From 7424d299d8e8eff0d6a34f7a7545ffef121985ce Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Sun, 20 May 2018 07:32:07 +0200 Subject: [PATCH] Define JERRY_UNREACHABLE for MSVC (#2340) JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- jerry-core/jrt/jrt.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jerry-core/jrt/jrt.h b/jerry-core/jrt/jrt.h index 7cef738da..cc65aac22 100644 --- a/jerry-core/jrt/jrt.h +++ b/jerry-core/jrt/jrt.h @@ -94,9 +94,16 @@ jerry_unreachable (const char *file, const char *function, const uint32_t line); #ifdef __GNUC__ #define JERRY_UNREACHABLE() __builtin_unreachable () -#else /* !__GNUC__ */ -#define JERRY_UNREACHABLE() #endif /* __GNUC__ */ + +#ifdef _MSC_VER +#define JERRY_UNREACHABLE() _assume (0) +#endif /* _MSC_VER */ + +#ifndef JERRY_UNREACHABLE +#define JERRY_UNREACHABLE() +#endif /* !JERRY_UNREACHABLE */ + #endif /* !JERRY_NDEBUG */ /**