]> granicus.if.org Git - llvm/commitdiff
Explicitly specify the ANSI version of these Win32 APIs. While these are seemingly...
authorAaron Ballman <aaron@aaronballman.com>
Thu, 23 Jun 2016 14:45:54 +0000 (14:45 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 23 Jun 2016 14:45:54 +0000 (14:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273564 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Windows/Signals.inc
lib/Support/Windows/WindowsSupport.h
utils/KillTheDoctor/KillTheDoctor.cpp

index 834f50ad10ec9770dbfdd58c9d10b2c17ccbbc8d..1e2fa4210df69b4ee70b49a9c600daf61606d3c9 100644 (file)
@@ -588,9 +588,9 @@ void llvm::sys::RunInterruptHandlers() {
 /// \returns a valid HKEY if the location exists, else NULL.
 static HKEY FindWERKey(const llvm::Twine &RegistryLocation) {
   HKEY Key;
-  if (ERROR_SUCCESS != ::RegOpenKeyEx(HKEY_LOCAL_MACHINE,
-                                      RegistryLocation.str().c_str(), 0,
-                                      KEY_QUERY_VALUE | KEY_READ, &Key))
+  if (ERROR_SUCCESS != ::RegOpenKeyExA(HKEY_LOCAL_MACHINE,
+                                       RegistryLocation.str().c_str(), 0,
+                                       KEY_QUERY_VALUE | KEY_READ, &Key))
     return NULL;
 
   return Key;
index fa611a955af942debe0e47685e8c99903b5a575e..18ecdf4e73d9995edc0d0fa6db1cccaa4e493187 100644 (file)
@@ -68,15 +68,15 @@ inline bool RunningWindows8OrGreater() {
                             Mask) != FALSE;
 }
 
-inline bool MakeErrMsg(std::string* ErrMsg, const std::string& prefix) {
+inline bool MakeErrMsg(std::string *ErrMsg, const std::string &prefix) {
   if (!ErrMsg)
     return true;
   char *buffer = NULL;
   DWORD LastError = GetLastError();
-  DWORD R = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
-                          FORMAT_MESSAGE_FROM_SYSTEM |
-                          FORMAT_MESSAGE_MAX_WIDTH_MASK,
-                          NULL, LastError, 0, (LPSTR)&buffer, 1, NULL);
+  DWORD R = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+                               FORMAT_MESSAGE_FROM_SYSTEM |
+                               FORMAT_MESSAGE_MAX_WIDTH_MASK,
+                           NULL, LastError, 0, (LPSTR)&buffer, 1, NULL);
   if (R)
     *ErrMsg = prefix + ": " + buffer;
   else
index 180b42ff5b670403ac398767a51529c664d3755f..c9e96617f37fc39aa09ccb84ac552e1e5f0473c9 100644 (file)
@@ -337,7 +337,7 @@ int main(int argc, char **argv) {
     errs() << ToolName << ": Program Image Path: " << ProgramToRun << '\n'
            << ToolName << ": Command Line: " << CommandLine << '\n';
 
-  STARTUPINFO StartupInfo;
+  STARTUPINFOA StartupInfo;
   PROCESS_INFORMATION ProcessInfo;
   std::memset(&StartupInfo, 0, sizeof(StartupInfo));
   StartupInfo.cb = sizeof(StartupInfo);