From 63863bac89076455dc0a02d2e6e2aeb07c1b2158 Mon Sep 17 00:00:00 2001 From: SoftCoder Date: Fri, 7 Feb 2014 15:42:00 -0800 Subject: [PATCH] - updated unit test to compile on windows - updated vc++ 2012 compile flags and changed asm to use unsigned --- mk/windoze/vc2012/g2xml.vcxproj | 3 ++- mk/windoze/vc2012/g3d_viewer.vcxproj | 3 ++- mk/windoze/vc2012/glest_editor.vcxproj | 3 ++- mk/windoze/vc2012/glest_game.vcxproj | 3 ++- mk/windoze/vc2012/libstreflop.vcxproj | 3 ++- mk/windoze/vc2012/megaglest_tests.vcxproj | 9 +++++---- mk/windoze/vc2012/shared_lib.vcxproj | 3 ++- mk/windoze/vc2012/xml2g.vcxproj | 3 ++- source/shared_lib/include/streflop/FPUSettings.h | 11 ++++++----- source/tests/shared_lib/streflop/streflop_test.cpp | 3 +-- 10 files changed, 26 insertions(+), 18 deletions(-) diff --git a/mk/windoze/vc2012/g2xml.vcxproj b/mk/windoze/vc2012/g2xml.vcxproj index 7f9eda0f2..444b7e247 100644 --- a/mk/windoze/vc2012/g2xml.vcxproj +++ b/mk/windoze/vc2012/g2xml.vcxproj @@ -152,7 +152,8 @@ Level3 ProgramDatabase true - StreamingSIMDExtensions2 + + 4996 diff --git a/mk/windoze/vc2012/g3d_viewer.vcxproj b/mk/windoze/vc2012/g3d_viewer.vcxproj index 63a6482e7..a59ac2167 100644 --- a/mk/windoze/vc2012/g3d_viewer.vcxproj +++ b/mk/windoze/vc2012/g3d_viewer.vcxproj @@ -196,7 +196,8 @@ true Async MultiThreaded - StreamingSIMDExtensions2 + + diff --git a/mk/windoze/vc2012/glest_editor.vcxproj b/mk/windoze/vc2012/glest_editor.vcxproj index fff0a2794..cf14313cb 100644 --- a/mk/windoze/vc2012/glest_editor.vcxproj +++ b/mk/windoze/vc2012/glest_editor.vcxproj @@ -195,7 +195,8 @@ true Async MultiThreaded - StreamingSIMDExtensions2 + + diff --git a/mk/windoze/vc2012/glest_game.vcxproj b/mk/windoze/vc2012/glest_game.vcxproj index f53f8bdca..261527a63 100644 --- a/mk/windoze/vc2012/glest_game.vcxproj +++ b/mk/windoze/vc2012/glest_game.vcxproj @@ -263,7 +263,8 @@ Async MultiThreaded true - StreamingSIMDExtensions2 + + Precise $(OutDir)$(TargetName).pdb Level3 diff --git a/mk/windoze/vc2012/libstreflop.vcxproj b/mk/windoze/vc2012/libstreflop.vcxproj index 323737590..6115a7907 100644 --- a/mk/windoze/vc2012/libstreflop.vcxproj +++ b/mk/windoze/vc2012/libstreflop.vcxproj @@ -198,7 +198,8 @@ Async MultiThreaded true - StreamingSIMDExtensions2 + + Precise true $(OutDir)$(ProjectName).pdb diff --git a/mk/windoze/vc2012/megaglest_tests.vcxproj b/mk/windoze/vc2012/megaglest_tests.vcxproj index bf19d7ab3..d68f35a8b 100644 --- a/mk/windoze/vc2012/megaglest_tests.vcxproj +++ b/mk/windoze/vc2012/megaglest_tests.vcxproj @@ -170,7 +170,8 @@ ../../../source/shared_lib/include/graphics;../../../source/shared_lib/include/graphics/gl;../../../source/shared_lib/include/platform;../../../source/shared_lib/include/platform/win32;../../../source/shared_lib/include/sound;../../../source/shared_lib/include/util;../../../source/shared_lib/include/lua;../../../source/shared_lib/include/xml;../../../source/shared_lib/include/xml/rapidxml;../../../source/glest_game/ai;../../../source/glest_game/facilities;../../../source/glest_game/game;../../../source/glest_game/global;../../../source/glest_game/graphics;../../../source/glest_game/gui;../../../source/glest_game/main;../../../source/glest_game/menu;../../../source/glest_game/network;../../../source/glest_game/sound;../../../source/glest_game/type_instances;../../../source/glest_game/types;../../../source/glest_game/world;../../../source/windows_deps_2012/include;../../../source/windows_deps_2012/xerces-c-3.1.1/src;../../../source/windows_deps_2012/SDL-1.2.15/include;../../../source/shared_lib/include/platform/sdl;../../../source/shared_lib/include/sound/openal;../../../source/windows_deps_2012/openal-soft-1.14/include;../../../source/shared_lib/include/platform/posix;../../../source/shared_lib/include/platform/common;../../../source/windows_deps_2012/curl-7.21.3/include;../../../source/shared_lib/include/map;../../../source/windows_deps_2012/libircclient/include;../../../source/windows_deps_2012/glew-1.7.0/include;../../../source/windows_deps_2012/cppunit/include MultiThreaded Fast - StreamingSIMDExtensions2 + + true 4996 @@ -179,13 +180,13 @@ true true true - $(OutDir)\megaglest_tests.exe + $(OutDir)\$(TargetName)$(TargetExt) ../../../source/windows_deps_2012/lib;../../../build/$(Configuration)/libglest;$(DXSDK_DIR)/lib/x64;../../../source/windows_deps_2012/Microsoft DirectX SDK %28November 2007%29/Lib/x64;../../../source/windows_deps_2012/cppunit/lib;%(AdditionalLibraryDirectories) dsound.lib;dxguid.lib;glew32s.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opengl32.lib;glu32.lib;wsock32.lib;libglest.lib;mmc.lib;lua.lib;xerces-c_static_3.lib;Dbghelp.lib;libpng15.lib;jpeg.lib;zlibstat.lib;sdl.lib;sdlmain.lib;winmm.lib;openal64.lib;iphlpapi.lib;libcurl.lib;ws2_32.lib;libircclient.lib;freetype244MT.lib;ftgl_static.lib;cppunit.lib;%(AdditionalDependencies) ;%(IgnoreSpecificDefaultLibraries) - $(OutDir)\megaglest_tests.exe + $(OutDir)\$(TargetName)$(TargetExt) Run unit tests @@ -203,4 +204,4 @@ - + \ No newline at end of file diff --git a/mk/windoze/vc2012/shared_lib.vcxproj b/mk/windoze/vc2012/shared_lib.vcxproj index 14dc5f871..5947ce978 100644 --- a/mk/windoze/vc2012/shared_lib.vcxproj +++ b/mk/windoze/vc2012/shared_lib.vcxproj @@ -207,7 +207,8 @@ Async MultiThreaded true - StreamingSIMDExtensions2 + + Precise true $(OutDir)$(ProjectName).pdb diff --git a/mk/windoze/vc2012/xml2g.vcxproj b/mk/windoze/vc2012/xml2g.vcxproj index b1bc6133a..fdde12ce7 100644 --- a/mk/windoze/vc2012/xml2g.vcxproj +++ b/mk/windoze/vc2012/xml2g.vcxproj @@ -162,7 +162,8 @@ Level3 ProgramDatabase true - StreamingSIMDExtensions2 + + 4996 diff --git a/source/shared_lib/include/streflop/FPUSettings.h b/source/shared_lib/include/streflop/FPUSettings.h index 514b577a8..345a0374c 100644 --- a/source/shared_lib/include/streflop/FPUSettings.h +++ b/source/shared_lib/include/streflop/FPUSettings.h @@ -136,12 +136,13 @@ enum FPU_RoundMode { #if _WIN64 -/* No fldcw intrinsics on Windows x64, punt to external asm */ -extern "C" { void streflop_winx64_fldcw(short mode); } -extern "C" { short streflop_winx64_fstcw(); } +// No fldcw intrinsics on Windows x64, punt to external asm +// Seems like using unsigned is better on windows x64: http://www.virtualdub.org/blog/pivot/entry.php?id=340 +extern "C" { void streflop_winx64_fldcw(unsigned short mode); } +extern "C" { unsigned short streflop_winx64_fstcw(); } extern "C" { void streflop_winx64_fclex(void); } -extern "C" { void streflop_winx64_stmxcsr(int mode); } -extern "C" { void streflop_winx64_ldmxcsr(int mode); } +extern "C" { void streflop_winx64_stmxcsr(unsigned int mode); } +extern "C" { void streflop_winx64_ldmxcsr(unsigned int mode); } #define STREFLOP_FSTCW(cw) do { short tmp = 0; tmp = streflop_winx64_fstcw(); (cw) = tmp; } while (0) #define STREFLOP_FLDCW(cw) do { short tmp = (cw); streflop_winx64_fldcw(tmp); } while (0) diff --git a/source/tests/shared_lib/streflop/streflop_test.cpp b/source/tests/shared_lib/streflop/streflop_test.cpp index 61a9291b9..36327243d 100644 --- a/source/tests/shared_lib/streflop/streflop_test.cpp +++ b/source/tests/shared_lib/streflop/streflop_test.cpp @@ -35,6 +35,7 @@ using namespace Glest::Game; // const int64 PROGRESS_SPEED_MULTIPLIER = 100000; const float standardAirHeight = 5.0f; +const float FLOAT_TOLERANCE = 1e-10; class StreflopTest : public CppUnit::TestFixture { // Register the suite of tests for this fixture @@ -48,8 +49,6 @@ class StreflopTest : public CppUnit::TestFixture { private: - static const float FLOAT_TOLERANCE = 1e-10; - float cellHeight; Field currField; float tileSetAirHeight;