From dac17215adf095c5feede3f5dcb68ee21afdeb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 15 Jan 2026 23:46:12 +0100 Subject: [PATCH] Windows: Add missing `extern "C"` for `hidsdi.h` on MinGW < 12.0.0 Follow-up to #113013. --- platform/windows/os_windows.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index e5f2d7703e..bfef44a062 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -65,6 +64,15 @@ #include #include +// Workaround missing `extern "C"` in MinGW-w64 < 12.0.0. +#if defined(__MINGW32__) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 12) +extern "C" { +#include +} +#else +#include +#endif + #if defined(RD_ENABLED) #include "servers/rendering/rendering_device.h" #endif