[llvm] r273564 - Explicitly specify the ANSI version of these Win32 APIs. While these are seemingly unrelated changes, they are all NFC because we currently default to the ANSI versions of the APIs when building for Windows. This simply makes the ANSI usage explicit.
Aaron Ballman via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 23 07:45:55 PDT 2016
Author: aaronballman
Date: Thu Jun 23 09:45:54 2016
New Revision: 273564
URL: http://llvm.org/viewvc/llvm-project?rev=273564&view=rev
Log:
Explicitly specify the ANSI version of these Win32 APIs. While these are seemingly unrelated changes, they are all NFC because we currently default to the ANSI versions of the APIs when building for Windows. This simply makes the ANSI usage explicit.
Modified:
llvm/trunk/lib/Support/Windows/Signals.inc
llvm/trunk/lib/Support/Windows/WindowsSupport.h
llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp
Modified: llvm/trunk/lib/Support/Windows/Signals.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Signals.inc?rev=273564&r1=273563&r2=273564&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/Signals.inc (original)
+++ llvm/trunk/lib/Support/Windows/Signals.inc Thu Jun 23 09:45:54 2016
@@ -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;
Modified: llvm/trunk/lib/Support/Windows/WindowsSupport.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/WindowsSupport.h?rev=273564&r1=273563&r2=273564&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/WindowsSupport.h (original)
+++ llvm/trunk/lib/Support/Windows/WindowsSupport.h Thu Jun 23 09:45:54 2016
@@ -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
Modified: llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp?rev=273564&r1=273563&r2=273564&view=diff
==============================================================================
--- llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp (original)
+++ llvm/trunk/utils/KillTheDoctor/KillTheDoctor.cpp Thu Jun 23 09:45:54 2016
@@ -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);
More information about the llvm-commits
mailing list