Disable warnings around incompatible function pointer cast (#9543)

This addresses a compilation issue with newer (8+) mingw.

Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
This commit is contained in:
Michał Janiszewski 2020-04-24 16:03:03 +02:00 committed by GitHub
parent 76c10d1806
commit 295a98028e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -222,7 +222,14 @@ namespace Platform
if (hModule != nullptr)
{
using RtlGetVersionPtr = NTSTATUS(WINAPI*)(PRTL_OSVERSIONINFOW);
# if defined(__GNUC__) && __GNUC__ >= 8
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-function-type"
# endif
auto fn = (RtlGetVersionPtr)GetProcAddress(hModule, "RtlGetVersion");
# if defined(__GNUC__) && __GNUC__ >= 8
# pragma GCC diagnostic pop
# endif
if (fn != nullptr)
{
RTL_OSVERSIONINFOW rovi{};