config.h.win32 9.29 KB
Newer Older
Danny Mayer's avatar
Danny Mayer committed
1
/*
2
 * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
Danny Mayer's avatar
Danny Mayer committed
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.
Danny Mayer's avatar
Danny Mayer committed
10 11 12 13 14 15 16 17
 */

/*
 * win32 configuration file
 * All definitions, declarations, macros and includes are
 * specific to the requirements of the Windows NT and Windows 2000
 * platforms
 */
18 19 20 21 22 23 24

/* Define to empty if the keyword does not work.  */
/* #undef const */

/* Define as __inline if that's what the C compiler calls it.  */
#define inline __inline

25
/* Define to `unsigned int/__int64' if <sys/types.h> doesn't define.  */
26 27
/* #undef size_t */

Danny Mayer's avatar
Danny Mayer committed
28 29 30 31 32
/*
 * ANSI C compliance enabled
 */
#define __STDC__ 1

Mark Andrews's avatar
Mark Andrews committed
33 34 35 36 37 38 39 40
/*
 * Silence compiler warnings about using strcpy and friends.
 */
#define _CRT_SECURE_NO_DEPRECATE 1

/*
 * Use 32 bit time.
 */
41
#ifndef _WIN64
Mark Andrews's avatar
Mark Andrews committed
42
#define _USE_32BIT_TIME_T 1
43
#endif
Mark Andrews's avatar
Mark Andrews committed
44

Danny Mayer's avatar
Danny Mayer committed
45
/*
46
 * Minimum version is Windows 8 and Windows Server 2012
Danny Mayer's avatar
Danny Mayer committed
47
 */
48
#ifndef _WIN32_WINNT
49
#define _WIN32_WINNT 0x0602
50
#endif
51 52
#if _WIN32_WINNT < 0x0602
#error Minimum Target environment is Windows 8 and Windows Server 2012
53 54
#endif
#ifndef NTDDI_VERSION
55
#define NTDDI_VERSION 0x06020000
56
#endif
57 58
#if NTDDI_VERSION < 0x06020000
#error Minimum Target environment is Windows 8 and Windows Server 2012
59
#endif
60

61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
/* Define if you have the ANSI C header files.  */
#define STDC_HEADERS 1

/* Define if you can safely include both <sys/time.h> and <time.h>.  */
#define TIME_WITH_SYS_TIME 1

/* define on DEC OSF to enable 4.4BSD style sa_len support */
/* #undef _SOCKADDR_LEN */

/* define if your system has sigwait() */
/* #undef HAVE_SIGWAIT */

/* define on Solaris to get sigwait() to work using pthreads semantics */
/* #undef _POSIX_PTHREAD_SEMANTICS */

/* define if you need to #define _XPG4_2 before including sys/socket.h */
/* #undef NEED_XPG4_2_BEFORE_SOCKET_H */

/* define if you need to #define _XOPEN_SOURCE_ENTENDED before including
 * sys/socket.h
 */
/* #undef NEED_XSE_BEFORE_SOCKET_H */

/* Define if you have the <fcntl.h> header file.  */
#define HAVE_FCNTL_H 1

/* Define if you have the <sys/sockio.h> header file.  */
#define HAVE_SYS_SOCKIO_H 1

/* Define if you have the <sys/time.h> header file.  */
#define HAVE_SYS_TIME_H 1

/* Define if you have the <unistd.h> header file.  */
#define HAVE_UNISTD_H 1

/* Define if you have the c_r library (-lc_r).  */
/* #undef HAVE_LIBC_R */

/* Define if you have the nsl library (-lnsl).  */
/* #undef HAVE_LIBNSL */

/* Define if you have the pthread library (-lpthread).  */
/* #undef HAVE_LIBPTHREAD */

/* Define if you have the socket library (-lsocket).  */
/* #undef HAVE_LIBSOCKET */

Danny Mayer's avatar
Danny Mayer committed
108 109 110
/* Define if you have h_errno */
#define HAVE_H_ERRNO

111 112 113 114 115
/* Define if you have getpassphrase in the C library. */
#define HAVE_GETPASSPHRASE

char *getpassphrase(const char *);

116 117 118 119 120 121 122
/*
 * Define to 1 if you want to use the DLZ "dlopen" driver
 * (which has the same name on windows even though it uses
 * LoadLibrary() instead of dlopen()).
 */
#define ISC_DLZ_DLOPEN 1

Danny Mayer's avatar
Danny Mayer committed
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
#define S_IFMT   _S_IFMT         /* file type mask */
#define S_IFDIR  _S_IFDIR        /* directory */
#define S_IFCHR  _S_IFCHR        /* character special */
#define S_IFIFO  _S_IFIFO        /* pipe */
#define S_IFREG  _S_IFREG        /* regular */
#define S_IREAD  _S_IREAD        /* read permission, owner */
#define S_IWRITE _S_IWRITE       /* write permission, owner */
#define S_IEXEC  _S_IEXEC        /* execute/search permission, owner */

