Go to the documentation of this file.
9 #ifndef _SQUID_COMPAT_SHARED_H
10 #define _SQUID_COMPAT_SHARED_H
39 #if HAVE_SYS_RESOURCE_H
40 #include <sys/resource.h>
49 #define NAMLEN(dirent) strlen((dirent)->d_name)
52 #define NAMLEN(dirent) (dirent)->d_namlen
68 #if defined(__USE_FILE_OFFSET64) && !defined(__GNUC__)
69 #define dirent_t struct dirent64
71 #define dirent_t struct dirent
82 #if defined(USE_SELECT) || defined(USE_SELECT_WIN32)
84 # define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE)
86 #elif defined(USE_POLL)
88 # define SQUID_MAXFD_LIMIT ((signed int)FD_SETSIZE)
90 #elif defined(USE_KQUEUE) || defined(USE_EPOLL) || defined(USE_DEVPOLL)
91 # define SQUID_FDSET_NOUSE 1
94 # error Unknown select loop model!
97 #if !HAVE_STRUCT_RUSAGE
129 #define min(a,b) ((a) < (b) ? (a) : (b))
150 #define max(a,b) ((a) < (b) ? (b) : (a))
157 #define w_space " \t\n\r"
159 #ifndef SQUID_NONBLOCK
164 #if defined(O_NONBLOCK)
171 #define SQUID_NONBLOCK O_NONBLOCK
174 #define SQUID_NONBLOCK O_NDELAY
182 #if defined(__cplusplus)
196 #define SA_RESETHAND 0
198 #if SA_RESETHAND == 0 && defined(SA_ONESHOT)
200 #define SA_RESETHAND SA_ONESHOT
208 #if HAVE_ET_COM_ERR_H
210 #include <et/com_err.h>
238 #define memcpy(d,s,n) bcopy((s),(d),(n))
240 #define memcpy(d,s,n) memmove((d),(s),(n))
244 #if !HAVE_MEMMOVE && HAVE_BCOPY
245 #define memmove(d,s,n) bcopy((s),(d),(n))
253 #define squid_strnstr(a,b,c) strnstr(a,b,c)
260 #if !defined(PRINTF_FORMAT_ARG1)
261 #define PRINTF_FORMAT_ARG1 __attribute__ ((format (printf, 1, 2)))
263 #if !defined(PRINTF_FORMAT_ARG2)
264 #define PRINTF_FORMAT_ARG2 __attribute__ ((format (printf, 2, 3)))
266 #if !defined(PRINTF_FORMAT_ARG3)
267 #define PRINTF_FORMAT_ARG3 __attribute__ ((format (printf, 3, 4)))
270 #define PRINTF_FORMAT_ARG1
271 #define PRINTF_FORMAT_ARG2
272 #define PRINTF_FORMAT_ARG3
void(* failure_notify)(const char *)
const char * squid_strnstr(const char *s, const char *find, size_t slen)
A const & max(A const &lhs, A const &rhs)
A const & min(A const &lhs, A const &rhs)