Make LLVM_MSC_PREREQ() compatible with all MSVC versions
authorAlp Toker <alp@nuanti.com>
Sun, 29 Dec 2013 07:39:53 +0000 (07:39 +0000)
committerAlp Toker <alp@nuanti.com>
Sun, 29 Dec 2013 07:39:53 +0000 (07:39 +0000)
The defined() preprocessor expansion wasn't working out on the lld builder.

Also update the documentation to cover another Visual Studio release versioning
convention.

llvm-svn: 198158

llvm/include/llvm/Support/Compiler.h

index e2bcd56..aa66a4e 100644 (file)
 /// \macro LLVM_MSC_PREREQ
 /// \brief Is the compiler MSVC of at least the specified version?
 /// The common \param version values to check for are:
-///  * 1600: Microsoft Visual Studio 2010
-///  * 1700: Microsoft Visual Studio 2012
-///  * 1800: Microsoft Visual Studio 2013
-#define LLVM_MSC_PREREQ(version) \
-  (defined(_MSC_VER) && _MSC_VER >= (version))
+///  * 1600: Microsoft Visual Studio 2010 / 10.0
+///  * 1700: Microsoft Visual Studio 2012 / 11.0
+///  * 1800: Microsoft Visual Studio 2013 / 12.0
+#ifdef _MSC_VER
+#define LLVM_MSC_PREREQ(version) (_MSC_VER >= (version))
+#else
+#define LLVM_MSC_PREREQ(version) 0
+#endif
 
 /// \brief Does the compiler support r-value references?
 /// This implies that <utility> provides the one-argument std::move;  it