#define O_RDONLY        _O_RDONLY
#define O_WRONLY        _O_WRONLY
#define O_RDWR          _O_RDWR
#define O_APPEND        _O_APPEND
#define O_CREAT         _O_CREAT
#define O_TRUNC         _O_TRUNC
#define O_EXCL          _O_EXCL

Danny Mayer's avatar
Danny Mayer committed
140
/* open() under unix allows setting of read/write permissions
Danny Mayer's avatar
Danny Mayer committed
141
 * at the owner, group and other levels.  These don't exist in NT
142
 * We'll just map them all to the NT equivalent
Danny Mayer's avatar
Danny Mayer committed
143 144 145 146 147 148 149 150 151 152
 */

#define S_IRUSR _S_IREAD	/* Owner read permission */
#define S_IWUSR _S_IWRITE	/* Owner write permission */
#define S_IRGRP _S_IREAD	/* Group read permission */
#define S_IWGRP _S_IWRITE	/* Group write permission */
#define S_IROTH _S_IREAD	/* Other read permission */
#define S_IWOTH _S_IWRITE	/* Other write permission */


153 154 155
/*
 * WIN32 specials until some other way of dealing with these is decided.
 */
Danny Mayer's avatar
Danny Mayer committed
156

157
#if _MSC_VER < 1900
Danny Mayer's avatar
Danny Mayer committed
158
#define snprintf _snprintf
159
#endif
160 161 162
#if _MSC_VER < 1800
#error Use Visual Studio 2013 or later for %zu support.
#endif
163
#if _MSC_VER <= 1400
Danny Mayer's avatar
Danny Mayer committed
164
#define vsnprintf _vsnprintf
165
#endif
Danny Mayer's avatar
Danny Mayer committed
166 167 168 169 170
#define strcasecmp  _stricmp
#define strncasecmp _strnicmp
#define strdup _strdup
#define sopen _sopen
#define isascii __isascii
171
#ifndef _WIN64
Danny Mayer's avatar
Danny Mayer committed
172 173
#define stat _stat
#define fstat _fstat
174 175 176 177
#else
#define stat _stat64
#define fstat _fstat64
#endif
Danny Mayer's avatar
Danny Mayer committed
178 179 180 181
#define fileno _fileno
#define unlink _unlink
#define chdir _chdir
#define mkdir _mkdir
182
#define rmdir _rmdir
Danny Mayer's avatar
Danny Mayer committed
183 184 185
#define getcwd _getcwd
#define utime _utime
#define utimbuf _utimbuf
186
#ifndef _WIN64
187
#define lseek _lseek
188 189 190
#else
#define lseek _lseeki64
#endif
Danny Mayer's avatar
Danny Mayer committed
191

192
/* #define EAFNOSUPPORT EINVAL */
Danny Mayer's avatar
Danny Mayer committed
193 194 195 196 197
#define chmod _chmod
#define getpid _getpid
#define getppid _getpid	/* WARNING!!! For now this gets the same pid */
#define random rand	/* Random number generator */
#define srandom srand	/* Random number generator seeding */
198 199 200
/* for the config file */
typedef unsigned int    uid_t;          /* user id */
typedef unsigned int    gid_t;          /* group id */
Danny Mayer's avatar
Danny Mayer committed
201
typedef long pid_t;			/* PID */
202
#ifndef _WIN64
Danny Mayer's avatar
Danny Mayer committed
203 204
typedef int ssize_t;
typedef long off_t;
205 206 207 208 209 210 211
#else
typedef __int64 ssize_t;
#ifndef _AFX
/* BINDInstall defines it with another type but doesn't use it */
typedef __int64 off_t;
#endif
#endif
Danny Mayer's avatar
Danny Mayer committed
212 213

/*
Danny Mayer's avatar
Danny Mayer committed
214
 * Set up the Version Information
Danny Mayer's avatar
Danny Mayer committed
215 216 217 218 219 220 221
 */
#include <versions.h>

#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>

Danny Mayer's avatar
Danny Mayer committed
222 223 224 225 226 227 228
/*
 * Applications may need to get the configuration path
 */
#ifndef _USRDLL
#include <isc/ntpaths.h>
#endif

Danny Mayer's avatar
Danny Mayer committed
229 230 231 232 233
#define fdopen	_fdopen
#define read	_read
#define open	_open
#define close	_close
#define write	_write
234
#include <io.h>
235
#define isatty	_isatty
Danny Mayer's avatar
Danny Mayer committed
236 237 238 239 240 241 242 243 244 245 246 247

#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h */
#endif

