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:
@ -14,13 +14,10 @@
|
||||
#include "vector2d.h"
|
||||
#include "tier0/dbg.h"
|
||||
|
||||
#undef MINMAX_H
|
||||
#include "minmax.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define FORCEINLINE_MATH FORCEINLINE
|
||||
#else
|
||||
#define FORCEINLINE_MATH extern __inline__ FORCEINLINE
|
||||
#define FORCEINLINE_MATH __inline__ FORCEINLINE
|
||||
#endif
|
||||
|
||||
// plane_t structure
|
||||
@ -194,12 +191,12 @@ FORCEINLINE_MATH void VectorClear(vec_t *a)
|
||||
|
||||
FORCEINLINE_MATH 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_MATH float VectorMaximum(const Vector& v)
|
||||
{
|
||||
return max( v.x, max( v.y, v.z ) );
|
||||
return MAX( v.x, MAX( v.y, v.z ) );
|
||||
}
|
||||
|
||||
FORCEINLINE_MATH void VectorScale (const float* in, vec_t scale, float* out)
|
||||
@ -224,7 +221,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];}
|
||||
|
Reference in New Issue
Block a user