]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/cmsg.h
Merged from trunk (r12181, v3.2.0.17+)
[thirdparty/squid.git] / compat / cmsg.h
1 #ifndef SQUID_COMPAT_CMSG_H
2 #define SQUID_COMPAT_CMSG_H
3
4 // CMSG_SPACE is not constant on some systems (in particular Max OS X),
5 // provide a replacement that can be used at build time in that case
6
7 #if HAVE_SYS_SOCKET_H
8 #include <sys/socket.h>
9 #endif
10
11 #if HAVE_CONSTANT_CMSG_SPACE
12 #define SQUID_CMSG_SPACE CMSG_SPACE
13 #else
14 // add 16 bytes for header and data alignment
15 #define SQUID_CMSG_SPACE(len) (sizeof(struct cmsghdr) + (len) + 16)
16 #endif
17
18 #endif /* SQUID_COMPAT_CMSG_H */