]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUILD] fix build on FreeBSD for INT_MIN/INT_MAX
authorWilly Tarreau <w@1wt.eu>
Mon, 9 Apr 2007 13:57:51 +0000 (15:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Apr 2007 13:57:51 +0000 (15:57 +0200)
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

index 5b9d4a8c6aeaef09e7ae6c47236ffa9a48dfd545..3dea1fdaec1db16e0139c3071c7441f1eeb189c3 100644 (file)
 #ifndef _COMMON_STANDARD_H
 #define _COMMON_STANDARD_H
 
+#include <sys/types.h>
 #include <netinet/in.h>
 #include <common/config.h>
 #include <proto/fd.h>
 
+#ifndef INT_MAX
+/* Needed on FreeBSD */
+#include <sys/limits.h>
+#endif
+
 /****** string-specific macros and functions ******/
 /* if a > max, then bound <a> to <max>. The macro returns the new <a> */
 #define UBOUND(a, max) ({ typeof(a) b = (max); if ((a) > b) (a) = b; (a); })