From 664e0da8dff1d04860cc46ce8139cbd47e15c552 Mon Sep 17 00:00:00 2001 From: Yong He Date: Sat, 4 Nov 2017 15:37:40 -0400 Subject: fix all unreachable code warnings --- source/core/common.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/core') diff --git a/source/core/common.h b/source/core/common.h index dbb837821..3a4543085 100644 --- a/source/core/common.h +++ b/source/core/common.h @@ -41,6 +41,14 @@ namespace Slang #define SLANG_RETURN_NEVER __declspec(noreturn) #else #define SLANG_RETURN_NEVER /* empty */ +#endif + +#ifdef _MSC_VER +#define UNREACHABLE_RETURN(x) +#define UNREACHABLE(x) +#else +#define UNREACHABLE_RETURN(x) return x; +#define UNREACHABLE(x) x; #endif SLANG_RETURN_NEVER void signalUnexpectedError(char const* message); -- cgit v1.2.3