1 /* config.h--SASL configuration for win32
5 * Copyright (c) 1998-2004 Carnegie Mellon University. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in
16 * the documentation and/or other materials provided with the
19 * 3. The name "Carnegie Mellon University" must not be used to
20 * endorse or promote products derived from this software without
21 * prior written permission. For permission or any other legal
22 * details, please contact
23 * Office of Technology Transfer
24 * Carnegie Mellon University
26 * Pittsburgh, PA 15213-3890
27 * (412) 268-4387, fax: (412) 268-7395
28 * tech-transfer@andrew.cmu.edu
30 * 4. Redistributions of any form whatsoever must retain the following
32 * "This product includes software developed by Computing Services
33 * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
35 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
36 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
37 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
38 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
39 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
40 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
41 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
49 /* winsock2 includes windows.h.
50 Note that we can't include both winsock.h and winsock2.h as
55 #define PACKAGE "cyrus-sasl"
58 #define VERSION "2.1.23"
60 /* Visual Studio supports prototypes */
65 typedef unsigned char *caddr_t;
66 #define HAVE_CADDR_T 1
70 #ifndef _INTPTR_T_DEFINED
73 typedef __int64 intptr_t;
80 /* Registry key that contains the locations of the plugins */
81 #define SASL_ROOT_KEY "SOFTWARE\\Carnegie Mellon\\Project Cyrus\\SASL Library"
82 #define SASL_PLUGIN_PATH_ATTR "SearchPath"
83 #define SASL_CONF_PATH_ATTR "ConfFile"
85 /* : This should probably be replaced with a call to a function
86 : that gets the proper value from Registry */
87 #define SASL_DB_PATH "c:\\CMU\\sasldb2"
89 /* what db package are we using? */
90 /* #undef SASL_GDBM */
91 /* #undef SASL_NDBM */
92 #define SASL_BERKELEYDB 1
94 /* which mechs can we link staticly? */
95 #define STATIC_ANONYMOUS 1
96 #define STATIC_CRAMMD5 1
97 #define STATIC_DIGESTMD5 1
98 #define STATIC_GSSAPIV2 1
99 /* #undef STATIC_KERBEROS4 */
100 #define STATIC_LOGIN 1
101 /* #undef STATIC_MYSQL */
103 #define STATIC_PLAIN 1
104 #define STATIC_SASLDB 1
107 /* ------------------------------------------------------------ */
109 /* Things that are fetched via autoconf under Unix
111 #define HAVE_MEMCPY 1
113 #define PLUGINDIR "C:\\CMU\\bin\\sasl2"
114 #define CONFIGDIR "C:\\CMU\\bin\\sasl2"
116 /* Windows calls these functions something else
118 #define strcasecmp stricmp
119 #define snprintf _snprintf
120 #define strncasecmp strnicmp
122 #define MAXHOSTNAMELEN 1024
124 /* ------------------------------------------------------------ */
127 #define L_DEFAULT_GUARD (0)
128 #define I_DEFAULT_GUARD (0)
130 #define VL(foo) printf foo;
134 #define __attribute__(foo)
136 /* : Same as in tpipv6.h */
137 #ifndef HAVE_SOCKLEN_T
138 typedef int socklen_t;
139 #endif /* HAVE_SOCKLEN_T */
141 /* If we expect to run on XP and later, we have IPv6 support natively */
142 #if TARGET_WIN_SYSTEM >= 51
143 #if !defined(_WIN32_WINNT)
144 /* This forces the inclusion of OS supported functions, with no fallback */
145 #define _WIN32_WINNT 0x0510
149 #if defined(_MSC_VER) && (_MSC_VER >= 1300)
150 /* The following two defines will prevent our own definitions below */
151 #define HAVE_GETADDRINFO
152 #define HAVE_GETNAMEINFO
153 #define HAVE_STRUCT_SOCKADDR_STORAGE
154 /* Unless _WIN32_WINNT > 0x0500, Ws2tcpip.h will try to find OS provided
155 getaddrinfo at runtime. It will fallback to Microsoft emulation,
157 #include <Ws2tcpip.h>
160 #if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(_SS_MAXSIZE)
161 #define _SS_MAXSIZE 128 /* Implementation specific max size */
162 #define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
164 struct sockaddr_storage {
165 struct sockaddr ss_sa;
166 char __ss_pad2[_SS_PADSIZE];
168 # define ss_family ss_sa.sa_family
169 #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
172 /* Define it to something that should never appear */
173 #define AF_INET6 AF_MAX
176 #ifndef HAVE_GETADDRINFO
177 #define getaddrinfo sasl_getaddrinfo
178 #define freeaddrinfo sasl_freeaddrinfo
179 #define gai_strerror sasl_gai_strerror
182 #ifndef HAVE_GETNAMEINFO
183 #define getnameinfo sasl_getnameinfo
186 #if !defined(HAVE_GETNAMEINFO) || !defined(HAVE_GETADDRINFO)
190 #ifndef AI_NUMERICHOST /* support glibc 2.0.x */
191 #define AI_NUMERICHOST 4
192 #define NI_NUMERICHOST 2
193 #define NI_NAMEREQD 4
194 #define NI_NUMERICSERV 8
201 #define HIER_DELIMITER '\\'
204 #define sleep(seconds) plug_sleep(seconds)
205 unsigned int plug_sleep(unsigned int seconds);
208 #endif /* CONFIG_H */