1 /* 2 * Copyright (C) 2004-2010, 2013, 2014 Internet Systems Consortium, Inc. ("ISC") 3 * Copyright (C) 1999-2003 Internet Software Consortium. 4 * 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. 8 * 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. 16 */ 17 18 /* Id: platform.h.in,v 1.56 2010/12/18 01:56:23 each Exp */ 19 20 #ifndef ISC_PLATFORM_H 21 #define ISC_PLATFORM_H 1 22 23 #include <sys/atomic.h> 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 has struct sockaddr_storage. 138 */ 139 #define ISC_PLATFORM_HAVESOCKADDRSTORAGE 1 140 141 /*! \brief 142 * Define if the system supports kqueue multiplexing 143 */ 144 #ifndef __minix 145 #define ISC_PLATFORM_HAVEKQUEUE 1 146 #else /* __minix */ 147 #undef ISC_PLATFORM_HAVEKQUEUE 148 #endif /* __minix */ 149 150 /*! \brief 151 * Define if the system supports epoll multiplexing 152 */ 153 #undef ISC_PLATFORM_HAVEEPOLL 154 155 /*! \brief 156 * Define if the system supports /dev/poll multiplexing 157 */ 158 #undef ISC_PLATFORM_HAVEDEVPOLL 159 160 /*! \brief 161 * Define if we want to log backtrace 162 */ 163 #define ISC_PLATFORM_USEBACKTRACE 1 164 165 /* 166 *** Printing. 167 ***/ 168 169 /*! \brief 170 * If this system needs vsnprintf() and snprintf(), ISC_PLATFORM_NEEDVSNPRINTF 171 * will be defined. 172 */ 173 #undef ISC_PLATFORM_NEEDVSNPRINTF 174 175 /*! \brief 176 * If this system need a modern sprintf() that returns (int) not (char*). 177 */ 178 #undef ISC_PLATFORM_NEEDSPRINTF 179 180 /*! \brief 181 * The printf format string modifier to use with isc_uint64_t values. 182 */ 183 #define ISC_PLATFORM_QUADFORMAT "ll" 184 185 /*** 186 *** String functions. 187 ***/ 188 /* 189 * If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined. 190 */ 191 #undef ISC_PLATFORM_NEEDSTRSEP 192 193 /* 194 * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined. 195 */ 196 #undef ISC_PLATFORM_NEEDSTRLCPY 197 198 /* 199 * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined. 200 */ 201 #undef ISC_PLATFORM_NEEDSTRLCAT 202 203 /* 204 * Define if this system needs strtoul. 205 */ 206 #undef ISC_PLATFORM_NEEDSTRTOUL 207 208 /* 209 * Define if this system needs memmove. 210 */ 211 #undef ISC_PLATFORM_NEEDMEMMOVE 212 213 /* 214 * Define if this system needs strcasestr. 215 */ 216 #undef ISC_PLATFORM_NEEDSTRCASESTR 217 218 /*** 219 *** Miscellaneous. 220 ***/ 221 222 #if 0 /* In the Makefile */ 223 /* 224 * Defined if we are using threads. 225 */ 226 #define ISC_PLATFORM_USETHREADS 1 227 #endif 228 229 /* 230 * Defined if unistd.h does not cause fd_set to be delared. 231 */ 232 #undef ISC_PLATFORM_NEEDSYSSELECTH 233 234 /* 235 * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include 236 * the GSSAPI header. 237 */ 238 #define ISC_PLATFORM_GSSAPIHEADER <gssapi/gssapi.h> 239 240 /* 241 * Defined to <gssapi_krb5.h> or <gssapi/gssapi_krb5.h> for how to 242 * include the GSSAPI KRB5 header. 243 */ 244 #define ISC_PLATFORM_GSSAPI_KRB5_HEADER <gssapi/gssapi_krb5.h> 245 246 /* 247 * Defined to <krb5.h> or <krb5/krb5.h> for how to include 248 * the KRB5 header. 249 */ 250 #define ISC_PLATFORM_KRB5HEADER <krb5/krb5.h> 251 252 /* 253 * Type used for resource limits. 254 */ 255 #define ISC_PLATFORM_RLIMITTYPE rlim_t 256 257 /* 258 * Define if your compiler supports "long long int". 259 */ 260 #define ISC_PLATFORM_HAVELONGLONG 1 261 262 /* 263 * Define if PTHREAD_ONCE_INIT should be surrounded by braces to 264 * prevent compiler warnings (such as with gcc on Solaris 2.8). 265 */ 266 #undef ISC_PLATFORM_BRACEPTHREADONCEINIT 267 268 /* 269 * Used to control how extern data is linked; needed for Win32 platforms. 270 */ 271 #undef ISC_PLATFORM_USEDECLSPEC 272 273 /* 274 * Define if the platform has <sys/un.h>. 275 */ 276 #define ISC_PLATFORM_HAVESYSUNH 1 277 278 /* 279 * If the "xadd" operation is available on this architecture, 280 * ISC_PLATFORM_HAVEXADD will be defined. 281 */ 282 #define ISC_PLATFORM_HAVEXADD 1 283 284 /* 285 * If the "xaddq" operation (64bit xadd) is available on this architecture, 286 * ISC_PLATFORM_HAVEXADDQ will be defined. 287 */ 288 #ifdef __HAVE_ATOMIC64_OPS 289 #define ISC_PLATFORM_HAVEXADDQ 1 290 #endif 291 292 /* 293 * If the "atomic swap" operation is available on this architecture, 294 * ISC_PLATFORM_HAVEATOMICSTORE" will be defined. 295 */ 296 #define ISC_PLATFORM_HAVEATOMICSTORE 1 297 298 /* 299 * If the "compare-and-exchange" operation is available on this architecture, 300 * ISC_PLATFORM_HAVECMPXCHG will be defined. 301 */ 302 #define ISC_PLATFORM_HAVECMPXCHG 1 303 304 /* 305 * Define if gcc ASM extension is available 306 */ 307 #define ISC_PLATFORM_USEGCCASM 1 308 309 /* 310 * Define if Tru64 style ASM syntax must be used. 311 */ 312 #undef ISC_PLATFORM_USEOSFASM 313 314 /* 315 * Define if the standard __asm function must be used. 316 */ 317 318 319 /* 320 * Define if the platform has <strings.h>. 321 */ 322 #define ISC_PLATFORM_HAVESTRINGSH 1 323 324 /* 325 * Define if the hash functions must be provided by OpenSSL. 326 */ 327 #undef ISC_PLATFORM_OPENSSLHASH 328 329 /* 330 * Define if AES must be provided by OpenSSL. 331 */ 332 #define ISC_PLATFORM_OPENSSLAES 1 333 334 /* 335 * Define if AES support is wanted 336 */ 337 #define ISC_PLATFORM_WANTAES 1 338 339 /* 340 * Defines for the noreturn attribute. 341 */ 342 #define ISC_PLATFORM_NORETURN_PRE 343 #define ISC_PLATFORM_NORETURN_POST __attribute__((noreturn)) 344 345 /* 346 * Defined if we are enabling SIT (Source Identity Token). 347 */ 348 #define ISC_PLATFORM_USESIT 1 349 350 /*** 351 *** Windows dll support. 352 ***/ 353 354 /* 355 * Define if MacOS style of PPC assembly must be used. 356 * e.g. "r6", not "6", for register six. 357 */ 358 359 360 #ifndef ISC_PLATFORM_USEDECLSPEC 361 #define LIBISC_EXTERNAL_DATA 362 #define LIBDNS_EXTERNAL_DATA 363 #define LIBISCCC_EXTERNAL_DATA 364 #define LIBISCCFG_EXTERNAL_DATA 365 #define LIBBIND9_EXTERNAL_DATA 366 #define LIBTESTS_EXTERNAL_DATA 367 #else /*! \brief ISC_PLATFORM_USEDECLSPEC */ 368 #ifdef LIBISC_EXPORTS 369 #define LIBISC_EXTERNAL_DATA __declspec(dllexport) 370 #else 371 #define LIBISC_EXTERNAL_DATA __declspec(dllimport) 372 #endif 373 #ifdef LIBDNS_EXPORTS 374 #define LIBDNS_EXTERNAL_DATA __declspec(dllexport) 375 #else 376 #define LIBDNS_EXTERNAL_DATA __declspec(dllimport) 377 #endif 378 #ifdef LIBISCCC_EXPORTS 379 #define LIBISCCC_EXTERNAL_DATA __declspec(dllexport) 380 #else 381 #define LIBISCCC_EXTERNAL_DATA __declspec(dllimport) 382 #endif 383 #ifdef LIBISCCFG_EXPORTS 384 #define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport) 385 #else 386 #define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport) 387 #endif 388 #ifdef LIBBIND9_EXPORTS 389 #define LIBBIND9_EXTERNAL_DATA __declspec(dllexport) 390 #else 391 #define LIBBIND9_EXTERNAL_DATA __declspec(dllimport) 392 #endif 393 #ifdef LIBTESTS_EXPORTS 394 #define LIBTESTS_EXTERNAL_DATA __declspec(dllexport) 395 #else 396 #define LIBTESTS_EXTERNAL_DATA __declspec(dllimport) 397 #endif 398 #endif /*! \brief ISC_PLATFORM_USEDECLSPEC */ 399 400 /* 401 * Tell emacs to use C mode for this file. 402 * 403 * Local Variables: 404 * mode: c 405 * End: 406 */ 407 408 #endif /* ISC_PLATFORM_H */ 409