]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: include: move MIN/MAX from tools.h to compat.h
authorWilly Tarreau <w@1wt.eu>
Wed, 3 Jun 2020 15:47:08 +0000 (17:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:56 +0000 (10:18 +0200)
Given that these macros are usually provided by sys/param.h, better move
them to compat.h.

include/common/compat.h
include/common/tools.h

index 05701c1def59931de8906a9889febea537bb8d68..34fbac5dbb30ebbb33d92ac3675e8ce4e8edbb1d 100644 (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
index c7c0c8869253117f98e2fbf96b081582cf0a0e0e..8db38c6b45eefc72179f8b7ff24e8b4118d3b019 100644 (file)
 #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