3 * \file windows-config.h
5 * This file contains all of the routines that must be linked into
6 * an executable to use the generated option processing. The optional
7 * routines are in separately compiled modules so that they will not
8 * necessarily be linked in.
10 * This file is part of AutoOpts, a companion to AutoGen.
11 * AutoOpts is free software.
12 * AutoOpts is Copyright (C) 1992-2015 by Bruce Korb - all rights reserved
14 * AutoOpts is available under any one of two licenses. The license
15 * in use must be one of these two and the choice is under the control
16 * of the user of the license.
18 * The GNU Lesser General Public License, version 3 or later
19 * See the files "COPYING.lgplv3" and "COPYING.gplv3"
21 * The Modified Berkeley Software Distribution License
22 * See the file "COPYING.mbsd"
24 * These files have the following sha256 sums:
26 * 8584710e9b04216a394078dc156b781d0b47e1729104d666658aecef8ee32e95 COPYING.gplv3
27 * 4379e7444a0e2ce2b12dd6f5a52a27a4d02d39d247901d3285c88cf0d37f477b COPYING.lgplv3
28 * 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
31 #ifndef WINDOWS_CONFIG_HACKERY
32 #define WINDOWS_CONFIG_HACKERY 1
35 * The definitions below have been stolen from NTP's config.h for Windows.
36 * However, they may be kept here in order to keep libopts independent from
40 # define __windows__ 4
44 * Miscellaneous functions that Microsoft maps to other names
46 #define snprintf _snprintf
49 #define SIZEOF_CHARP 4
51 #define SIZEOF_SHORT 2
53 #define HAVE_LIMITS_H 1
56 #define HAVE_FCNTL_H 1
59 * VS.NET's version of wspiapi.h has a bug in it where it assigns a value
60 * to a variable inside an if statement. It should be comparing them.
61 * We prevent inclusion since we are not using this code so we don't have
62 * to see the warning messages
68 /* Prevent inclusion of winsock.h in windows.h */
73 #ifndef __RPCASYNC_H__
74 #define __RPCASYNC_H__
77 /* Include Windows headers */
83 * Compatibility declarations for Windows, assuming SYS_WINNT
86 #define strdup _strdup
87 #define stat _stat /* struct stat from <sys/stat.h> */
88 #define unlink _unlink
89 #define fchmod( _x, _y )
90 #define ssize_t SSIZE_T
101 #define O_RDWR _O_RDWR
102 #define O_RDONLY _O_RDONLY
103 #define O_EXCL _O_EXCL
106 # define S_IFREG _S_IFREG
107 # define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG)
111 # define S_IFDIR _S_IFDIR
112 # define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR)
115 /* C99 exact size integer support. */
116 #if defined(HAVE_INTTYPES_H)
117 # include <inttypes.h>
119 #elif defined(HAVE_STDINT_H)
121 # define MISSING_INTTYPES_H 1
123 #elif ! defined(ADDED_EXACT_SIZE_INTEGERS)
124 # define ADDED_EXACT_SIZE_INTEGERS 1
125 # define MISSING_INTTYPES_H 1
127 typedef __int8 int8_t;
128 typedef unsigned __int8 uint8_t;
130 typedef __int16 int16_t;
131 typedef unsigned __int16 uint16_t;
133 typedef __int32 int32_t;
134 typedef unsigned __int32 uint32_t;
136 typedef __int64 int64_t;
137 typedef unsigned __int64 uint64_t;
139 typedef unsigned long uintptr_t;
140 typedef long intptr_t;
143 #endif /* WINDOWS_CONFIG_HACKERY */
144 /* windows-config.h ends here */