mathlib.h (max, min): The min and max were declared as inline but

were never defined. Moved them from mathlib.c to here as static
inline functions q_min and q_max. Define min and max as q_min and
q_max.
mathlib.c (max, min): Moved to mathlib.h as q_max and q_min static
inlines.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@175 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2010-05-31 10:56:27 +00:00
parent 1ec6c1b340
commit 12e4aa6caa
2 changed files with 14 additions and 23 deletions

View file

@ -33,27 +33,6 @@ int nanmask = 255<<23;
//#define DEG2RAD( a ) ( a * M_PI ) / 180.0F
#define DEG2RAD( a ) ( (a) * M_PI_DIV_180 ) //johnfitz
// kristian - missing math functions
#ifndef max
int max (int x, int y)
{
if (x > y)
return x;
return y;
}
#endif
#ifndef min
int min (int x, int y)
{
if (x < y)
return x;
return y;
}
#endif
// kristian
void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal )
{
float d;

View file

@ -71,10 +71,22 @@ extern int nanmask;
// kristian - missing math functions
#if !defined(max)
inline int max (int x, int y);
#define max q_max
static inline int q_max (int x, int y)
{
if (x > y)
return x;
return y;
}
#endif
#if !defined(min)
inline int min (int x, int y);
#define min q_min
static inline int q_min (int x, int y)
{
if (x < y)
return x;
return y;
}
#endif
// kristian