summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2015-03-05 23:40:10 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2015-03-06 16:48:50 +0000
commit3f167516399c8e20478bb0081a24ab7ac155b093 (patch)
tree1237b04f0026ae10d4d96297ea842fa59d7c6484
parent38591295cd4b68f89f257b20f476f98de3772a47 (diff)
util: rework _MSC_VER >= 1200 checks
Replace the _MSC_VER >= 1200 with defined (_MSC_VER) and compact if/else statements. We require MSVC 2008 or later with commit 46110c5d564. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
-rw-r--r--src/util/macros.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/macros.h b/src/util/macros.h
index b862bfd5f15..63daba37c30 100644
--- a/src/util/macros.h
+++ b/src/util/macros.h
@@ -73,15 +73,13 @@ do { \
assert(!str); \
__builtin_unreachable(); \
} while (0)
-#elif _MSC_VER >= 1200
+#elif defined (_MSC_VER)
#define unreachable(str) \
do { \
assert(!str); \
__assume(0); \
} while (0)
-#endif
-
-#ifndef unreachable
+#else
#define unreachable(str) assert(!str)
#endif
@@ -99,7 +97,7 @@ do { \
#define assume(expr) ((expr) ? ((void) 0) \
: (assert(!"assumption failed"), \
__builtin_unreachable()))
-#elif _MSC_VER >= 1200
+#elif defined (_MSC_VER)
#define assume(expr) __assume(expr)
#else
#define assume(expr) assert(expr)