summaryrefslogtreecommitdiff
blob: 31f5fc2b7f9915fda40248be3410a7766812a5a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Fix build fails with using gcc-4.9 on Gentoo/FreeBSD
https://bugs.gentoo.org/show_bug.cgi?id=548444

diff --git a/llvm-3.6.0.src/tools/clang/lib/Driver/MSVCToolChain.cpp b/llvm-3.6.0.src/tools/clang/lib/Driver/MSVCToolChain.cpp
index d6bd5c3..372f76f 100644
--- a/llvm-3.6.0.src/tools/clang/lib/Driver/MSVCToolChain.cpp
+++ b/llvm-3.6.0.src/tools/clang/lib/Driver/MSVCToolChain.cpp
@@ -22,6 +22,8 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Process.h"
 
+#include <cstdio>
+
 // Include the necessary headers to interface with the Windows registry and
 // environment.
 #if defined(LLVM_ON_WIN32)
@@ -212,7 +214,7 @@ bool MSVCToolChain::getWindowsSDKDir(std::string &path, int &major,
       "SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\$VERSION",
       "InstallationFolder", path, &sdkVersion);
   if (!sdkVersion.empty())
-    ::sscanf(sdkVersion.c_str(), "v%d.%d", &major, &minor);
+    std::sscanf(sdkVersion.c_str(), "v%d.%d", &major, &minor);
   return hasSDKDir && !path.empty();
 }