WinRT: renamed SDL_winrt_main.cpp to indicate that it should only be used in non-XAML apps
authorDavid Ludwig <dludwig@pobox.com>
Mon, 16 Sep 2013 22:27:30 -0400
changeset 8529 89e08d94b361
parent 8528 38d0b62a215f
child 8530 b5f77f46d028
WinRT: renamed SDL_winrt_main.cpp to indicate that it should only be used in non-XAML apps This can break builds of existing SDL/WinRT apps. To fix, remove the reference to SDL_winrt_main.cpp, then add a reference to the renamed file, SDL_winrt_main_NonXAML.cpp. If you get a build error about a missing .winmd file, enable the /ZW compiler flag for that one file (at minimum).
VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj
VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj
src/main/winrt/SDL_winrt_main.cpp
src/main/winrt/SDL_winrt_main_NonXAML.cpp
--- a/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj	Mon Sep 16 21:09:58 2013 -0400
+++ b/VisualC-WinRT/tests/loopwave/loopwave_VS2012.vcxproj	Mon Sep 16 22:27:30 2013 -0400
@@ -110,6 +110,9 @@
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsWinRT>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
@@ -118,6 +121,9 @@
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsWinRT>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
@@ -133,7 +139,14 @@
     <None Include="loopwave_VS2012_TemporaryKey.pfx" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\..\src\main\winrt\SDL_winrt_main.cpp" />
+    <ClCompile Include="..\..\..\src\main\winrt\SDL_winrt_main_NonXAML.cpp">
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</CompileAsWinRT>
+      <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</CompileAsWinRT>
+    </ClCompile>
     <ClCompile Include="..\..\..\test\loopwave.c">
       <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsWinRT>
       <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsWinRT>
--- a/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj	Mon Sep 16 21:09:58 2013 -0400
+++ b/VisualC-WinRT/tests/testthread/testthread_VS2012.vcxproj	Mon Sep 16 22:27:30 2013 -0400
@@ -139,7 +139,7 @@
     <None Include="testthread_VS2012_TemporaryKey.pfx" />
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\..\..\src\main\winrt\SDL_winrt_main.cpp">
+    <ClCompile Include="..\..\..\src\main\winrt\SDL_winrt_main_NonXAML.cpp">
       <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">true</CompileAsWinRT>
       <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">true</CompileAsWinRT>
       <CompileAsWinRT Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</CompileAsWinRT>
--- a/src/main/winrt/SDL_winrt_main.cpp	Mon Sep 16 21:09:58 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-
-#include <wrl.h>
-
-/* The app's C-style main will be passed into SDL.dll as a function
-   pointer, and called at the appropriate time.
-*/
-extern __declspec(dllimport) int SDL_WinRT_RunApplication(int (*)(int, char **));
-extern "C" int SDL_main(int, char **);
-
-/* Prevent MSVC++ from warning about threading models when defining our
-   custom WinMain.  The threading model will instead be set via a direct
-   call to Windows::Foundation::Initialize (rather than via an attributed
-   function).
-
-   To note, this warning (C4447) does not seem to come up unless this file
-   is compiled with C++/CX enabled (via the /ZW compiler flag).
-*/
-#ifdef _MSC_VER
-#pragma warning(disable:4447)
-#endif
-
-/* Make sure the function to initialize the Windows Runtime gets linked in. */
-#ifdef _MSC_VER
-#pragma comment(lib, "runtimeobject.lib")
-#endif
-
-int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
-{
-    if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) {
-        return 1;
-    }
-
-    SDL_WinRT_RunApplication(SDL_main);
-    return 0;
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/winrt/SDL_winrt_main_NonXAML.cpp	Mon Sep 16 22:27:30 2013 -0400
@@ -0,0 +1,36 @@
+
+#include <wrl.h>
+
+/* The app's C-style main will be passed into SDL.dll as a function
+   pointer, and called at the appropriate time.
+*/
+extern __declspec(dllimport) int SDL_WinRT_RunApplication(int (*)(int, char **));
+extern "C" int SDL_main(int, char **);
+
+/* Prevent MSVC++ from warning about threading models when defining our
+   custom WinMain.  The threading model will instead be set via a direct
+   call to Windows::Foundation::Initialize (rather than via an attributed
+   function).
+
+   To note, this warning (C4447) does not seem to come up unless this file
+   is compiled with C++/CX enabled (via the /ZW compiler flag).
+*/
+#ifdef _MSC_VER
+#pragma warning(disable:4447)
+#endif
+
+/* Make sure the function to initialize the Windows Runtime gets linked in. */
+#ifdef _MSC_VER
+#pragma comment(lib, "runtimeobject.lib")
+#endif
+
+int CALLBACK  WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
+{
+    if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) {
+        return 1;
+    }
+
+    SDL_WinRT_RunApplication(SDL_main);
+    return 0;
+}
+