summaryrefslogtreecommitdiffstats
path: root/src/util/macros.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2014-10-22 16:41:41 -0700
committerIan Romanick <[email protected]>2014-11-05 09:36:04 -0800
commit6f3b8bb747f8c95d21c98bb583c043e432f928a8 (patch)
tree79d6782dc1088d5f127d6e1f41c3de9148bef274 /src/util/macros.h
parent1ca88aa58217239da84a426c29f05b5b53855951 (diff)
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 <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/util/macros.h')
-rw-r--r--src/util/macros.h6
1 files changed, 6 insertions, 0 deletions
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