Remove `mathconstants.h` and use the correct way to get `M_PI` in MSVC. (#5072)
authorred-001 <red-001@outlook.ie>
Fri, 20 Jan 2017 22:19:41 +0000 (22:19 +0000)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Fri, 20 Jan 2017 22:19:41 +0000 (23:19 +0100)
12 files changed:
src/CMakeLists.txt
src/camera.cpp
src/clientiface.cpp
src/clientmap.cpp
src/content_cao.cpp
src/content_sao.cpp
src/map.cpp
src/mg_biome.cpp
src/server.cpp
src/treegen.cpp
src/util/mathconstants.h [deleted file]
src/util/numeric.cpp

index f90542be9e79a80f5eab5b2357f14d679ead7186..cab5a11398b45baee34adcc701e31fc0b2bc01f0 100644 (file)
@@ -284,6 +284,8 @@ if(WIN32)
                set(PLATFORM_LIBS dbghelp.lib ${PLATFORM_LIBS})
                # Surpress some useless warnings
                add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 )
+               # Get M_PI to work
+               add_definitions(/D "_USE_MATH_DEFINES")
        else() # Probably MinGW = GCC
                set(PLATFORM_LIBS "")
        endif()
index 4768e8778207bfd92c8de10b570395212312528b..2ad835817e7ecb423c8e5f76970b1067e9250d2d 100644 (file)
@@ -31,7 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "event.h"
 #include "profiler.h"
 #include "util/numeric.h"
-#include "util/mathconstants.h"
 #include "constants.h"
 #include "fontengine.h"
 
index 1610c21fd9d58f9a5cca6b21192e25e6178d2fbd..47730343c60ed4fb6d36bd925d69b4f45ade67a8 100644 (file)
@@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #include "clientiface.h"
 #include "util/numeric.h"
-#include "util/mathconstants.h"
 #include "remoteplayer.h"
 #include "settings.h"
 #include "mapblock.h"
index fa326f0b44548517bc9ff79ceeb7fb63d5f42b44..11719539fee7b2981fb569ec23caf7bb9b79e749 100644 (file)
@@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "profiler.h"
 #include "settings.h"
 #include "camera.h"               // CameraModes
-#include "util/mathconstants.h"
 #include "util/basic_macros.h"
 #include <algorithm>
 
index 83756c96390303364daa01f7ee0beb7d93e5a344..93ac1f785fc0f33f5483c88f5e953268b2e17f69 100644 (file)
@@ -26,7 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "content_cao.h"
 #include "util/numeric.h" // For IntervalLimiter
 #include "util/serialize.h"
-#include "util/mathconstants.h"
 #include "util/basic_macros.h"
 #include "client/tile.h"
 #include "environment.h"
index 840e04ed99f520824c7c790a15b6e439462c8cb9..bf8282af46aa1ec86dcb02fa15a1357af15486d7 100644 (file)
@@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "content_sao.h"
-#include "util/mathconstants.h"
 #include "util/serialize.h"
 #include "collision.h"
 #include "environment.h"
index 0659f66aa536ec7cba0835d14a699062940691d8..f2a4b7ffec02157e5188e0b3346c57dd76ab85ef 100644 (file)
@@ -32,7 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "nodedef.h"
 #include "gamedef.h"
 #include "util/directiontables.h"
-#include "util/mathconstants.h"
 #include "util/basic_macros.h"
 #include "rollback_interface.h"
 #include "environment.h"
index d564e9415b754ae6c0eccca672d35af5b6d06d47..ef7e526858a358bd856e8f8717726656c8d38299 100644 (file)
@@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "nodedef.h"
 #include "map.h" //for MMVManip
 #include "util/numeric.h"
-#include "util/mathconstants.h"
 #include "porting.h"
 #include "settings.h"
 
index d3d5fd3d18986f7031bcef3d0985e82805ebb5ed..1656b9f5a557c9b2769be576095e1a8d6a2777b8 100644 (file)
@@ -53,7 +53,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "event_manager.h"
 #include "serverlist.h"
 #include "util/string.h"
-#include "util/mathconstants.h"
 #include "rollback.h"
 #include "util/serialize.h"
 #include "util/thread.h"
index e6c514ab9274498a1a240bd150ff1864fb1597bb..4df574f349307915a9033e15c805bb29752135b9 100644 (file)
@@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include <stack>
 #include "util/pointer.h"
 #include "util/numeric.h"
-#include "util/mathconstants.h"
 #include "map.h"
 #include "serverenvironment.h"
 #include "nodedef.h"
diff --git a/src/util/mathconstants.h b/src/util/mathconstants.h
deleted file mode 100644 (file)
index 1b478aa..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <math.h>
-
-// MSVC doesn't seem to define this
-#ifndef M_PI
-       #define M_PI 3.1415926535
-#endif
-
index a9e7ae5840be0849dc09569fb976aecc07237a1d..87f1040ea2207778fd4ba200a0263de3903c90c0 100644 (file)
@@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 */
 
 #include "numeric.h"
-#include "mathconstants.h"
 
 #include "log.h"
 #include "../constants.h" // BS, MAP_BLOCKSIZE