summaryrefslogtreecommitdiff
path: root/include/llvm/Support/Compiler.h
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2013-12-25 01:15:36 +0000
committerAlp Toker <alp@nuanti.com>2013-12-25 01:15:36 +0000
commit76b80d1a989b120f970c19757e320b3b62d69276 (patch)
treec5ec3ab024f64a6e8021fa29b0f06244d67a2900 /include/llvm/Support/Compiler.h
parent8d54670b85e3957aad031edc26843acf0d7de20f (diff)
downloadllvm-76b80d1a989b120f970c19757e320b3b62d69276.tar.gz
llvm-76b80d1a989b120f970c19757e320b3b62d69276.tar.bz2
llvm-76b80d1a989b120f970c19757e320b3b62d69276.tar.xz
Fix the MSVC 2010 build
C++11-style forward declared enums weren't supported until MSVC 2012. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197992 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Compiler.h')
-rw-r--r--include/llvm/Support/Compiler.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index c94c9b359d..3e1b5fe5f9 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -397,12 +397,19 @@
/// with MSVC.
#if __has_feature(cxx_strong_enums)
# define LLVM_ENUM_INT_TYPE(intty) : intty
-#define LLVM_HAS_STRONG_ENUMS 1
#elif defined(_MSC_VER) && _MSC_VER >= 1600 // Added in MSVC 2010.
# define LLVM_ENUM_INT_TYPE(intty) : intty
-#define LLVM_HAS_STRONG_ENUMS 1
#else
# define LLVM_ENUM_INT_TYPE(intty)
+#endif
+
+/// \brief Does the compiler support C++11 semantics for strongly typed forward
+/// declared enums?
+#if __has_feature(cxx_strong_enums)
+#define LLVM_HAS_STRONG_ENUMS 1
+#elif defined(_MSC_VER) && _MSC_VER >= 1700 // Added in MSVC 2012.
+#define LLVM_HAS_STRONG_ENUMS 1
+#else
#define LLVM_HAS_STRONG_ENUMS 0
#endif