]> git.ipfire.org Git - thirdparty/squid.git/blame - compat/os/solaris.h
SourceFormat Enforcement
[thirdparty/squid.git] / compat / os / solaris.h
CommitLineData
f04e1182
AJ
1#ifndef SQUID_OS_SOLARIS_H
2#define SQUID_OS_SOLARIS_H
3
00177188 4#if _SQUID_SOLARIS_
f04e1182 5
cdb86165
FC
6/*
7 * ugly hack. System headers require wcsstr, but don't define it.
a2b71b22 8 */
cdb86165
FC
9#include <wchar.h>
10#ifdef wcsstr
11#undef wcsstr
12#endif /* wcsstr */
13#define wcsstr wcswcs
14
f04e1182
AJ
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)
32d002cb 21#if !HAVE_PAD128_T
f04e1182 22typedef union {
af6a12ee
AJ
23 long double _q;
24 int32_t _l[4];
f04e1182
AJ
25} pad128_t;
26#endif
32d002cb 27#if !HAVE_UPAD128_T
f04e1182 28typedef union {
af6a12ee
AJ
29 long double _q;
30 uint32_t _l[4];
f04e1182
AJ
31} upad128_t;
32#endif
33#endif
34
35/**
36 * prototypes for system function missing from system includes
ef364f64 37 * NP: sys/resource.h and sys/time.h are apparently order-dependant.
f04e1182 38 */
ef364f64 39#include <sys/time.h>
20939c63 40#include <sys/resource.h>
f04e1182
AJ
41SQUIDCEXTERN int getrusage(int, struct rusage *);
42
f04e1182
AJ
43/**
44 * prototypes for system function missing from system includes
45 * on some Solaris systems.
46 */
47SQUIDCEXTERN int getpagesize(void);
48#if !defined(_XPG4_2) && !(defined(__EXTENSIONS__) || \
af6a12ee 49(!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)))
f04e1182
AJ
50SQUIDCEXTERN int gethostname(char *, int);
51#endif
52
00177188
FC
53/*
54 * SunPro CC handles extern inline as inline, PLUS extern symbols.
55 */
00177188
FC
56#if !defined(_SQUID_EXTERNNEW_) && defined(__SUNPRO_CC)
57#define _SQUID_EXTERNNEW_ extern
58#endif
f04e1182 59
082d4946 60/*
e6aa9181 61 * SunStudio CC does not define C++ portability API __FUNCTION__
082d4946
AJ
62 */
63#if defined(__SUNPRO_CC) && !defined(__FUNCTION__)
455e639b 64#define __FUNCTION__ ""
082d4946 65#endif
f04e1182 66
e4286fd8
AJ
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
055421ee
AJ
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
37297175
AJ
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
e4286fd8 85
2d6b4a82
AL
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
8b063e34
JMMC
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
2d6b4a82 95
9602fb24
AJ
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
8b063e34
JMMC
104/* Solaris 10 does not define strsep() */
105#include "compat/strsep.h"
106
f04e1182
AJ
107#endif /* _SQUID_SOLARIS_ */
108#endif /* SQUID_OS_SOALRIS_H */