]>
git.ipfire.org Git - thirdparty/squid.git/blob - compat/os/linux.h
2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
9 #ifndef SQUID_OS_LINUX_H
10 #define SQUID_OS_LINUX_H
14 /****************************************************************************
15 *--------------------------------------------------------------------------*
16 * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
17 *--------------------------------------------------------------------------*
18 ****************************************************************************/
21 #define _SQUID_LINUX_THREADS_
25 * res_init() is just a macro re-definition of __res_init on Linux (Debian/Ubuntu)
27 #if !defined(HAVE_RES_INIT) && defined(HAVE___RES_INIT) && !defined(res_init)
28 #define res_init __res_init
29 #define HAVE_RES_INIT HAVE___RES_INIT
33 * Netfilter header madness. (see Bug 4323)
35 * Netfilter have a history of defining their own versions of network protocol
36 * primitives without sufficient protection against the POSIX defines which are
37 * aways present in Linux.
39 * netinet/in.h must be included before any other sys header in order to properly
40 * activate include guards in <linux/libc-compat.h> the kernel maintainers added
44 #include <netinet/in.h>
48 * sys/capability.h is only needed in Linux apparently.
50 * HACK: LIBCAP_BROKEN Ugly glue to get around linux header madness colliding with glibc
52 #if HAVE_SYS_CAPABILITY_H
56 #define _LINUX_TYPES_H
58 typedef uint32_t __u32
;
61 #include <sys/capability.h>
62 #endif /* HAVE_SYS_CAPABILITY_H */
65 * glob.h is provided by GNU on Linux and contains some unavoidable preprocessor
66 * logic errors in its 64-bit definitions which are hit by non-GCC compilers.
68 * #if __USE_FILE_OFFSET64 && __GNUC__ < 2
69 * # define glob glob64
71 * #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
72 * extern "C" glob(...);
74 * extern "C" glob64(...);
76 * ... and multiple "C" definitions of glob64 refuse to compile.
77 * Because __GNUC__ being undefined equates to 0 and (0 < 2)
79 #if __USE_FILE_OFFSET64 && __GNUC__ < 2
88 #endif /* _SQUID_LINUX_ */
89 #endif /* SQUID_OS_LINUX_H */