mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 16:47:18 +02:00
[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.
This commit is contained in:
parent
63455a9be5
commit
cf83df3d16
@ -22,10 +22,16 @@
|
|||||||
#ifndef _COMMON_STANDARD_H
|
#ifndef _COMMON_STANDARD_H
|
||||||
#define _COMMON_STANDARD_H
|
#define _COMMON_STANDARD_H
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <common/config.h>
|
#include <common/config.h>
|
||||||
#include <proto/fd.h>
|
#include <proto/fd.h>
|
||||||
|
|
||||||
|
#ifndef INT_MAX
|
||||||
|
/* Needed on FreeBSD */
|
||||||
|
#include <sys/limits.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/****** string-specific macros and functions ******/
|
/****** string-specific macros and functions ******/
|
||||||
/* if a > max, then bound <a> to <max>. The macro returns the new <a> */
|
/* 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); })
|
#define UBOUND(a, max) ({ typeof(a) b = (max); if ((a) > b) (a) = b; (a); })
|
||||||
|
Loading…
Reference in New Issue
Block a user