summaryrefslogtreecommitdiff
path: root/src/SSystem
diff options
context:
space:
mode:
authorkipcode66 <kipcode66@gmail.com>2026-01-12 17:48:25 -0500
committerGitHub <noreply@github.com>2026-01-13 00:48:25 +0200
commitdd03bf861fdc92109c57d58cc7436066a8a02430 (patch)
treecd4044941bb8f661d3b5c018ed94cb18ff650cc6 /src/SSystem
parent53aaed17c0a635c8f5542c2b2aeaa65f63c734c4 (diff)
standard compiler compatibility changes (#3040)
* move math to cmath * replace stdarg to cstdarg * change stdint to stdint.h * minor fixes * change stdio to cstdio * change stdlib to stdlib * renamed ctype to cctype * fix missing argument for UNSET_FLAG
Diffstat (limited to 'src/SSystem')
-rw-r--r--src/SSystem/SComponent/c_m3d.cpp5
-rw-r--r--src/SSystem/SComponent/c_math.cpp2
-rw-r--r--src/SSystem/SComponent/c_xyz.cpp5
3 files changed, 11 insertions, 1 deletions
diff --git a/src/SSystem/SComponent/c_m3d.cpp b/src/SSystem/SComponent/c_m3d.cpp
index 1af53e81e3..8487468223 100644
--- a/src/SSystem/SComponent/c_m3d.cpp
+++ b/src/SSystem/SComponent/c_m3d.cpp
@@ -12,6 +12,11 @@
#include "SSystem/SComponent/c_math.h"
#include "SSystem/SComponent/c_sxyz.h"
+#ifndef __MWERKS__
+#include <limits>
+#define FLT_EPSILON std::numeric_limits<float>::epsilon()
+#endif
+
const f32 G_CM3D_F_ABS_MIN = 32 * FLT_EPSILON;
void cM3d_InDivPos1(const Vec* pVecA, const Vec* pVecB, f32 pF, Vec* pOut) {
diff --git a/src/SSystem/SComponent/c_math.cpp b/src/SSystem/SComponent/c_math.cpp
index f590bc9bba..ba7a63c61a 100644
--- a/src/SSystem/SComponent/c_math.cpp
+++ b/src/SSystem/SComponent/c_math.cpp
@@ -5,7 +5,7 @@
#include "SSystem/SComponent/c_math.h"
#include "SSystem/SComponent/c_m3d.h"
-#include <math>
+#include <cmath>
s16 cM_rad2s(f32 rad) {
s32 s = (std::fmod(rad, 2 * M_PI) * (0x8000 / M_PI));
diff --git a/src/SSystem/SComponent/c_xyz.cpp b/src/SSystem/SComponent/c_xyz.cpp
index 41ff834864..9f05b9e61c 100644
--- a/src/SSystem/SComponent/c_xyz.cpp
+++ b/src/SSystem/SComponent/c_xyz.cpp
@@ -7,6 +7,11 @@
#include "SSystem/SComponent/c_math.h"
#include "JSystem/JUtility/JUTAssert.h"
+#ifndef __MWERKS__
+#include <limits>
+#define FLT_EPSILON std::numeric_limits<float>::epsilon()
+#endif
+
cXyz cXyz::operator+(const Vec& vec) const {
Vec ret;
PSVECAdd(this, &vec, &ret);