Module: Mesa
Branch: master
Commit: 6f3b8bb747f8c95d21c98bb583c043e432f928a8
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f3b8bb747f8c95d21c98bb583c043e432f928a8

Author: Ian Romanick <[email protected]>
Date:   Wed Oct 22 16:41:41 2014 -0700

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]>

---

 src/util/macros.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/util/macros.h b/src/util/macros.h
index ff37a7d..da5daff 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

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to