/*
 * Make the number of available sockets large
 * The number of sockets needed can get large and memory's cheap
 * This must be defined before winsock2.h gets included as the
 * macro is used there.
 */

248
#ifndef FD_SETSIZE
Danny Mayer's avatar
Danny Mayer committed
249
#define FD_SETSIZE 16384
250
#endif
Danny Mayer's avatar
Danny Mayer committed
251
#include <windows.h>
Mark Andrews's avatar
Mark Andrews committed
252 253

/*
254 255 256 257 258 259
 * main() is hooked
 */
#define ISC_MAIN_HOOK 1

/*
 * Configure sensible arguments
Mark Andrews's avatar
Mark Andrews committed
260
 */
261
@CONFIGARGS@
262 263 264 265

/*
 * Define if libxml2 is present
 */
266
@HAVE_LIBXML2@
267

268 269 270
/* Define to enable "rrset-order fixed" syntax. */
@DNS_RDATASET_FIXED@

271 272 273 274 275 276
/* Define if OpenSSL includes Ed25519 support */
@HAVE_OPENSSL_ED25519@

/* Define if OpenSSL includes Ed448 support */
@HAVE_OPENSSL_ED448@

277 278 279 280 281 282 283 284 285
/* Define if your OpenSSL version supports DH functions. */
@HAVE_DH_GET0_KEY@

/* Define if your OpenSSL version supports ECDSA functions. */
@HAVE_ECDSA_SIG_GET0@

/* Define if your OpenSSL version supports RSA functions. */
@HAVE_RSA_SET0_KEY@

286 287 288
/* define if OpenSSL is used for Public-Key Cryptography */
@USE_OPENSSL@

289
/* Define if native PKCS#11 is used as cryptographic library provider */
Ondřej Surý's avatar
Ondřej Surý committed
290
@USE_PKCS11@
291

292 293 294 295 296 297
/* Define if your PKCS11 provider supports Ed25519. */
@HAVE_PKCS11_ED25519@

/* Define if your PKCS11 provider supports Ed448. */
@HAVE_PKCS11_ED448@

298 299 300
/* HMAC_*() return ints */
@HMAC_RETURN_INT@

301 302 303
/* Define to 1 if you have the `readline' function. */
@HAVE_READLINE@

304 305 306
/* Build with GeoIP2 support */
@HAVE_GEOIP2@

307 308 309
/* define if idnkit support is to be included. */
@WITH_IDN@

310 311 312
/* Define if zlib was found */
@HAVE_ZLIB@

313 314 315
/* From enable developer */
@ISC_LIST_CHECKINIT@

316 317 318
/* Large system tuning */
@TUNE_LARGE@

319 320 321
/* define if we can use backtrace */
@USE_BACKTRACE@

322 323 324
/* the default value of dnssec-validation option */
@VALIDATION_DEFAULT@

325 326 327
/* Verbose query trace logging */
@WANT_QUERYTRACE@

328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357
/* Define to 1 if you have the `CRYPTO_zalloc' function. */
@HAVE_CRYPTO_ZALLOC@

/* Define to 1 if you have the `EVP_CIPHER_CTX_free' function. */
@HAVE_EVP_CIPHER_CTX_FREE@

/* Define to 1 if you have the `EVP_CIPHER_CTX_new' function. */
@HAVE_EVP_CIPHER_CTX_NEW@

/* Define to 1 if you have the `EVP_MD_CTX_free' function. */
@HAVE_EVP_MD_CTX_FREE@

/* Define to 1 if you have the `EVP_MD_CTX_new' function. */
@HAVE_EVP_MD_CTX_NEW@

/* Define to 1 if you have the `EVP_MD_CTX_reset' function. */
@HAVE_EVP_MD_CTX_RESET@

/* Define to 1 if you have the `HMAC_CTX_free' function. */
@HAVE_HMAC_CTX_FREE@

/* Define to 1 if you have the `HMAC_CTX_get_md' function. */
@HAVE_HMAC_CTX_GET_MD@

/* Define to 1 if you have the `HMAC_CTX_new' function. */
@HAVE_HMAC_CTX_NEW@

/* Define to 1 if you have the `HMAC_CTX_reset' function. */
@HAVE_HMAC_CTX_RESET@

358 359 360 361 362 363 364 365 366 367 368
/*
 * Define to nothing if C supports flexible array members, and to 1 if it does
 * not. That way, with a declaration like `struct s { int n; double
 * d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
 * compilers. When computing the size of such an object, don't use 'sizeof
 * (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
 * instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
 * MSVC and with C++ compilers.
 */
#define FLEXIBLE_ARRAY_MEMBER /**/

369 370 371 372
/* Avoid warnings with strlen() */
#ifdef _WIN64
#define strlen(x)	(unsigned int) strlen(x)
#endif
373 374 375

/* Get SRCID */
#include "srcid.h"