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