From: Ian Romanick Date: Wed, 22 Oct 2014 23:41:41 +0000 (-0700) Subject: util: Implement unreachable for MSVC using __assume X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f3b8bb747f8c95d21c98bb583c043e432f928a8;p=mesa.git 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 --- 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