]> git.ipfire.org Git - thirdparty/squid.git/blob - compat/os/solaris.h
Merged from trunk (r12098, v3.2.0.16+).
[thirdparty/squid.git] / compat / os / solaris.h
1 #ifndef SQUID_OS_SOLARIS_H
2 #define SQUID_OS_SOLARIS_H
3
4
5 #if _SQUID_SOLARIS_
6
7 /*
8 * ugly hack. System headers require wcsstr, but don't define it.
9 */
10 #include <wchar.h>
11 #ifdef wcsstr
12 #undef wcsstr
13 #endif /* wcsstr */
14 #define wcsstr wcswcs
15
16 /*
17 * On Solaris 9 x86, gcc may includes a "fixed" set of old system
18 * include files that is incompatible with the updated Solaris
19 * header files.
20 */
21 #if defined(i386) || defined(__i386)
22 #if !HAVE_PAD128_T
23 typedef union {
24 long double _q;
25 int32_t _l[4];
26 } pad128_t;
27 #endif
28 #if !HAVE_UPAD128_T
29 typedef union {
30 long double _q;
31 uint32_t _l[4];
32 } upad128_t;
33 #endif
34 #endif
35
36 /**
37 * prototypes for system function missing from system includes
38 * NP: sys/resource.h and sys/time.h are apparently order-dependant.
39 */
40 #include <sys/time.h>
41 #include <sys/resource.h>
42 SQUIDCEXTERN int getrusage(int, struct rusage *);
43
44 /**
45 * prototypes for system function missing from system includes
46 * on some Solaris systems.
47 */
48 SQUIDCEXTERN int getpagesize(void);
49 #if !defined(_XPG4_2) && !(defined(__EXTENSIONS__) || \
50 (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)))
51 SQUIDCEXTERN int gethostname(char *, int);
52 #endif
53
54 /*
55 * SunPro CC handles extern inline as inline, PLUS extern symbols.
56 */
57 #if !defined(_SQUID_EXTERNNEW_) && defined(__SUNPRO_CC)
58 #define _SQUID_EXTERNNEW_ extern
59 #endif
60
61 /*
62 * SunStudio CC does not define C++ portability API __FUNCTION__
63 */
64 #if defined(__SUNPRO_CC) && !defined(__FUNCTION__)
65 #define __FUNCTION__ ""
66 #endif
67
68 /* Exclude CPPUnit tests from the allocator restrictions. */
69 /* BSD implementation uses these still */
70 #if defined(SQUID_UNIT_TEST)
71 #define SQUID_NO_STRING_BUFFER_PROTECT 1
72 #endif
73
74 /* Bug 2500: Solaris 10/11 require s6_addr* defines. */
75 //#define s6_addr8 _S6_un._S6_u8
76 //#define s6_addr16 _S6_un._S6_u16
77 #define s6_addr32 _S6_un._S6_u32
78
79 /* Bug 3057: Solaris 9 defines struct addrinfo with size_t instead of socklen_t
80 * this causes binary incompatibility on 64-bit systems.
81 * Fix this by bundling a copy of the OpenSolaris 10 netdb.h to use instead.
82 */
83 #if defined(__sparcv9)
84 #include "compat/os/opensolaris_10_netdb.h"
85 #endif
86
87 /* Solaris 10 lacks SUN_LEN */
88 #if !defined(SUN_LEN)
89 #define SUN_LEN(su) (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
90 #endif
91
92 /* Soaris 10 does not define POSIX AF_LOCAL, but does define the Unix name */
93 #if !defined(AF_LOCAL)
94 #define AF_LOCAL AF_UNIX
95 #endif
96
97 /* Solaris lacks paths.h by default */
98 #if HAVE_PATHS_H
99 #include <paths.h>
100 #endif
101 #if !defined(_PATH_DEVNULL)
102 #define _PATH_DEVNULL "/dev/null"
103 #endif
104
105 /* Solaris 10 does not define strsep() */
106 #include "compat/strsep.h"
107
108 #endif /* _SQUID_SOLARIS_ */
109 #endif /* SQUID_OS_SOALRIS_H */