diff options
author | Alexandre Ganea <aganea@havenstudios.com> | 2024-07-05 20:44:25 -0400 |
---|---|---|
committer | Alexandre Ganea <aganea@havenstudios.com> | 2024-07-05 20:49:40 -0400 |
commit | 593f708118aef792f434185547f74fedeaf51dd4 (patch) | |
tree | 3faa38d0cf194cf6978830c87be086011f60e378 | |
parent | f118c882fe2f2548b814492aa4e51ef29aa29739 (diff) | |
download | llvm-593f708118aef792f434185547f74fedeaf51dd4.zip llvm-593f708118aef792f434185547f74fedeaf51dd4.tar.gz llvm-593f708118aef792f434185547f74fedeaf51dd4.tar.bz2 |
[Support] Silence function cast warning when building with Clang ToT targetting Windows
-rw-r--r-- | llvm/lib/Support/Windows/Process.inc | 9 | ||||
-rw-r--r-- | llvm/lib/Support/Windows/Signals.inc | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Support/Windows/Process.inc b/llvm/lib/Support/Windows/Process.inc index 34d294b..b9110d4 100644 --- a/llvm/lib/Support/Windows/Process.inc +++ b/llvm/lib/Support/Windows/Process.inc @@ -482,9 +482,18 @@ static RTL_OSVERSIONINFOEXW GetWindowsVer() { HMODULE hMod = ::GetModuleHandleW(L"ntdll.dll"); assert(hMod); +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-function-type-mismatch" +#endif + auto getVer = (RtlGetVersionPtr)::GetProcAddress(hMod, "RtlGetVersion"); assert(getVer); +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + RTL_OSVERSIONINFOEXW info{}; info.dwOSVersionInfoSize = sizeof(info); NTSTATUS r = getVer((PRTL_OSVERSIONINFOW)&info); diff --git a/llvm/lib/Support/Windows/Signals.inc b/llvm/lib/Support/Windows/Signals.inc index 29ebf7c..d057981 100644 --- a/llvm/lib/Support/Windows/Signals.inc +++ b/llvm/lib/Support/Windows/Signals.inc @@ -167,6 +167,11 @@ static bool isDebugHelpInitialized() { return fStackWalk64 && fSymInitialize && fSymSetOptions && fMiniDumpWriteDump; } +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-function-type-mismatch" +#endif + static bool load64BitDebugHelp(void) { HMODULE hLib = ::LoadLibraryExA("Dbghelp.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32); @@ -192,6 +197,10 @@ static bool load64BitDebugHelp(void) { return isDebugHelpInitialized(); } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + using namespace llvm; // Forward declare. |