aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-01-20 22:19:41 +0000
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-01-20 23:19:41 +0100
commit0dada51a550c5eb52faf700dcbde4cee22a6bc70 (patch)
treeffc0993e7dd2cf240caa382a922291729aee1512 /src
parentefa54f9c460239c23a2014076764d6c6830589e6 (diff)
downloadminetest-0dada51a550c5eb52faf700dcbde4cee22a6bc70.tar.gz
minetest-0dada51a550c5eb52faf700dcbde4cee22a6bc70.tar.bz2
minetest-0dada51a550c5eb52faf700dcbde4cee22a6bc70.zip
Remove `mathconstants.h` and use the correct way to get `M_PI` in MSVC. (#5072)
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/camera.cpp1
-rw-r--r--src/clientiface.cpp1
-rw-r--r--src/clientmap.cpp1
-rw-r--r--src/content_cao.cpp1
-rw-r--r--src/content_sao.cpp1
-rw-r--r--src/map.cpp1
-rw-r--r--src/mg_biome.cpp1
-rw-r--r--src/server.cpp1
-rw-r--r--src/treegen.cpp1
-rw-r--r--src/util/mathconstants.h7
-rw-r--r--src/util/numeric.cpp1
12 files changed, 2 insertions, 17 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f90542be9..cab5a1139 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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()
diff --git a/src/camera.cpp b/src/camera.cpp
index 4768e8778..2ad835817 100644
--- a/src/camera.cpp
+++ b/src/camera.cpp
@@ -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"
diff --git a/src/clientiface.cpp b/src/clientiface.cpp
index 1610c21fd..47730343c 100644
--- a/src/clientiface.cpp
+++ b/src/clientiface.cpp
@@ -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"
diff --git a/src/clientmap.cpp b/src/clientmap.cpp
index fa326f0b4..11719539f 100644
--- a/src/clientmap.cpp
+++ b/src/clientmap.cpp
@@ -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>
diff --git a/src/content_cao.cpp b/src/content_cao.cpp
index 83756c963..93ac1f785 100644
--- a/src/content_cao.cpp
+++ b/src/content_cao.cpp
@@ -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"
diff --git a/src/content_sao.cpp b/src/content_sao.cpp
index 840e04ed9..bf8282af4 100644
--- a/src/content_sao.cpp
+++ b/src/content_sao.cpp
@@ -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"
diff --git a/src/map.cpp b/src/map.cpp
index 0659f66aa..f2a4b7ffe 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -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"
diff --git a/src/mg_biome.cpp b/src/mg_biome.cpp
index d564e9415..ef7e52685 100644
--- a/src/mg_biome.cpp
+++ b/src/mg_biome.cpp
@@ -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"
diff --git a/src/server.cpp b/src/server.cpp
index d3d5fd3d1..1656b9f5a 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -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"
diff --git a/src/treegen.cpp b/src/treegen.cpp
index e6c514ab9..4df574f34 100644
--- a/src/treegen.cpp
+++ b/src/treegen.cpp
@@ -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
index 1b478aa95..000000000
--- a/src/util/mathconstants.h
+++ /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
-
diff --git a/src/util/numeric.cpp b/src/util/numeric.cpp
index a9e7ae584..87f1040ea 100644
--- a/src/util/numeric.cpp
+++ b/src/util/numeric.cpp
@@ -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