From 5ae5006ddeb63988c64716c528e6d91a2961b891 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 3 Jun 2020 17:47:08 +0200 Subject: [PATCH] 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. --- include/common/compat.h | 8 ++++++++ include/common/tools.h | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/common/compat.h b/include/common/compat.h index 05701c1def..34fbac5dbb 100644 --- a/include/common/compat.h +++ b/include/common/compat.h @@ -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 diff --git a/include/common/tools.h b/include/common/tools.h index c7c0c88692..8db38c6b45 100644 --- a/include/common/tools.h +++ b/include/common/tools.h @@ -22,16 +22,6 @@ #ifndef _COMMON_TOOLS_H #define _COMMON_TOOLS_H -#include - -#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 with only the highest bit set. may be -- 2.47.3