diff --git a/code/game/bg_lib.c b/code/game/bg_lib.c index 3ad3984f..7003b8dd 100644 --- a/code/game/bg_lib.c +++ b/code/game/bg_lib.c @@ -48,10 +48,6 @@ static const char rcsid[] = static char* med3(char *, char *, char *, cmp_t *); static void swapfunc(char *, char *, int, int); -#ifndef min -#define min(a, b) ((a) < (b) ? (a) : (b)) -#endif - /* * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function". */ @@ -167,9 +163,9 @@ loop: SWAPINIT(a, es); } pn = (char *)a + n * es; - r = min(pa - (char *)a, pb - pa); + r = MIN(pa - (char *)a, pb - pa); vecswap(a, pb - r, r); - r = min(pd - pc, pn - pd - es); + r = MIN(pd - pc, pn - pd - es); vecswap(pb, pn - r, r); if ((r = pb - pa) > es) qsort(a, r / es, es, cmp); @@ -1460,8 +1456,6 @@ static int dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c ); #define DP_C_LDOUBLE 4 #define char_to_int(p) (p - '0') -#define MAX(p,q) ((p >= q) ? p : q) -#define MIN(p,q) ((p <= q) ? p : q) static int dopr (char *buffer, size_t maxlen, const char *format, va_list args) { diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h index b0c38973..9f614a50 100644 --- a/code/qcommon/q_shared.h +++ b/code/qcommon/q_shared.h @@ -640,6 +640,14 @@ void PerpendicularVector( vec3_t dst, const vec3_t src ); int Q_isnan( float x ); +#ifndef MAX +#define MAX(x,y) ((x)>(y)?(x):(y)) +#endif + +#ifndef MIN +#define MIN(x,y) ((x)<(y)?(x):(y)) +#endif + //============================================= float Com_Clamp( float min, float max, float value ); diff --git a/code/qcommon/vm_x86_64_assembler.c b/code/qcommon/vm_x86_64_assembler.c index c939dadc..e3d98372 100644 --- a/code/qcommon/vm_x86_64_assembler.c +++ b/code/qcommon/vm_x86_64_assembler.c @@ -43,9 +43,6 @@ static const char* cur_line; static FILE* fout; -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#define MAX(a,b) ((a) > (b) ? (a) : (b)) - #define crap(fmt, args...) do { \ _crap(__FUNCTION__, fmt, ##args); \ } while(0)