7
* For newer compilers we may we want newer prototypes from Windows
8
* so we target _WIN32_WINNT at WINXP, but we also want our binary to
9
* run on NT 4, so newer functions are runtime linked and the linker
10
* /version:0x0400 * switch is used to override the .exe file minimum
11
* version. For older compilers we leave it at NT 4.0.
14
#if _MSC_VER > 1400 /* At least VS 2005 */
15
#define _WIN32_WINNT 0x0501
17
#define _WIN32_WINNT 0x0400
22
#define _CRT_SECURE_NO_DEPRECATE 1
24
* ANSI C compliance enabled
29
* We need to include string.h first before we override strerror
30
* otherwise we can get errors during the build
35
* We need to include stdio.h first before we #define snprintf
36
* otherwise we can get errors during the build
40
/* Prevent inclusion of winsock.h in windows.h */
45
#ifndef __RPCASYNC_H__
46
#define __RPCASYNC_H__
50
* VS.NET's version of wspiapi.h has a bug in it
51
* where it assigns a value to a variable inside
52
* an if statement. It should be comparing them.
53
* We prevent inclusion since we are not using this
54
* code so we don't have to see the warning messages
57
/* #define _WSPIAPI_H_ */ /* need these wrappers for ntpd.exe to load on w2k */
60
/* Include Windows headers */
66
* Some definitions we are using are missing in the headers
67
* shipping with VC6. However, if the SDK is installed then the
68
* SDK's headers may declare the missing types. This is at least
69
* the case in the Oct 2001 SDK. That SDK and all subsequent
70
* versions also define the symbol _W64, so we can use that one
71
* to determine whether some types need to be defined, or not.
74
/* VC6 can include wspiapi.h only if the SDK is installed */
78
/* #include <runtimelink.h> */ /* must come after ws2tcpip.h */
82
/* ---------------------------------------------------------------------
83
* Above this line are #include lines and the few #define lines
84
* needed before including headers.
10
* For VS.NET most of the IPv6 types and structures are defined
91
* For VS.NET most of the IPv6 types and structures are defined.
92
* This should depend on the contrents of the available headers,
93
* not on the compiler version.
95
#if defined _MSC_VER && _MSC_VER > 1200
13
96
#define HAVE_STRUCT_SOCKADDR_STORAGE
14
97
#define ISC_PLATFORM_HAVEIPV6
15
98
#define ISC_PLATFORM_HAVEIN6PKTINFO
16
99
#define NO_OPTION_NAME_WARNINGS
18
typedef int socklen_t; /* VS 6.0 doesn't know about socklen_t */
22
* Some types don't exist in VS V6
25
typedef unsigned int uintptr_t;
103
/* VC6 doesn't know about socklen_t, except if the SDK is installed */
104
typedef int socklen_t;
28
107
#define ISC_PLATFORM_NEEDIN6ADDRANY
33
112
* is int for VS compilers on Windows but the type is already declared
35
114
#define GETSOCKNAME_SOCKLEN_TYPE socklen_t
116
#if defined _MSC_VER && _MSC_VER < 1400
118
* Use 32-bit time definitions for versions prior to VS 2005
119
* VS 2005 defaults to 64-bit time
121
# define SIZEOF_TIME_T 4
123
# define SIZEOF_TIME_T 8
37
128
* An attempt to cut down the number of warnings generated during compilation.
38
129
* All of these should be benign to disable.
48
140
#if defined _DEBUG /* Use VC standard macro definitions */
51
#if !defined _WIN32_WINNT || _WIN32_WINNT < 0x0400
52
# error Please define _WIN32_WINNT in the project settings/makefile
55
144
#define __windows__ 1
57
* ANSI C compliance enabled
60
145
/* Define if you have the ANSI C header files. */
61
146
#define STDC_HEADERS 1
63
/* Prevent inclusion of winsock.h in windows.h */
68
#ifndef __RPCASYNC_H__
69
#define __RPCASYNC_H__
73
* VS.NET's version of wspiapi.h has a bug in it
74
* where it assigns a value to a variable inside
75
* an if statement. It should be comparing them.
76
* We prevent inclusion since we are not using this
77
* code so we don't have to see the warning messages
83
#define OPEN_BCAST_SOCKET 1 /* for ntp_io.c */
84
#define TYPEOF_IP_MULTICAST_LOOP BOOL
85
#define SETSOCKOPT_ARG_CAST (const char *)
148
#define OPEN_BCAST_SOCKET 1 /* for ntp_io.c */
149
#define TYPEOF_IP_MULTICAST_LOOP BOOL
150
#define SETSOCKOPT_ARG_CAST (const char *)
86
151
#define HAVE_RANDOM
87
#define MAXHOSTNAMELEN 64
152
#define MAXHOSTNAMELEN 64
91
156
* Multimedia timer enable
93
158
#define USE_MM_TIMER
95
* Use 32-bit time definitions
96
* VS 2005 defaults to 64-bit time
97
* Leave commented out for now
99
//#define _USE_32BIT_TIME_T
101
160
/* Enable OpenSSL */
102
161
#define OPENSSL 1
105
* Include standard stat information
107
#include <isc/stat.h>
109
* Miscellaneous functions that Microsoft maps
164
* Keywords and functions that Microsoft maps
112
#define inline __inline
113
#define vsnprintf _vsnprintf
114
#define snprintf _snprintf
115
#define stricmp _stricmp
116
#define strcasecmp _stricmp
117
#define isascii __isascii
118
#define finite _finite
120
#define srandom srand
121
#define fdopen _fdopen
126
#define strdup _strdup
127
#define stat _stat /* struct stat from <sys/stat.h> */
128
#define unlink _unlink
129
#define fchmod( _x, _y );
133
#define sleep(x) Sleep((DWORD) x * 1000 /* milliseconds */ );
167
#define inline __inline
168
#define vsnprintf _vsnprintf
169
#define snprintf _snprintf
170
#define stricmp _stricmp
171
#define strcasecmp _stricmp
172
#define isascii __isascii
173
#define finite _finite
175
#define srandom srand
176
#define fdopen _fdopen
183
#define strdup _strdup
184
#define stat _stat /*struct stat from <sys/stat.h> */
185
#define unlink _unlink
187
* punt on fchmod on Windows
189
#define fchmod(x,y) {}
194
* scale, unix sleep is seconds, Windows Sleep is msec
196
#define sleep(x) Sleep((unsigned)(x) * 1000)
197
#define fileno _fileno
198
#define isatty _isatty
199
#define mktemp _mktemp
200
#define getpid _getpid
135
#define pid_t int /* PID is an int */
136
#define ssize_t int /* ssize is an int */
202
typedef int pid_t; /* PID is an int */
203
typedef int ssize_t; /* ssize is an int */
137
204
typedef __int32 int32_t; /* define a typedef for int32_t */
138
205
#define HAVE_INT32_T 1
143
210
#define STDOUT_FILENO _fileno(stdout)
144
211
#define STDERR_FILENO _fileno(stderr)
147
* We need to include string.h first before we override strerror
148
* otherwise we can get errors during the build
151
213
/* Point to a local version for error string handling */
152
214
# define strerror NTstrerror
154
215
char *NTstrerror(int errnum);
156
217
int NT_set_process_priority(void); /* Define this function */
161
222
# define REFCLOCK /* from ntpd.mak */
163
224
# define CLOCK_LOCAL /* from ntpd.mak */
164
//# define CLOCK_PARSE
225
/* # define CLOCK_PARSE */
165
226
/* # define CLOCK_ATOM */
227
/* # define HAVE_TIMEPPS_H */
228
/* # define HAVE_PPSAPI */
166
229
/* # define CLOCK_SHM */ /* from ntpd.mak */
167
230
# define CLOCK_HOPF_SERIAL /* device 38, hopf DCF77/GPS serial line receiver */
168
231
# define CLOCK_HOPF_PCI /* device 39, hopf DCF77/GPS PCI-Bus receiver */
177
240
# define NTP_POSIX_SOURCE
179
242
# define SYSLOG_FILE /* from libntp.mak */
180
# define SYSV_TIMEOFDAY /* for ntp_unixtime.h */
182
# define SIZEOF_SIGNED_CHAR 1
183
# define SIZEOF_TIME_T 4
184
# define SIZEOF_INT 4 /* for ntp_types.h */
186
//# define HAVE_NET_IF_H
243
# define SYSV_TIMEOFDAY /* for ntp_unixtime.h */
245
# define SIZEOF_SIGNED_CHAR 1
246
# define SIZEOF_INT 4 /* for ntp_types.h */
187
248
# define QSORT_USES_VOID_P
188
249
# define HAVE_SETVBUF
189
250
# define HAVE_VSPRINTF
202
263
# define ISC_PLATFORM_NEEDPTON
203
264
# define HAVE_VPRINTF
205
#define HAVE_LIMITS_H 1
206
#define HAVE_STRDUP 1
207
#define HAVE_STRCHR 1
208
#define HAVE_FCNTL_H 1
211
# define NEED_S_CHAR_TYPEDEF
213
# define USE_PROTOTYPES /* for ntp_types.h */
266
#define HAVE_LIMITS_H 1
267
#define HAVE_STRDUP 1
268
#define HAVE_STRCHR 1
269
#define HAVE_FCNTL_H 1
271
#ifndef _INTPTR_T_DEFINED
272
typedef long intptr_t;
273
#define _INTPTR_T_DEFINED
275
#define HAVE_INTPTR_T
277
#ifndef _UINTPTR_T_DEFINED
278
typedef unsigned long uintptr_t;
279
#define _UINTPTR_T_DEFINED
281
#define HAVE_UINTPTR_T
285
* if DWORD_PTR needs to be defined then the build environment
286
* is pure 32 bit Windows. Since DWORD_PTR and DWORD have
287
* the same size in 32 bit Windows we can safely define
290
typedef DWORD DWORD_PTR;
293
#define NEED_S_CHAR_TYPEDEF
295
#define USE_PROTOTYPES /* for ntp_types.h */
297
/* Directory separator, usually / or \ */
215
301
#define ULONG_CONST(a) a ## UL
218
# define RETSIGTYPE void
220
# define STR_SYSTEM "WINDOWS/NT"
304
#define RETSIGTYPE void
307
#define STR_SYSTEM "Windows"
310
#ifndef STR_PROCESSOR
312
#define STRINGIZE(arg) #arg
316
#define STR_PROCESSOR "x86"
319
#define STR_PROCESSOR "x86"
322
#define STR_PROCESSOR "x86-FP-" STRINGIZE(_M_IX86_FP)
325
#define STR_PROCESSOR "x86-SSE2"
327
#define STR_PROCESSOR "x86-SSE"
328
#endif /* _M_IX86 == 2 */
329
#endif /* _M_IX86_FP > 2 */
330
#endif /* !_M_IX86_FP */
331
#endif /* !defined(_M_IX86_FP) */
332
#endif /* !defined(_M_IX86) */
335
#define STR_PROCESSOR "Itanium"
339
#define STR_PROCESSOR "x64"
342
#endif /* !defined(STR_PROCESSOR) */
222
344
#define SIOCGIFFLAGS SIO_GET_INTERFACE_LIST /* used in ntp_io.c */
224
/* Include Windows headers */
226
#include <winsock2.h>
228
#endif /* __config */
346
* Below this line are includes which must happen after the bulk of
347
* config.h is processed. If you need to add another #include to this
348
* file the preferred location is near the top, above the similar
350
* ---------------------------------------------------------------------
354
* Include standard stat information
356
#include <isc/stat.h>
358
#endif /* __CONFIG_H */