]> git.ipfire.org Git - thirdparty/squid.git/blame - compat/os/linux.h
SourceFormat Enforcement
[thirdparty/squid.git] / compat / os / linux.h
CommitLineData
f04e1182
AJ
1#ifndef SQUID_OS_LINUX_H
2#define SQUID_OS_LINUX_H
3
1191b93b 4#if _SQUID_LINUX_
f04e1182
AJ
5
6/****************************************************************************
7 *--------------------------------------------------------------------------*
8 * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
9 *--------------------------------------------------------------------------*
10 ****************************************************************************/
11
f04e1182
AJ
12#if USE_ASYNC_IO
13#define _SQUID_LINUX_THREADS_
14#endif
15
16/*
17 * res_init() is just a macro re-definition of __res_init on Linux (Debian/Ubuntu)
18 */
19#if !defined(HAVE_RES_INIT) && defined(HAVE___RES_INIT) && !defined(res_init)
20#define res_init __res_init
21#define HAVE_RES_INIT HAVE___RES_INIT
22#endif
23
bc8dfb10
AJ
24/*
25 * sys/capability.h is only needed in Linux apparently.
26 *
5b43d209 27 * HACK: LIBCAP_BROKEN Ugly glue to get around linux header madness colliding with glibc
bc8dfb10
AJ
28 */
29#if HAVE_SYS_CAPABILITY_H
30
5b43d209 31#if LIBCAP_BROKEN
bc8dfb10
AJ
32#undef _POSIX_SOURCE
33#define _LINUX_TYPES_H
34#define _LINUX_FS_H
35typedef uint32_t __u32;
36#endif
37
38#include <sys/capability.h>
39#endif /* HAVE_SYS_CAPABILITY_H */
40
92ca76f7
AJ
41/*
42 * glob.h is provided by GNU on Linux and contains some unavoidable preprocessor
43 * logic errors in its 64-bit definitions which are hit by non-GCC compilers.
44 *
45 * #if __USE_FILE_OFFSET64 && __GNUC__ < 2
46 * # define glob glob64
47 * #endif
48 * #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
49 * extern "C" glob(...);
50 * #endif
51 * extern "C" glob64(...);
52 *
53 * ... and multiple "C" definitions of glob64 refuse to compile.
54 * Because __GNUC__ being undefined equates to 0 and (0 < 2)
55 */
56#if __USE_FILE_OFFSET64 && __GNUC__ < 2
57#if HAVE_GLOB_H
58#undef HAVE_GLOB_H
59#endif
60#if HAVE_GLOB
61#undef HAVE_GLOB
62#endif
63#endif
bc8dfb10 64
f04e1182
AJ
65#endif /* _SQUID_LINUX_ */
66#endif /* SQUID_OS_LINUX_H */