platform.h.in 5.77 KB
Newer Older
1
/*
2
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3
 *
4 5 6
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 8 9
 *
 * See the COPYRIGHT file distributed with this work for additional
 * information regarding copyright ownership.
10 11 12 13 14
 */

#ifndef ISC_PLATFORM_H
#define ISC_PLATFORM_H 1

15 16
/*! \file */

17 18 19 20
/*****
 ***** Platform-dependent defines.
 *****/

21 22 23 24 25 26 27 28
/***
 *** Thread-Local Storage
 ***/

#ifdef HAVE___THREAD
#define thread_local __thread
#endif

29 30 31 32 33 34
/***
 *** Default strerror_r buffer size
 ***/

#define ISC_STRERRORSIZE 128

35 36 37 38
/***
 *** Network.
 ***/

39
/*! \brief
40 41
 * Define if the system has struct lifconf which is a extended struct ifconf
 * for IPv6.
42
 */
43
@ISC_PLATFORM_HAVELIFCONF@
Automatic Updater's avatar
Automatic Updater committed
44

45
/*! \brief
46 47
 * Define if the system has struct if_laddrconf which is a extended struct
 * ifconf for IPv6.
48
 */
49
@ISC_PLATFORM_HAVEIF_LADDRCONF@
Automatic Updater's avatar
Automatic Updater committed
50

51
/*! \brief
52
 * Define if the system has struct if_laddrreq.
53
 */
54
@ISC_PLATFORM_HAVEIF_LADDRREQ@
55

56
/*! \brief
57
 * Define if the system supports if_nametoindex.
David Lawrence's avatar
David Lawrence committed
58
 */
59
@ISC_PLATFORM_HAVEIFNAMETOINDEX@
60

61 62 63 64 65
/*! \brief
 * Define if the system has TCP_FASTOPEN socket option.
 */
@ISC_PLATFORM_HAVETFO@

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
/*! \brief
 * Define if the system supports kqueue multiplexing
 */
@ISC_PLATFORM_HAVEKQUEUE@

/*! \brief
 * Define if the system supports epoll multiplexing
 */
@ISC_PLATFORM_HAVEEPOLL@

/*! \brief
 * Define if the system supports /dev/poll multiplexing
 */
@ISC_PLATFORM_HAVEDEVPOLL@

81 82 83 84 85
/*! \brief
 * Define if we want to log backtrace
 */
@ISC_PLATFORM_USEBACKTRACE@

86
/*
87 88 89
 *** Printing.
 ***/

90 91 92 93
/*
 * If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
 */
@ISC_PLATFORM_NEEDSTRLCPY@
Automatic Updater's avatar
Automatic Updater committed
94

95 96 97 98
/*
 * If the system needs strlcat(), ISC_PLATFORM_NEEDSTRLCAT will be defined.
 */
@ISC_PLATFORM_NEEDSTRLCAT@
Automatic Updater's avatar
Automatic Updater committed
99

100 101 102
/***
 *** Miscellaneous.
 ***/
Automatic Updater's avatar
Automatic Updater committed
103

104
/*
105 106 107
 * Defined if unistd.h does not cause fd_set to be delared.
 */
@ISC_PLATFORM_NEEDSYSSELECTH@
Automatic Updater's avatar
Automatic Updater committed
108

109 110 111 112 113
/*
 * Defined to <gssapi.h> or <gssapi/gssapi.h> for how to include
 * the GSSAPI header.
 */
@ISC_PLATFORM_GSSAPIHEADER@
Automatic Updater's avatar
Automatic Updater committed
114

115 116 117 118 119 120
/*
 * Defined to <gssapi_krb5.h> or <gssapi/gssapi_krb5.h> for how to
 * include the GSSAPI KRB5 header.
 */
@ISC_PLATFORM_GSSAPI_KRB5_HEADER@

121 122 123 124 125 126
/*
 * Defined to <krb5.h> or <krb5/krb5.h> for how to include
 * the KRB5 header.
 */
@ISC_PLATFORM_KRB5HEADER@

127 128 129 130 131
/*
 * Define if the system has nanosecond-level accuracy in file stats.
 */
@ISC_PLATFORM_HAVESTATNSEC@

132
/*
Mark Andrews's avatar
Mark Andrews committed
133 134 135 136
 * Define if your compiler supports "long long int".
 */
@ISC_PLATFORM_HAVELONGLONG@

137 138 139
/*
 * Define if PTHREAD_ONCE_INIT should be surrounded by braces to
 * prevent compiler warnings (such as with gcc on Solaris 2.8).
140
 */
141
@ISC_PLATFORM_BRACEPTHREADONCEINIT@
142

143
/*
144 145 146 147
 * Used to control how extern data is linked; needed for Win32 platforms.
 */
@ISC_PLATFORM_USEDECLSPEC@

