include/SDL_platform.h
changeset 11329 3ed56acc90ca
parent 11287 4d2a6202caa4
child 11469 71610a71bbb2
     1.1 --- a/include/SDL_platform.h	Sat Aug 19 00:27:11 2017 -0700
     1.2 +++ b/include/SDL_platform.h	Sat Aug 19 02:23:50 2017 -0700
     1.3 @@ -120,21 +120,29 @@
     1.4  
     1.5  #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
     1.6  /* Try to find out if we're compiling for WinRT or non-WinRT */
     1.7 -/* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */
     1.8 -#if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_)	/* _MSC_VER==1700 for MSVC 2012 */
     1.9 +#if defined(_MSC_VER) && _MSC_VER >= 1910                               /* _MSC_VER == 1910 for Visual Studio 2017 */
    1.10 +#define HAVE_WINAPIFAMILY_H __has_include(<winapifamily.h>)
    1.11 +/* If _USING_V110_SDK71_ is defined it means we are using the Windows XP toolset. */
    1.12 +#elif defined(_MSC_VER) && (_MSC_VER >= 1700 && !_USING_V110_SDK71_)    /* _MSC_VER == 1700 for Visual Studio 2012 */
    1.13 +#define HAVE_WINAPIFAMILY_H 1
    1.14 +#else
    1.15 +#define HAVE_WINAPIFAMILY_H 0
    1.16 +#endif
    1.17 +
    1.18 +#if HAVE_WINAPIFAMILY_H
    1.19  #include <winapifamily.h>
    1.20 -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
    1.21 -#undef __WINDOWS__
    1.22 -#define __WINDOWS__   1
    1.23 -/* See if we're compiling for WinRT: */
    1.24 -#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
    1.25 +#define WINAPI_FAMILY_WINRT (!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP))
    1.26 +#else
    1.27 +#define WINAPI_FAMILY_WINRT 0
    1.28 +#endif /* HAVE_WINAPIFAMILY_H */
    1.29 +
    1.30 +#if WINAPI_FAMILY_WINRT
    1.31  #undef __WINRT__
    1.32  #define __WINRT__ 1
    1.33 -#endif
    1.34  #else
    1.35  #undef __WINDOWS__
    1.36 -#define __WINDOWS__   1
    1.37 -#endif /* _MSC_VER < 1700 */
    1.38 +#define __WINDOWS__ 1
    1.39 +#endif
    1.40  #endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
    1.41  
    1.42  #if defined(__WINDOWS__)