1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 20:16:10 +08:00

Fixed conflict between min/max macros and std::min/max when using GCC >= 4.2.

This commit is contained in:
Scott Ehlert
2011-04-28 01:30:09 -05:00
parent b9b7f08197
commit 3e7f7bdabd
300 changed files with 1041 additions and 1084 deletions

View File

@ -224,12 +224,12 @@ FORCEINLINE void VectorClear(vec_t *a)
FORCEINLINE float VectorMaximum(const vec_t *v)
{
return max( v[0], max( v[1], v[2] ) );
return MAX( v[0], MAX( v[1], v[2] ) );
}
FORCEINLINE float VectorMaximum(const Vector& v)
{
return max( v.x, max( v.y, v.z ) );
return MAX( v.x, MAX( v.y, v.z ) );
}
FORCEINLINE void VectorScale (const float* in, vec_t scale, float* out)
@ -254,7 +254,7 @@ inline void VectorNegate(vec_t *a)
}
//#define VectorMaximum(a) ( max( (a)[0], max( (a)[1], (a)[2] ) ) )
//#define VectorMaximum(a) ( MAX( (a)[0], MAX( (a)[1], (a)[2] ) ) )
#define Vector2Clear(x) {(x)[0]=(x)[1]=0;}
#define Vector2Negate(x) {(x)[0]=-((x)[0]);(x)[1]=-((x)[1]);}
#define Vector2Copy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];}
@ -1419,7 +1419,7 @@ FORCEINLINE unsigned char LinearToLightmap( float f )
FORCEINLINE void ColorClamp( Vector& color )
{
float maxc = max( color.x, max( color.y, color.z ) );
float maxc = MAX( color.x, MAX( color.y, color.z ) );
if ( maxc > 1.0f )
{
float ooMax = 1.0f / maxc;
@ -1915,10 +1915,10 @@ FORCEINLINE unsigned int * PackNormal_SHORT2( float nx, float ny, float nz, unsi
ny *= 16384.0f;
// '0' and '32768' values are invalid encodings
nx = max( nx, 1.0f ); // Make sure there are no zero values
ny = max( ny, 1.0f );
nx = min( nx, 32767.0f ); // Make sure there are no 32768 values
ny = min( ny, 32767.0f );
nx = MAX( nx, 1.0f ); // Make sure there are no zero values
ny = MAX( ny, 1.0f );
nx = MIN( nx, 32767.0f ); // Make sure there are no 32768 values
ny = MIN( ny, 32767.0f );
if ( nz < 0.0f )
nx = -nx; // Set the sign bit for z