Remove mathconstants.h and use the correct way to get M_PI in MSVC. (#5072)

This commit is contained in:
red-001 2017-01-20 22:19:41 +00:00 committed by Loïc Blot
parent efa54f9c46
commit 0dada51a55
12 changed files with 2 additions and 17 deletions

@ -284,6 +284,8 @@ if(WIN32)
set(PLATFORM_LIBS dbghelp.lib ${PLATFORM_LIBS}) set(PLATFORM_LIBS dbghelp.lib ${PLATFORM_LIBS})
# Surpress some useless warnings # Surpress some useless warnings
add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 ) add_definitions ( /D "_CRT_SECURE_NO_DEPRECATE" /W1 )
# Get M_PI to work
add_definitions(/D "_USE_MATH_DEFINES")
else() # Probably MinGW = GCC else() # Probably MinGW = GCC
set(PLATFORM_LIBS "") set(PLATFORM_LIBS "")
endif() endif()

@ -31,7 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "event.h" #include "event.h"
#include "profiler.h" #include "profiler.h"
#include "util/numeric.h" #include "util/numeric.h"
#include "util/mathconstants.h"
#include "constants.h" #include "constants.h"
#include "fontengine.h" #include "fontengine.h"

@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "clientiface.h" #include "clientiface.h"
#include "util/numeric.h" #include "util/numeric.h"
#include "util/mathconstants.h"
#include "remoteplayer.h" #include "remoteplayer.h"
#include "settings.h" #include "settings.h"
#include "mapblock.h" #include "mapblock.h"

@ -29,7 +29,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "profiler.h" #include "profiler.h"
#include "settings.h" #include "settings.h"
#include "camera.h" // CameraModes #include "camera.h" // CameraModes
#include "util/mathconstants.h"
#include "util/basic_macros.h" #include "util/basic_macros.h"
#include <algorithm> #include <algorithm>

@ -26,7 +26,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "content_cao.h" #include "content_cao.h"
#include "util/numeric.h" // For IntervalLimiter #include "util/numeric.h" // For IntervalLimiter
#include "util/serialize.h" #include "util/serialize.h"
#include "util/mathconstants.h"
#include "util/basic_macros.h" #include "util/basic_macros.h"
#include "client/tile.h" #include "client/tile.h"
#include "environment.h" #include "environment.h"

@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/ */
#include "content_sao.h" #include "content_sao.h"
#include "util/mathconstants.h"
#include "util/serialize.h" #include "util/serialize.h"
#include "collision.h" #include "collision.h"
#include "environment.h" #include "environment.h"

@ -32,7 +32,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodedef.h" #include "nodedef.h"
#include "gamedef.h" #include "gamedef.h"
#include "util/directiontables.h" #include "util/directiontables.h"
#include "util/mathconstants.h"
#include "util/basic_macros.h" #include "util/basic_macros.h"
#include "rollback_interface.h" #include "rollback_interface.h"
#include "environment.h" #include "environment.h"

@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "nodedef.h" #include "nodedef.h"
#include "map.h" //for MMVManip #include "map.h" //for MMVManip
#include "util/numeric.h" #include "util/numeric.h"
#include "util/mathconstants.h"
#include "porting.h" #include "porting.h"
#include "settings.h" #include "settings.h"

@ -53,7 +53,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "event_manager.h" #include "event_manager.h"
#include "serverlist.h" #include "serverlist.h"
#include "util/string.h" #include "util/string.h"
#include "util/mathconstants.h"
#include "rollback.h" #include "rollback.h"
#include "util/serialize.h" #include "util/serialize.h"
#include "util/thread.h" #include "util/thread.h"

@ -21,7 +21,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <stack> #include <stack>
#include "util/pointer.h" #include "util/pointer.h"
#include "util/numeric.h" #include "util/numeric.h"
#include "util/mathconstants.h"
#include "map.h" #include "map.h"
#include "serverenvironment.h" #include "serverenvironment.h"
#include "nodedef.h" #include "nodedef.h"

@ -1,7 +0,0 @@
#include <math.h>
// MSVC doesn't seem to define this
#ifndef M_PI
#define M_PI 3.1415926535
#endif

@ -18,7 +18,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
*/ */
#include "numeric.h" #include "numeric.h"
#include "mathconstants.h"
#include "log.h" #include "log.h"
#include "../constants.h" // BS, MAP_BLOCKSIZE #include "../constants.h" // BS, MAP_BLOCKSIZE