Skip to content

Commit b607447

Browse files
committed
Merge pull request godotengine#115010 from akien-mga/windows-mingw-fix-hidsdi-extern-c
Windows: Add missing `extern "C"` for `hidsdi.h` on MinGW < 12.0.0
2 parents 9412972 + 784763b commit b607447

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

platform/windows/os_windows.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
#include <avrt.h>
5656
#include <bcrypt.h>
5757
#include <direct.h>
58-
#include <hidsdi.h>
5958
#include <knownfolders.h>
6059
#include <process.h>
6160
#include <psapi.h>
@@ -65,6 +64,15 @@
6564
#include <wincrypt.h>
6665
#include <winternl.h>
6766

67+
// Workaround missing `extern "C"` in MinGW-w64 < 12.0.0.
68+
#if defined(__MINGW32__) && (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 12)
69+
extern "C" {
70+
#include <hidsdi.h>
71+
}
72+
#else
73+
#include <hidsdi.h>
74+
#endif
75+
6876
#if defined(RD_ENABLED)
6977
#include "servers/rendering/rendering_device.h"
7078
#endif

0 commit comments

Comments
 (0)