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