Skip to content

Commit 3b27f8b

Browse files
committed
Fix compilation errors for std=c++2a
1 parent 4e0975a commit 3b27f8b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

public/mathlib/mathlib.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ void inline SinCos( float radians, float *sine, float *cosine )
329329
fstp DWORD PTR [eax]
330330
}
331331
#elif defined( GNUC )
332-
register double __cosr, __sinr;
332+
double __cosr, __sinr;
333333
__asm __volatile__ ("fsincos" : "=t" (__cosr), "=u" (__sinr) : "0" (radians));
334334

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

637639
inline float Sign( float x )
638640
{

public/tier0/threadtools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ class CThreadFastMutex
683683
return false;
684684

685685
ThreadMemoryBarrier();
686-
++m_depth;
686+
m_depth = m_depth + 1;
687687
return true;
688688
}
689689

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

747-
--m_depth;
747+
m_depth = m_depth - 1;
748748
if ( !m_depth )
749749
{
750750
ThreadMemoryBarrier();

0 commit comments

Comments
 (0)