From 6f3b8bb747f8c95d21c98bb583c043e432f928a8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Oct 2014 16:41:41 -0700 Subject: [PATCH] util: Implement unreachable for MSVC using __assume Based on the description of __assume at: http://msdn.microsoft.com/en-us/library/1b3fsfxw.aspx Signed-off-by: Ian Romanick Reviewed-by: Brian Paul --- src/util/macros.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/macros.h b/src/util/macros.h index ff37a7d63e6..da5daff9bf8 100644 --- a/src/util/macros.h +++ b/src/util/macros.h @@ -69,6 +69,12 @@ do { \ assert(!str); \ __builtin_unreachable(); \ } while (0) +#elif _MSC_VER >= 1200 +#define unreachable(str) \ +do { \ + assert(!str); \ + __assume(0); \ +} while (0) #endif #ifndef unreachable -- 2.30.2