浏览代码

Fixed SDL build on MinGW.

Lasse Öörni 11 年之前
父节点
当前提交
bc5730680b

+ 5 - 1
Source/ThirdParty/SDL/include/SDL_platform.h

@@ -19,6 +19,8 @@
   3. This notice may not be removed or altered from any source distribution.
 */
 
+// Modified by Lasse Oorni for Urho3D
+
 /**
  *  \file SDL_platform.h
  *
@@ -117,7 +119,9 @@
 #if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__)
 /* Try to find out if we're compiling for WinRT or non-WinRT */
 /* If _USING_V110_SDK71_ is defined it means we are using the v110_xp or v120_xp toolset. */
-#if defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_)	/* _MSC_VER==1700 for MSVC 2012 */
+// Urho3D: not all MinGW versions contain the winapifamily.h include file. Only check for WinRT
+// on Visual Studio
+#if (defined(_MSC_VER) && (_MSC_VER >= 1700) && !_USING_V110_SDK71_)	/* _MSC_VER==1700 for MSVC 2012 */
 #include <winapifamily.h>
 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
 #undef __WINDOWS__

+ 4 - 0
Source/ThirdParty/SDL/src/video/windows/SDL_windowsvideo.c

@@ -253,6 +253,9 @@ SDL_Direct3D9GetAdapterIndex( int displayIndex )
 	}
 }
 
+// Urho3D: dxgi may not be available on MinGW
+#ifdef _MSC_VER
+
 #define CINTERFACE
 #define COBJMACROS
 #include <dxgi.h>
@@ -337,6 +340,7 @@ SDL_DXGIGetOutputInfo( int displayIndex, int *adapterIndex, int *outputIndex )
 		SDL_UnloadObject(pDXGIDLL);
 	}
 }
+#endif
 
 #endif /* SDL_VIDEO_DRIVER_WINDOWS */