]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - lib/bind/isc/isc/platform.h
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / lib / bind / isc / isc / platform.h
1 /* $FreeBSD$ */
2
3 /*
4  * Copyright (C) 2004-2010  Internet Systems Consortium, Inc. ("ISC")
5  * Copyright (C) 1999-2003  Internet Software Consortium.
6  *
7  * Permission to use, copy, modify, and/or distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19
20 /* $Id: platform.h.in,v 1.56 2010/12/18 01:56:23 each Exp $ */
21
22 #ifndef ISC_PLATFORM_H
23 #define ISC_PLATFORM_H 1
24
25 /*! \file */
26
27 /*****
28  ***** Platform-dependent defines.
29  *****/
30
31 /***
32  *** Network.
33  ***/
34
35 /*! \brief
36  * Define if this system needs the <netinet/in6.h> header file included
37  * for full IPv6 support (pretty much only UnixWare).
38  */
39 #undef ISC_PLATFORM_NEEDNETINETIN6H
40
41 /*! \brief
42  * Define if this system needs the <netinet6/in6.h> header file included
43  * to support in6_pkinfo (pretty much only BSD/OS).
44  */
45 #undef ISC_PLATFORM_NEEDNETINET6IN6H
46
47 /*! \brief
48  * If sockaddrs on this system have an sa_len field, ISC_PLATFORM_HAVESALEN
49  * will be defined.
50  */
51 #define ISC_PLATFORM_HAVESALEN 1
52
53 /*! \brief
54  * If this system has the IPv6 structure definitions, ISC_PLATFORM_HAVEIPV6
55  * will be defined.
56  */
57 #define ISC_PLATFORM_HAVEIPV6 1
58
59 /*! \brief
60  * If this system is missing in6addr_any, ISC_PLATFORM_NEEDIN6ADDRANY will
61  * be defined.
62  */
63 #undef ISC_PLATFORM_NEEDIN6ADDRANY
64
65 /*! \brief
66  * If this system is missing in6addr_loopback, ISC_PLATFORM_NEEDIN6ADDRLOOPBACK
67  * will be defined.
68  */
69 #undef ISC_PLATFORM_NEEDIN6ADDRLOOPBACK
70
71 /*! \brief
72  * If this system has in6_pktinfo, ISC_PLATFORM_HAVEIN6PKTINFO will be
73  * defined.
74  */
75 #define ISC_PLATFORM_HAVEIN6PKTINFO 1
76
77 /*! \brief
78  * If this system has in_addr6, rather than in6_addr, ISC_PLATFORM_HAVEINADDR6
79  * will be defined.
80  */
81 #undef ISC_PLATFORM_HAVEINADDR6
82
83 /*! \brief
84  * If this system has sin6_scope_id, ISC_PLATFORM_HAVESCOPEID will be defined.
85  */
86 #define ISC_PLATFORM_HAVESCOPEID 1
87
88 /*! \brief
89  * If this system needs inet_ntop(), ISC_PLATFORM_NEEDNTOP will be defined.
90  */
91 #undef ISC_PLATFORM_NEEDNTOP
92
93 /*! \brief
94  * If this system needs inet_pton(), ISC_PLATFORM_NEEDPTON will be defined.
95  */
96 #undef ISC_PLATFORM_NEEDPTON
97
98 /*! \brief
99  * If this system needs in_port_t, ISC_PLATFORM_NEEDPORTT will be defined.
100  */
101 #undef ISC_PLATFORM_NEEDPORTT
102
103 /*! \brief
104  * Define if the system has struct lifconf which is a extended struct ifconf
105  * for IPv6.
106  */
107 #undef ISC_PLATFORM_HAVELIFCONF
108
109 /*! \brief
110  * Define if the system has struct if_laddrconf which is a extended struct
111  * ifconf for IPv6.
112  */
113 #undef ISC_PLATFORM_HAVEIF_LADDRCONF
114
115 /*! \brief
116  * Define if the system has struct if_laddrreq.
117  */
118 #undef ISC_PLATFORM_HAVEIF_LADDRREQ
119
120 /*! \brief
121  * Define either ISC_PLATFORM_BSD44MSGHDR or ISC_PLATFORM_BSD43MSGHDR.
122  */
123 #define ISC_NET_BSD44MSGHDR 1
124
125 /*! \brief
126  * Define if the system supports if_nametoindex.
127  */
128 #define ISC_PLATFORM_HAVEIFNAMETOINDEX 1
129
130 /*! \brief
131  * Define on some UnixWare systems to fix erroneous definitions of various
132  * IN6_IS_ADDR_* macros.
133  */
134 #undef ISC_PLATFORM_FIXIN6ISADDR
135
136 /*! \brief
137  * Define if the system supports kqueue multiplexing
138  */
139 #define ISC_PLATFORM_HAVEKQUEUE 1
140
141 /*! \brief
142  * Define if the system supports epoll multiplexing
143  */
144 #undef ISC_PLATFORM_HAVEEPOLL
145
146 /*! \brief
147  * Define if the system supports /dev/poll multiplexing
148  */
149 #undef ISC_PLATFORM_HAVEDEVPOLL
150
151 /*! \brief
152  * Define if we want to log backtrace
153  */
154 #define ISC_PLATFORM_USEBACKTRACE 1
155
156 /*
157  *** Printing.
158  ***/
159
160 /*! \brief
161  * If this system needs vsnprintf() and snprintf(), ISC_PLATFORM_NEEDVSNPRINTF
162  * will be defined.
163  */
164 #undef ISC_PLATFORM_NEEDVSNPRINTF
165
166 /*! \brief
167  * If this system need a modern sprintf() that returns (int) not (char*).
168  */
169 #undef ISC_PLATFORM_NEEDSPRINTF
170
171 /*! \brief
172  * The printf format string modifier to use with isc_uint64_t values.
173  */
174 #define ISC_PLATFORM_QUADFORMAT "ll"
175
176 /***
177  *** String functions.
178  ***/
179 /*
180  * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined.
181  */
182 #undef ISC_PLATFORM_NEEDSTRSEP
183
184 /*
185  * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
186  */
187 #undef ISC_PLATFORM_NEEDSTRLCPY
188
189 /*
190  * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined.
191  */
192 #undef ISC_PLATFORM_NEEDSTRLCAT
193
194 /*
195  * Define if this system needs strtoul.
196  */
197 #undef ISC_PLATFORM_NEEDSTRTOUL
198
199 /*
200  * Define if this system needs memmove.
201  */
202 #undef ISC_PLATFORM_NEEDMEMMOVE
203
204 /***
205  *** Miscellaneous.
206  ***/
207
208 /*
209  * Defined if we are using threads.
210  */
211 #define ISC_PLATFORM_USETHREADS 1
212
213 /*
214  * Defined if unistd.h does not cause fd_set to be delared.
215  */
216 #undef ISC_PLATFORM_NEEDSYSSELECTH
217
218 /*
219  * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include
220  * the GSSAPI header.
221  */
222 #define ISC_PLATFORM_GSSAPIHEADER <gssapi/gssapi.h>
223
224 /*
225  * Defined to <gssapi_krb5.h> or <gssapi/gssapi_krb5.h> for how to
226  * include the GSSAPI KRB5 header.
227  */
228 #define ISC_PLATFORM_GSSAPI_KRB5_HEADER <gssapi/gssapi_krb5.h>
229
230 /*
231  * Defined to <krb5.h> or <krb5/krb5.h> for how to include
232  * the KRB5 header.
233  */
234 #define ISC_PLATFORM_KRB5HEADER <krb5.h>
235
236 /*
237  * Type used for resource limits.
238  */
239 #define ISC_PLATFORM_RLIMITTYPE rlim_t
240
241 /*
242  * Define if your compiler supports "long long int".
243  */
244 #define ISC_PLATFORM_HAVELONGLONG 1
245
246 /*
247  * Define if PTHREAD_ONCE_INIT should be surrounded by braces to
248  * prevent compiler warnings (such as with gcc on Solaris 2.8).
249  */
250 #undef ISC_PLATFORM_BRACEPTHREADONCEINIT
251
252 /*
253  * Used to control how extern data is linked; needed for Win32 platforms.
254  */
255 #undef ISC_PLATFORM_USEDECLSPEC
256
257 /*
258  * Define if the platform has <sys/un.h>.
259  */
260 #define ISC_PLATFORM_HAVESYSUNH 1
261
262 /*
263  * If the "xadd" operation is available on this architecture,
264  * ISC_PLATFORM_HAVEXADD will be defined.
265  */
266 /*
267  * FreeBSD local modification, preserve this over upgrades
268  */
269 #if defined (__i386__) || defined (__amd64__) || defined (__ia64__)
270 #define ISC_PLATFORM_HAVEXADD 1
271 #else
272 #undef ISC_PLATFORM_HAVEXADD
273 #endif
274
275 /*
276  * If the "xaddq" operation (64bit xadd) is available on this architecture,
277  * ISC_PLATFORM_HAVEXADDQ will be defined.
278  */
279 /*
280  * FreeBSD local modification, preserve this over upgrades
281  */
282 #ifdef __amd64__
283 #define ISC_PLATFORM_HAVEXADDQ 1
284 #else
285 #undef ISC_PLATFORM_HAVEXADDQ
286 #endif
287
288 /*
289  * If the "atomic swap" operation is available on this architecture,
290  * ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
291  */
292 /*
293  * FreeBSD local modification, preserve this over upgrades
294  */
295 #if defined (__i386__) || defined (__amd64__) || defined (__ia64__)
296 #define ISC_PLATFORM_HAVEATOMICSTORE 1
297 #else
298 #undef ISC_PLATFORM_HAVEATOMICSTORE
299 #endif
300
301 /*
302  * If the "compare-and-exchange" operation is available on this architecture,
303  * ISC_PLATFORM_HAVECMPXCHG will be defined.
304  */
305 /*
306  * FreeBSD local modification, preserve this over upgrades
307  */
308 #if defined (__i386__) || defined (__amd64__) || defined (__ia64__)
309 #define ISC_PLATFORM_HAVECMPXCHG 1
310 #else
311 #undef ISC_PLATFORM_HAVECMPXCHG
312 #endif
313
314 /*
315  * Define if gcc ASM extension is available
316  */
317 /*
318  * FreeBSD local modification, preserve this over upgrades
319  */
320 #if defined (__i386__) || defined (__amd64__) || defined (__ia64__)
321 #define ISC_PLATFORM_USEGCCASM 1
322 #else
323 #undef ISC_PLATFORM_USEGCCASM
324 #endif
325
326 /*
327  * Define if Tru64 style ASM syntax must be used.
328  */
329 #undef ISC_PLATFORM_USEOSFASM
330
331 /*
332  * Define if the standard __asm function must be used.
333  */
334
335
336 /*
337  * Define if the platform has <strings.h>.
338  */
339 #define ISC_PLATFORM_HAVESTRINGSH 1
340
341 /*
342  * Define if the hash functions must be provided by OpenSSL.
343  */
344 #undef ISC_PLATFORM_OPENSSLHASH
345
346 /*
347  * Defines for the noreturn attribute.
348  */
349 #define ISC_PLATFORM_NORETURN_PRE
350 #define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn))
351
352 /***
353  ***    Windows dll support.
354  ***/
355
356 /*
357  * Define if MacOS style of PPC assembly must be used.
358  * e.g. "r6", not "6", for register six.
359  */
360
361
362 #ifndef ISC_PLATFORM_USEDECLSPEC
363 #define LIBISC_EXTERNAL_DATA
364 #define LIBDNS_EXTERNAL_DATA
365 #define LIBISCCC_EXTERNAL_DATA
366 #define LIBISCCFG_EXTERNAL_DATA
367 #define LIBBIND9_EXTERNAL_DATA
368 #else /*! \brief ISC_PLATFORM_USEDECLSPEC */
369 #ifdef LIBISC_EXPORTS
370 #define LIBISC_EXTERNAL_DATA __declspec(dllexport)
371 #else
372 #define LIBISC_EXTERNAL_DATA __declspec(dllimport)
373 #endif
374 #ifdef LIBDNS_EXPORTS
375 #define LIBDNS_EXTERNAL_DATA __declspec(dllexport)
376 #else
377 #define LIBDNS_EXTERNAL_DATA __declspec(dllimport)
378 #endif
379 #ifdef LIBISCCC_EXPORTS
380 #define LIBISCCC_EXTERNAL_DATA __declspec(dllexport)
381 #else
382 #define LIBISCCC_EXTERNAL_DATA __declspec(dllimport)
383 #endif
384 #ifdef LIBISCCFG_EXPORTS
385 #define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport)
386 #else
387 #define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport)
388 #endif
389 #ifdef LIBBIND9_EXPORTS
390 #define LIBBIND9_EXTERNAL_DATA __declspec(dllexport)
391 #else
392 #define LIBBIND9_EXTERNAL_DATA __declspec(dllimport)
393 #endif
394 #endif /*! \brief ISC_PLATFORM_USEDECLSPEC */
395
396 /*
397  * Tell emacs to use C mode for this file.
398  *
399  * Local Variables:
400  * mode: c
401  * End:
402  */
403
404 #endif /* ISC_PLATFORM_H */