diff --git a/include/SDL_config_windows.h b/include/SDL_config_windows.h index 5853e5dcc..dac4b7d89 100644 --- a/include/SDL_config_windows.h +++ b/include/SDL_config_windows.h @@ -25,9 +25,16 @@ #include "SDL_platform.h" -/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK. - * Define NO_WINSDKVER_H if your SDK version doesn't provide this, or use CMake which can detect it automatically. */ -#ifndef NO_WINSDKVER_H +/* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK, + * but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence. + * If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H. */ +#if !defined(HAVE_WINSDKVER_H) && defined(__has_include) +#if __has_include() +#define HAVE_WINSDKVER_H 1 +#endif +#endif + +#ifdef HAVE_WINSDKVER_H #include #endif