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