Skip to content

Commit

Permalink
Fix compilation errors for std=c++2a
Browse files Browse the repository at this point in the history
  • Loading branch information
mixern6 committed Oct 1, 2023
1 parent 4e0975a commit 3b27f8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion public/mathlib/mathlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ void inline SinCos( float radians, float *sine, float *cosine )
fstp DWORD PTR [eax]
}
#elif defined( GNUC )
register double __cosr, __sinr;
double __cosr, __sinr;
__asm __volatile__ ("fsincos" : "=t" (__cosr), "=u" (__sinr) : "0" (radians));

*sine = __sinr;
Expand Down Expand Up @@ -632,7 +632,9 @@ template <class T> FORCEINLINE T AVG(T a, T b)
//
// Returns a clamped value in the range [min, max].
//
#if __cplusplus <= 201402L
#define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
#endif

inline float Sign( float x )
{
Expand Down
4 changes: 2 additions & 2 deletions public/tier0/threadtools.h
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ class CThreadFastMutex
return false;

ThreadMemoryBarrier();
++m_depth;
m_depth = m_depth + 1;
return true;
}

Expand Down Expand Up @@ -744,7 +744,7 @@ class CThreadFastMutex
DebuggerBreak();
#endif

--m_depth;
m_depth = m_depth - 1;
if ( !m_depth )
{
ThreadMemoryBarrier();
Expand Down

0 comments on commit 3b27f8b

Please sign in to comment.