REORG: include: move MIN/MAX from tools.h to compat.h

Given that these macros are usually provided by sys/param.h, better move
them to compat.h.
This commit is contained in:
Willy Tarreau 2020-06-03 17:47:08 +02:00
parent 57bb71e83a
commit 5ae5006dde
2 changed files with 8 additions and 10 deletions

View File

@ -58,6 +58,14 @@ typedef struct { } empty_t;
#define BITS_PER_INT (8*sizeof(int))
#endif
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
/* this is for libc5 for example */
#ifndef TCP_NODELAY
#define TCP_NODELAY 1

View File

@ -22,16 +22,6 @@
#ifndef _COMMON_TOOLS_H
#define _COMMON_TOOLS_H
#include <sys/param.h>
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#define SWAP(a, b) do { typeof(a) t; t = a; a = b; b = t; } while(0)
/* return an integer of type <ret> with only the highest bit set. <ret> may be