Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / sntp / libopts / compat / windows-config.h
blob22fa131b754e3eb5fe631ce0b840ef630f1ef017
1 /* $NetBSD$ */
4 /*
5 * Time-stamp: "2006-10-14 14:55:09 bkorb"
6 * by: bkorb
7 * Last Committed: $Date: 2007/06/24 15:51:26 $
8 */
9 #ifndef WINDOWS_CONFIG_HACKERY
10 #define WINDOWS_CONFIG_HACKERY 1
13 * The definitions below have been stolen from NTP's config.h for Windows.
14 * However, they may be kept here in order to keep libopts independent from
15 * the NTP project.
17 #ifndef __windows__
18 # define __windows__ 4
19 #endif
22 * Miscellaneous functions that Microsoft maps
23 * to other names
25 * #define inline __inline
26 * #define vsnprintf _vsnprintf
28 #define snprintf _snprintf
30 * #define stricmp _stricmp
31 * #define strcasecmp _stricmp
32 * #define isascii __isascii
33 * #define finite _finite
34 * #define random rand
35 * #define srandom srand
38 #define SIZEOF_INT 4
39 #define SIZEOF_CHARP 4
40 #define SIZEOF_LONG 4
41 #define SIZEOF_SHORT 2
43 typedef unsigned long uintptr_t;
46 * # define HAVE_NET_IF_H
47 * # define QSORT_USES_VOID_P
48 * # define HAVE_SETVBUF
49 * # define HAVE_VSPRINTF
50 * # define HAVE_SNPRINTF
51 * # define HAVE_VSNPRINTF
52 * # define HAVE_PROTOTYPES /* from ntpq.mak * /
53 * # define HAVE_MEMMOVE
54 * # define HAVE_TERMIOS_H
55 * # define HAVE_ERRNO_H
56 * # define HAVE_STDARG_H
57 * # define HAVE_NO_NICE
58 * # define HAVE_MKTIME
59 * # define TIME_WITH_SYS_TIME
60 * # define HAVE_IO_COMPLETION_PORT
61 * # define ISC_PLATFORM_NEEDNTOP
62 * # define ISC_PLATFORM_NEEDPTON
63 * # define NEED_S_CHAR_TYPEDEF
64 * # define USE_PROTOTYPES /* for ntp_types.h * /
66 * #define ULONG_CONST(a) a ## UL
69 #define HAVE_LIMITS_H 1
70 #define HAVE_STRDUP 1
71 #define HAVE_STRCHR 1
72 #define HAVE_FCNTL_H 1
75 * VS.NET's version of wspiapi.h has a bug in it
76 * where it assigns a value to a variable inside
77 * an if statement. It should be comparing them.
78 * We prevent inclusion since we are not using this
79 * code so we don't have to see the warning messages
81 #ifndef _WSPIAPI_H_
82 #define _WSPIAPI_H_
83 #endif
85 /* Prevent inclusion of winsock.h in windows.h */
86 #ifndef _WINSOCKAPI_
87 #define _WINSOCKAPI_
88 #endif
90 #ifndef __RPCASYNC_H__
91 #define __RPCASYNC_H__
92 #endif
94 /* Include Windows headers */
95 #include <windows.h>
96 #include <winsock2.h>
97 #include <limits.h>
100 * Compatibility declarations for Windows, assuming SYS_WINNT
101 * has been defined.
103 #define strdup _strdup
104 #define stat _stat /* struct stat from <sys/stat.h> */
105 #define unlink _unlink
106 #define fchmod( _x, _y );
107 #define ssize_t SSIZE_T
109 #include <io.h>
110 #define open _open
111 #define close _close
112 #define read _read
113 #define write _write
114 #define lseek _lseek
115 #define pipe _pipe
116 #define dup2 _dup2
118 #define O_RDWR _O_RDWR
119 #define O_RDONLY _O_RDONLY
120 #define O_EXCL _O_EXCL
122 #ifndef S_ISREG
123 # define S_IFREG _S_IFREG
124 # define S_ISREG(mode) (((mode) & S_IFREG) == S_IFREG)
125 #endif
127 #ifndef S_ISDIR
128 # define S_IFDIR _S_IFDIR
129 # define S_ISDIR(mode) (((mode) & S_IFDIR) == S_IFDIR)
130 #endif
132 #endif /* WINDOWS_CONFIG_HACKERY */