include/SDL_platform.h
changeset 8583 fb2933ca805f
parent 8150 ebe5798f0013
parent 8582 c3e9a2b93517
child 8584 58a69af25ccc
     1.1 --- a/include/SDL_platform.h	Sun Mar 09 10:38:30 2014 -0700
     1.2 +++ b/include/SDL_platform.h	Sun Mar 09 11:36:47 2014 -0700
     1.3 @@ -113,10 +113,27 @@
     1.4  #undef __SOLARIS__
     1.5  #define __SOLARIS__ 1
     1.6  #endif
     1.7 +
     1.8  #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
     1.9 +/* Try to find out if we're compiling for WinRT or non-WinRT */
    1.10 +#if defined(_MSC_VER) && (_MSC_VER >= 1700)	/* _MSC_VER==1700 for MSVC 2012 */
    1.11 +#include <winapifamily.h>
    1.12 +#endif /* _MSC_VER >= 1700 */
    1.13 +/* Default to classic, Win32/Win64/Desktop compilation either if:
    1.14 +     1. the version of Windows is explicity set to a 'Desktop' (non-Metro) app
    1.15 +     2. the version of Windows cannot be determined via winapifamily.h
    1.16 +   If neither is true, then see if we're compiling for WinRT.
    1.17 + */
    1.18 +#if ! defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
    1.19  #undef __WINDOWS__
    1.20  #define __WINDOWS__   1
    1.21 -#endif
    1.22 +/* See if we're compiling for WinRT: */
    1.23 +#elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
    1.24 +#undef __WINRT__
    1.25 +#define __WINRT__ 1
    1.26 +#endif /* ! defined(WINAPI_FAMILY_PARTITION) */
    1.27 +#endif /* defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) */
    1.28 +
    1.29  #if defined(__WINDOWS__)
    1.30  #undef __WIN32__
    1.31  #define __WIN32__ 1