From cf83df3d162687d9c74783357421bd89f596eaac Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 9 Apr 2007 15:57:51 +0200 Subject: [PATCH] [BUILD] fix build on FreeBSD for INT_MIN/INT_MAX FreeBSD stores INT_MIN and INT_MAX in sys/limits.h only. Other systems (Solaris) have it in sys/types.h and do not have sys/limits.h. Let's include sys/limits.h only if INT_MAX is not defined. --- include/common/standard.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/common/standard.h b/include/common/standard.h index 5b9d4a8c6..3dea1fdae 100644 --- a/include/common/standard.h +++ b/include/common/standard.h @@ -22,10 +22,16 @@ #ifndef _COMMON_STANDARD_H #define _COMMON_STANDARD_H +#include #include #include #include +#ifndef INT_MAX +/* Needed on FreeBSD */ +#include +#endif + /****** string-specific macros and functions ******/ /* if a > max, then bound to . The macro returns the new */ #define UBOUND(a, max) ({ typeof(a) b = (max); if ((a) > b) (a) = b; (a); })