2 * Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 1999-2003 Internet Software Consortium.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
18 /* Id: platform.h.in,v 1.53 2009/09/29 15:06:07 fdupont Exp */
20 #ifndef ISC_PLATFORM_H
21 #define ISC_PLATFORM_H 1
26 ***** Platform-dependent defines.
28 #include <sys/atomic.h>
35 * Define if this system needs the <netinet/in6.h> header file included
36 * for full IPv6 support (pretty much only UnixWare).
38 #undef ISC_PLATFORM_NEEDNETINETIN6H
41 * Define if this system needs the <netinet6/in6.h> header file included
42 * to support in6_pkinfo (pretty much only BSD/OS).
44 #undef ISC_PLATFORM_NEEDNETINET6IN6H
47 * If sockaddrs on this system have an sa_len field, ISC_PLATFORM_HAVESALEN
50 #define ISC_PLATFORM_HAVESALEN 1
53 * If this system has the IPv6 structure definitions, ISC_PLATFORM_HAVEIPV6
56 #define ISC_PLATFORM_HAVEIPV6 1
59 * If this system is missing in6addr_any, ISC_PLATFORM_NEEDIN6ADDRANY will
62 #undef ISC_PLATFORM_NEEDIN6ADDRANY
65 * If this system is missing in6addr_loopback, ISC_PLATFORM_NEEDIN6ADDRLOOPBACK
68 #undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK
71 * If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be
74 #define ISC_PLATFORM_HAVEIN6PKTINFO 1
77 * If this system has in_addr6, rather than in6_addr, ISC_PLATFORM_HAVEINADDR6
80 #undef ISC_PLATFORM_HAVEINADDR6
83 * If this system has sin6_scope_id, ISC_PLATFORM_HAVESCOPEID will be defined.
85 #define ISC_PLATFORM_HAVESCOPEID 1
88 * If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined.
90 #undef ISC_PLATFORM_NEEDNTOP
93 * If this system needs inet_pton(), ISC_PLATFORM_NEEDPTON will be defined.
95 #undef ISC_PLATFORM_NEEDPTON
98 * If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined.
100 #undef ISC_PLATFORM_NEEDPORTT
103 * Define if the system has struct lifconf which is a extended struct ifconf
106 #undef ISC_PLATFORM_HAVELIFCONF
109 * Define if the system has struct if_laddrconf which is a extended struct
112 #undef ISC_PLATFORM_HAVEIF_LADDRCONF
115 * Define if the system has struct if_laddrreq.
117 #undef ISC_PLATFORM_HAVEIF_LADDRREQ
120 * Define either ISC_PLATFORM_BSD44MSGHDR or ISC_PLATFORM_BSD43MSGHDR.
122 #define ISC_NET_BSD44MSGHDR 1
125 * Define if the system supports if_nametoindex.
127 #define ISC_PLATFORM_HAVEIFNAMETOINDEX 1
130 * Define on some UnixWare systems to fix erroneous definitions of various
131 * IN6_IS_ADDR_* macros.
133 #undef ISC_PLATFORM_FIXIN6ISADDR
136 * Define if the system supports kqueue multiplexing
138 #define ISC_PLATFORM_HAVEKQUEUE 1
141 * Define if the system supports epoll multiplexing
143 #undef ISC_PLATFORM_HAVEEPOLL
146 * Define if the system supports /dev/poll multiplexing
148 #undef ISC_PLATFORM_HAVEDEVPOLL
151 * Define if we want to log backtrace
153 #define ISC_PLATFORM_USEBACKTRACE 1
160 * If this system needs vsnprintf() and snprintf(), ISC_PLATFORM_NEEDVSNPRINTF
163 #undef ISC_PLATFORM_NEEDVSNPRINTF
166 * If this system need a modern sprintf() that returns (int) not (char*).
168 #undef ISC_PLATFORM_NEEDSPRINTF
171 * The printf format string modifier to use with isc_uint64_t values.
173 #define ISC_PLATFORM_QUADFORMAT "ll"
176 *** String functions.
179 * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined.
181 #undef ISC_PLATFORM_NEEDSTRSEP
184 * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
186 #undef ISC_PLATFORM_NEEDSTRLCPY
189 * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined.
191 #undef ISC_PLATFORM_NEEDSTRLCAT
194 * Define if this system needs strtoul.
196 #undef ISC_PLATFORM_NEEDSTRTOUL
199 * Define if this system needs memmove.
201 #undef ISC_PLATFORM_NEEDMEMMOVE
208 * Defined if we are using threads.
210 #define ISC_PLATFORM_USETHREADS 1
213 * Defined if unistd.h does not cause fd_set to be delared.
215 #undef ISC_PLATFORM_NEEDSYSSELECTH
218 * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include
224 * Type used for resource limits.
226 #define ISC_PLATFORM_RLIMITTYPE rlim_t
229 * Define if your compiler supports "long long int".
231 #define ISC_PLATFORM_HAVELONGLONG 1
234 * Define if PTHREAD_ONCE_INIT should be surrounded by braces to
235 * prevent compiler warnings (such as with gcc on Solaris 2.8).
237 #undef ISC_PLATFORM_BRACEPTHREADONCEINIT
240 * Used to control how extern data is linked; needed for Win32 platforms.
242 #undef ISC_PLATFORM_USEDECLSPEC
245 * Define if the platform has <sys/un.h>.
247 #define ISC_PLATFORM_HAVESYSUNH 1
250 * If the "xadd" operation is available on this architecture,
251 * ISC_PLATFORM_HAVEXADD will be defined.
253 #define ISC_PLATFORM_HAVEXADD 1
256 * If the "xaddq" operation (64bit xadd) is available on this architecture,
257 * ISC_PLATFORM_HAVEXADDQ will be defined.
259 #ifdef __HAVE_ATOMIC64_OPS
260 #define ISC_PLATFORM_HAVEXADDQ 1
264 * If the "atomic swap" operation is available on this architecture,
265 * ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
267 #define ISC_PLATFORM_HAVEATOMICSTORE 1
270 * If the "compare-and-exchange" operation is available on this architecture,
271 * ISC_PLATFORM_HAVECMPXCHG will be defined.
273 #define ISC_PLATFORM_HAVECMPXCHG 1
276 * Define if gcc ASM extension is available
278 #define ISC_PLATFORM_USEGCCASM 1
281 * Define if Tru64 style ASM syntax must be used.
283 #undef ISC_PLATFORM_USEOSFASM
286 * Define if the standard __asm function must be used.
291 * Define if the platform has <strings.h>.
293 #define ISC_PLATFORM_HAVESTRINGSH 1
296 * Define if the hash functions must be provided by OpenSSL.
298 #undef ISC_PLATFORM_OPENSSLHASH
301 * Defines for the noreturn attribute.
303 #define ISC_PLATFORM_NORETURN_PRE
304 #define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))
307 *** Windows dll support.
311 * Define if MacOS style of PPC assembly must be used.
312 * e.g. "r6", not "6", for register six.
316 #ifndef ISC_PLATFORM_USEDECLSPEC
317 #define LIBISC_EXTERNAL_DATA
318 #define LIBDNS_EXTERNAL_DATA
319 #define LIBISCCC_EXTERNAL_DATA
320 #define LIBISCCFG_EXTERNAL_DATA
321 #define LIBBIND9_EXTERNAL_DATA
322 #else /*! \brief ISC_PLATFORM_USEDECLSPEC */
323 #ifdef LIBISC_EXPORTS
324 #define LIBISC_EXTERNAL_DATA __declspec(dllexport)
326 #define LIBISC_EXTERNAL_DATA __declspec(dllimport)
328 #ifdef LIBDNS_EXPORTS
329 #define LIBDNS_EXTERNAL_DATA __declspec(dllexport)
331 #define LIBDNS_EXTERNAL_DATA __declspec(dllimport)
333 #ifdef LIBISCCC_EXPORTS
334 #define LIBISCCC_EXTERNAL_DATA __declspec(dllexport)
336 #define LIBISCCC_EXTERNAL_DATA __declspec(dllimport)
338 #ifdef LIBISCCFG_EXPORTS
339 #define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport)
341 #define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport)
343 #ifdef LIBBIND9_EXPORTS
344 #define LIBBIND9_EXTERNAL_DATA __declspec(dllexport)
346 #define LIBBIND9_EXTERNAL_DATA __declspec(dllimport)
348 #endif /*! \brief ISC_PLATFORM_USEDECLSPEC */
351 * Tell emacs to use C mode for this file.
358 #endif /* ISC_PLATFORM_H */