File: linux.h

package info (click to toggle)
squid 7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,440 kB
  • sloc: cpp: 184,513; ansic: 12,442; sh: 5,688; makefile: 5,247; perl: 2,560; sql: 326; python: 240; awk: 141; sed: 1
file content (73 lines) | stat: -rw-r--r-- 2,216 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
 *
 * Squid software is distributed under GPLv2+ license and includes
 * contributions from numerous individuals and organizations.
 * Please see the COPYING and CONTRIBUTORS files for details.
 */

#ifndef SQUID_COMPAT_OS_LINUX_H
#define SQUID_COMPAT_OS_LINUX_H

#if _SQUID_LINUX_

/****************************************************************************
 *--------------------------------------------------------------------------*
 * DO *NOT* MAKE ANY CHANGES below here unless you know what you're doing...*
 *--------------------------------------------------------------------------*
 ****************************************************************************/

#if USE_ASYNC_IO
#define _SQUID_LINUX_THREADS_
#endif

/*
 * res_init() is just a macro re-definition of __res_init on Linux (Debian/Ubuntu)
 */
#if !defined(HAVE_RES_INIT) && defined(HAVE___RES_INIT) && !defined(res_init)
#define res_init  __res_init
#define HAVE_RES_INIT  HAVE___RES_INIT
#endif

/*
 * Netfilter header madness. (see Bug 4323)
 *
 * Netfilter have a history of defining their own versions of network protocol
 * primitives without sufficient protection against the POSIX defines which are
 * always present in Linux.
 *
 * netinet/in.h must be included before any other sys header in order to properly
 * activate include guards in <linux/libc-compat.h> the kernel maintainers added
 * to workaround it.
 */
#if HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif

/*
 * glob.h is provided by GNU on Linux and contains some unavoidable preprocessor
 * logic errors in its 64-bit definitions which are hit by non-GCC compilers.
 *
 * #if __USE_FILE_OFFSET64 && __GNUC__ < 2
 *  # define glob glob64
 * #endif
 * #if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2
 * extern "C" glob(...);
 * #endif
 * extern "C" glob64(...);
 *
 * ... and multiple "C" definitions of glob64 refuse to compile.
 * Because __GNUC__ being undefined equates to 0 and (0 < 2)
 */
#if __USE_FILE_OFFSET64 && __GNUC__ < 2
#if HAVE_GLOB_H
#undef HAVE_GLOB_H
#endif
#if HAVE_GLOB
#undef HAVE_GLOB
#endif
#endif

#endif /* _SQUID_LINUX_ */
#endif /* SQUID_COMPAT_OS_LINUX_H */