diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 4c2b454e3c..66080478f8 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -35,7 +35,15 @@ #if defined(_WIN32) && !defined(_XBOX) && !defined(_MSC_VER) && _WIN32_WINNT >= 0x0500 /* MinGW Win32 HID API */ +#include +#include #include +#ifdef __NO_INLINE__ +/* Workaround MinGW issue where compiling without -O2 (which sets __NO_INLINE__) causes the strsafe functions + * to never be defined (only declared). + */ +#define __CRT_STRSAFE_IMPL +#endif #include #include #include