Define M_PI on MSVC
authorPerttu Ahola <celeron55@gmail.com>
Sat, 23 Jun 2012 13:06:03 +0000 (16:06 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 21 Jul 2012 00:36:34 +0000 (03:36 +0300)
src/camera.cpp
src/clientmap.cpp
src/content_cao.cpp
src/server.cpp
src/util/mathconstants.h [new file with mode: 0644]

index 32dd85e52322aa292271838e457f1ae78e579dfc..f87f660e9c91bae0ef81eb74e058ee4a88933f70 100644 (file)
@@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "sound.h"
 #include "event.h"
 #include "util/numeric.h"
+#include "util/mathconstants.h"
 
 Camera::Camera(scene::ISceneManager* smgr, MapDrawControl& draw_control,
                IGameDef *gamedef):
index 6cf3db8d73a7fc851f8cbf6f04a42acb0a99ed6e..4d14cc1a24bfdb36acbcc7b82a87f00faf2e485b 100644 (file)
@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "mapblock.h"
 #include "profiler.h"
 #include "settings.h"
+#include "util/mathconstants.h"
 
 #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
 
index 5702a73b617060fc9db0055d7e12e9a08e2268df..58ff130f2b9c8b448c7de22f751e9ad11f8e48b4 100644 (file)
@@ -38,6 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "localplayer.h"
 #include "util/numeric.h" // For IntervalLimiter
 #include "util/serialize.h"
+#include "util/mathconstants.h"
 
 class Settings;
 struct ToolCapabilities;
index b125bff8d7330c7f4cb04924bc5b25da1790d3ae..80df9fc7ada4958d445f09511672f119d3dae1db 100644 (file)
@@ -53,6 +53,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "hex.h"
 #include "util/string.h"
 #include "util/pointedthing.h"
+#include "util/mathconstants.h"
 
 #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
 
diff --git a/src/util/mathconstants.h b/src/util/mathconstants.h
new file mode 100644 (file)
index 0000000..1b478aa
--- /dev/null
@@ -0,0 +1,7 @@
+#include <math.h>
+
+// MSVC doesn't seem to define this
+#ifndef M_PI
+       #define M_PI 3.1415926535
+#endif
+