Skip to content

Commit b71bc59

Browse files
committed
fix(build): Exclude GameMath from VC6 and fix ACos typo in BaseType.h
- Guard gamemath.cmake and link with NOT IS_VS6_BUILD (VC6 lacks long long, stdint.h) - Guard gmath.h include in wwmath.h with _MSC_VER >= 1300 check - Fix ACos -> Acos case mismatch in BaseType.h (3 call sites)
1 parent 585ecc3 commit b71bc59

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ endif()
6464

6565
include(cmake/config.cmake)
6666
include(cmake/gamespy.cmake)
67-
include(cmake/gamemath.cmake)
67+
if (NOT IS_VS6_BUILD)
68+
include(cmake/gamemath.cmake)
69+
endif()
6870
include(cmake/lzhl.cmake)
6971

7072
if (IS_VS6_BUILD)

Core/Libraries/Include/Lib/BaseType.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ inline Real Coord2D::toAngle() const
270270
else if (c > 1.0)
271271
c = 1.0;
272272

273-
Real value = (Real)WWMath::ACos( (Real)c );
273+
Real value = (Real)WWMath::Acos( (Real)c );
274274

275275
// Determine sign by checking Z component of dir cross vector
276276
// Note this is assumes 2D, and is identical to dotting the perpendicular of v with dir
@@ -295,7 +295,7 @@ inline Real Coord2D::toAngle() const
295295
else if (c > 1.0f)
296296
c = 1.0f;
297297

298-
return y < 0.0f ? -WWMath::ACos(c) : WWMath::ACos(c);
298+
return y < 0.0f ? -WWMath::Acos(c) : WWMath::Acos(c);
299299
#endif
300300
}
301301

Core/Libraries/Source/WWVegas/WWMath/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,11 @@ target_link_libraries(core_wwmath PRIVATE
8989
core_wwcommon
9090
corei_always
9191
core_wwsaveload
92-
gamemath
9392
)
9493

94+
if (NOT IS_VS6_BUILD)
95+
target_link_libraries(core_wwmath PRIVATE gamemath)
96+
endif()
97+
9598
# @todo Test its impact and see what to do with the legacy functions.
9699
#add_compile_definitions(core_wwmath PUBLIC ALLOW_TEMPORARIES) # Enables legacy math with "temporaries"

Core/Libraries/Source/WWVegas/WWMath/wwmath.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@
3939
#include "always.h"
4040
#include <math.h>
4141
#include <float.h>
42-
#include "gmath.h"
4342
#include <assert.h>
4443

44+
// TheSuperHackers @fix VC6 does not support long long or <stdint.h> required by GameMath (gmath.h).
45+
#if !(defined(_MSC_VER) && _MSC_VER < 1300)
46+
#include "gmath.h"
4547
#ifdef RETAIL_COMPATIBLE_CRC
4648
#define USE_DETERMINISTIC_MATH
49+
#endif
4750
#endif
4851

4952
/*

0 commit comments

Comments
 (0)