148 149 150 151 152
/*
 * Define if the platform has <sys/un.h>.
 */
@ISC_PLATFORM_HAVESYSUNH@

153 154
/*
 * If the "xadd" operation is available on this architecture,
Automatic Updater's avatar
Automatic Updater committed
155
 * ISC_PLATFORM_HAVEXADD will be defined.
156 157 158
 */
@ISC_PLATFORM_HAVEXADD@

159 160
/*
 * If the "xaddq" operation (64bit xadd) is available on this architecture,
Automatic Updater's avatar
Automatic Updater committed
161
 * ISC_PLATFORM_HAVEXADDQ will be defined.
162 163 164
 */
@ISC_PLATFORM_HAVEXADDQ@

165
/*
166 167
 * If the 32-bit "atomic swap" operation is available on this
 * architecture, ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
168 169 170
 */
@ISC_PLATFORM_HAVEATOMICSTORE@

171 172 173 174 175 176
/*
 * If the 64-bit "atomic swap" operation is available on this
 * architecture, ISC_PLATFORM_HAVEATOMICSTORE" will be defined.
 */
@ISC_PLATFORM_HAVEATOMICSTOREQ@

177 178
/*
 * If the "compare-and-exchange" operation is available on this architecture,
Automatic Updater's avatar
Automatic Updater committed
179
 * ISC_PLATFORM_HAVECMPXCHG will be defined.
180 181 182
 */
@ISC_PLATFORM_HAVECMPXCHG@

183 184 185 186 187 188
/*
 * If <stdatomic.h> is available on this architecture,
 * ISC_PLATFORM_HAVESTDATOMIC will be defined.
 */
@ISC_PLATFORM_HAVESTDATOMIC@

189 190 191 192 193 194 195 196 197 198
/*
 * Define if gcc ASM extension is available
 */
@ISC_PLATFORM_USEGCCASM@

/*
 * Define if the standard __asm function must be used.
 */
@ISC_PLATFORM_USESTDASM@

Evan Hunt's avatar
Evan Hunt committed
199 200 201 202 203
/*
 * Define with the busy wait nop asm or function call.
 */
@ISC_PLATFORM_BUSYWAITNOP@

Evan Hunt's avatar
Evan Hunt committed
204 205 206 207 208
/*
 * Define if the platform has <strings.h>.
 */
@ISC_PLATFORM_HAVESTRINGSH@

Francis Dupont's avatar
Francis Dupont committed
209 210 211 212 213 214
/*
 * Defines for the noreturn attribute.
 */
@ISC_PLATFORM_NORETURN_PRE@
@ISC_PLATFORM_NORETURN_POST@

215 216 217 218
/***
 ***	Windows dll support.
 ***/

219 220 221 222 223 224
/*
 * Define if MacOS style of PPC assembly must be used.
 * e.g. "r6", not "6", for register six.
 */
@ISC_PLATFORM_USEMACASM@

225 226 227 228 229
#ifndef ISC_PLATFORM_USEDECLSPEC
#define LIBISC_EXTERNAL_DATA
#define LIBDNS_EXTERNAL_DATA
#define LIBISCCC_EXTERNAL_DATA
#define LIBISCCFG_EXTERNAL_DATA
230
#define LIBNS_EXTERNAL_DATA
231
#define LIBBIND9_EXTERNAL_DATA
232
#define LIBTESTS_EXTERNAL_DATA
233
#else /*! \brief ISC_PLATFORM_USEDECLSPEC */
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
#ifdef LIBISC_EXPORTS
#define LIBISC_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBISC_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBDNS_EXPORTS
#define LIBDNS_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBDNS_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBISCCC_EXPORTS
#define LIBISCCC_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBISCCC_EXTERNAL_DATA __declspec(dllimport)
#endif
#ifdef LIBISCCFG_EXPORTS
#define LIBISCCFG_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBISCCFG_EXTERNAL_DATA __declspec(dllimport)
#endif
254 255 256 257 258
#ifdef LIBNS_EXPORTS
#define LIBNS_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBNS_EXTERNAL_DATA __declspec(dllimport)
#endif
259 260 261 262 263
#ifdef LIBBIND9_EXPORTS
#define LIBBIND9_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBBIND9_EXTERNAL_DATA __declspec(dllimport)
#endif
264 265 266 267 268
#ifdef LIBTESTS_EXPORTS
#define LIBTESTS_EXTERNAL_DATA __declspec(dllexport)
#else
#define LIBTESTS_EXTERNAL_DATA __declspec(dllimport)
#endif
269
#endif /*! \brief ISC_PLATFORM_USEDECLSPEC */
270

271 272 273 274 275 276 277 278 279
/*
 * Tell emacs to use C mode for this file.
 *
 * Local Variables:
 * mode: c
 * End:
 */

#endif /* ISC_PLATFORM_H */