util: rework _MSC_VER >= 1200 checks
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 5 Mar 2015 23:40:10 +0000 (23:40 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 6 Mar 2015 16:48:50 +0000 (16:48 +0000)
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>
src/util/macros.h

index b862bfd5f154976ba92b50e496c3f744f79fe619..63daba37c30e8be87ba907e0d1254829625da420 100644 (file)
@@ -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)