Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compilation errors for std=c++2a
Browse files Browse the repository at this point in the history
mixern6 committed Oct 1, 2023
1 parent 4e0975a commit 3b27f8b
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
@@ -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;
@@ -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 )
{
4 changes: 2 additions & 2 deletions public/tier0/threadtools.h
Original file line number Diff line number Diff line change
@@ -683,7 +683,7 @@ class CThreadFastMutex
return false;

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

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

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

0 comments on commit 3b27f8b

Please sign in to comment.