1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-01-03 16:13:22 +08:00

Fix compilation errors for std=c++2a (#146)

This commit is contained in:
Alexey T 2023-10-02 16:34:18 +03:00 committed by GitHub
parent 6fd990f46b
commit 5bbd47e578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -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;
@ -629,11 +629,6 @@ template <class T> FORCEINLINE T AVG(T a, T b)
// XYZ macro, for printf type functions - ex printf("%f %f %f",XYZ(myvector));
#define XYZ(v) (v).x,(v).y,(v).z
//
// Returns a clamped value in the range [min, max].
//
#define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
inline float Sign( float x )
{
return fsel( x, 1.0f, -1.0f ); // x >= 0 ? 1.0f : -1.0f

View File

@ -683,7 +683,7 @@ private:
return false;
ThreadMemoryBarrier();
++m_depth;
m_depth = m_depth + 1;
return true;
}
@ -744,7 +744,7 @@ public:
DebuggerBreak();
#endif
--m_depth;
m_depth = m_depth - 1;
if ( !m_depth )
{
ThreadMemoryBarrier();