Skip to content

Commit

Permalink
Remove inclusion of tgmath altogether (the pm_shared code was ported …
Browse files Browse the repository at this point in the history
…to C++ previously, so no need for tgmath)
  • Loading branch information
FreeSlave committed Dec 7, 2024
1 parent 97dde8e commit 9dabd80
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
13 changes: 0 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,6 @@ if(LTO)
endif()
endif()

check_include_file("tgmath.h" HAVE_TGMATH_H)
if(HAVE_TGMATH_H)
if(NOT MSVC)
set(CMAKE_REQUIRED_LIBRARIES "m")
endif()
check_c_source_compiles("#include <tgmath.h>
const float val = 2, val2 = 3;
int main(){ return (int)(-asin(val) + cos(val2)); }" HAVE_VALID_TGMATH_H )
if(${HAVE_VALID_TGMATH_H})
add_definitions(-DHAVE_TGMATH_H)
endif()
endif()

if(BUILD_CLIENT)
message(STATUS "Building client enabled")
add_subdirectory(cl_dll)
Expand Down
7 changes: 1 addition & 6 deletions pm_shared/pm_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,15 @@
* without written permission from Valve LLC.
*
****/
#include <math.h>
#include <cmath>
#include "mathlib.h"
#if HAVE_TGMATH_H
#include <tgmath.h>
#endif

#include "usercmd.h"
#include "pm_defs.h"
#include "pm_shared.h"
#include "pm_movevars.h"
#include "pm_debug.h"

#include <string.h>

#if _MSC_VER
#pragma warning(disable : 4244)
#pragma warning(disable : 4305)
Expand Down
3 changes: 0 additions & 3 deletions pm_shared/pm_math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
// pm_math.c -- math primitives
#include <cmath>
#include "mathlib.h"
#if HAVE_TGMATH_H
#include <tgmath.h>
#endif
#include "const.h"

// up / down
Expand Down

0 comments on commit 9dabd80

Please sign in to comment.