]> granicus.if.org Git - llvm/commitdiff
Revert "Remove support for unsupported MSVC versions"
authorJF Bastien <jfbastien@apple.com>
Fri, 2 Aug 2019 22:02:25 +0000 (22:02 +0000)
committerJF Bastien <jfbastien@apple.com>
Fri, 2 Aug 2019 22:02:25 +0000 (22:02 +0000)
Mismatched preprocessor, I'll fix in a follow-up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367728 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Demangle/DemangleConfig.h
lib/DebugInfo/PDB/DIA/DIASession.cpp
lib/Support/Windows/explicit_symbols.inc

index b7b7dbd24c7f442e0b8365da96e8ca83f7688bfa..73f89d357c856082d0f8b56ab840af7c295a5f92 100644 (file)
 #ifndef LLVM_DEMANGLE_COMPILER_H
 #define LLVM_DEMANGLE_COMPILER_H
 
+#ifdef _MSC_VER
+// snprintf is implemented in VS 2015
+#if _MSC_VER < 1900
+#define snprintf _snprintf_s
+#endif
+#endif
+
 #ifndef __has_feature
 #define __has_feature(x) 0
 #endif
index 7d0fa0f91e69503cd09084c3db04cdae878d65cb..4e0b8587c61351933ed31cd8b508e4df2733ea6b 100644 (file)
@@ -73,7 +73,13 @@ static Error LoadDIA(CComPtr<IDiaDataSource> &DiaDataSource) {
 #if !defined(_MSC_VER)
   return llvm::make_error<PDBError>(pdb_error_code::dia_failed_loading);
 #else
-  const wchar_t *msdia_dll = L"msdia140.dll";
+  const wchar_t *msdia_dll = nullptr;
+#if _MSC_VER >= 1900 && _MSC_VER < 2000
+  msdia_dll = L"msdia140.dll"; // VS2015
+#elif _MSC_VER >= 1800
+  msdia_dll = L"msdia120.dll"; // VS2013
+#else
+#error "Unknown Visual Studio version."
 #endif
 
   HRESULT HR;
index 0a4fda1d4e8c8b5c6971f53377d49581997c855e..bbbf7ea6a777720532a17f0d6c861ce75dac4302 100644 (file)
   INLINE_DEF_FLOAT_SYMBOL(tanf, 1)
   INLINE_DEF_FLOAT_SYMBOL(tanhf, 1)
 
+  // These were added in VS 2013.
+#if (1800 <= _MSC_VER && _MSC_VER < 1900)
+  INLINE_DEF_FLOAT_SYMBOL(copysignf, 2)
+  INLINE_DEF_FLOAT_SYMBOL(fminf, 2)
+  INLINE_DEF_FLOAT_SYMBOL(fmaxf, 2)
+#endif
 #undef INLINE_DEF_FLOAT_SYMBOL
 #endif