config-win.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. /* config.h--SASL configuration for win32
  2. * Ryan Troll
  3. */
  4. /*
  5. * Copyright (c) 1998-2004 Carnegie Mellon University. All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. *
  11. * 1. Redistributions of source code must retain the above copyright
  12. * notice, this list of conditions and the following disclaimer.
  13. *
  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
  17. * distribution.
  18. *
  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
  25. * 5000 Forbes Avenue
  26. * Pittsburgh, PA 15213-3890
  27. * (412) 268-4387, fax: (412) 268-7395
  28. * tech-transfer@andrew.cmu.edu
  29. *
  30. * 4. Redistributions of any form whatsoever must retain the following
  31. * acknowledgment:
  32. * "This product includes software developed by Computing Services
  33. * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
  34. *
  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.
  42. */
  43. #ifndef CONFIG_H
  44. #define CONFIG_H
  45. #define _CRT_RAND_S
  46. #include <stddef.h>
  47. /* winsock2 includes windows.h.
  48. Note that we can't include both winsock.h and winsock2.h as
  49. they conflict */
  50. #include <winsock2.h>
  51. /* Our package */
  52. #define PACKAGE "cyrus-sasl"
  53. /* Our version */
  54. #define VERSION "2.1.28"
  55. /* Visual Studio supports prototypes */
  56. #define PROTOTYPES 1
  57. #ifndef HAVE_CADDR_T
  58. #ifndef caddr_t
  59. typedef unsigned char *caddr_t;
  60. #define HAVE_CADDR_T 1
  61. #endif
  62. #endif
  63. #ifndef _INTPTR_T_DEFINED
  64. #ifdef _WIN64
  65. typedef __int64 intptr_t;
  66. #else
  67. typedef int intptr_t;
  68. #endif
  69. #endif
  70. /* Registry key that contains the locations of the plugins */
  71. #define SASL_ROOT_KEY "SOFTWARE\\Carnegie Mellon\\Project Cyrus\\SASL Library"
  72. #define SASL_PLUGIN_PATH_ATTR "SearchPath"
  73. #define SASL_CONF_PATH_ATTR "ConfFile"
  74. /* : This should probably be replaced with a call to a function
  75. : that gets the proper value from Registry */
  76. #define SASL_DB_PATH "c:\\CMU\\sasldb2"
  77. /* what db package are we using? */
  78. /* #undef SASL_GDBM */
  79. /* #undef SASL_NDBM */
  80. /* #undef SASL_BERKELEYDB */
  81. /* which mechs can we link staticly? */
  82. #define STATIC_ANONYMOUS 1
  83. #define STATIC_CRAMMD5 1
  84. #define STATIC_DIGESTMD5 1
  85. #define STATIC_SCRAM 1
  86. #define STATIC_GSSAPIV2 1
  87. /* #undef STATIC_KERBEROS4 */
  88. #define STATIC_LOGIN 1
  89. /* #undef STATIC_MYSQL */
  90. #define STATIC_OTP 1
  91. #define STATIC_PLAIN 1
  92. #define STATIC_SASLDB 1
  93. #define STATIC_SRP 1
  94. /* ------------------------------------------------------------ */
  95. /* Things that are fetched via autoconf under Unix
  96. */
  97. #define HAVE_MEMCPY 1
  98. #define PLUGINDIR "C:\\CMU\\bin\\sasl2"
  99. #define CONFIGDIR "C:\\CMU\\bin\\sasl2"
  100. /* Windows calls these functions something else
  101. */
  102. #define strcasecmp stricmp
  103. #define strncasecmp strnicmp
  104. #define MAXHOSTNAMELEN 1024
  105. /* ------------------------------------------------------------ */
  106. #define WITHOUT_NANA
  107. #define L_DEFAULT_GUARD (0)
  108. #define I_DEFAULT_GUARD (0)
  109. #define I(foo)
  110. #define VL(foo) printf foo;
  111. #define VLP(foo,bar)
  112. #if !defined(__clang__)
  113. /* we're not gcc */
  114. #define __attribute__(foo)
  115. #endif
  116. /* : Same as in tpipv6.h */
  117. #ifndef HAVE_SOCKLEN_T
  118. typedef int socklen_t;
  119. #endif /* HAVE_SOCKLEN_T */
  120. /* If we expect to run on XP and later, we have IPv6 support natively */
  121. #if TARGET_WIN_SYSTEM >= 51
  122. #if !defined(_WIN32_WINNT)
  123. /* This forces the inclusion of OS supported functions, with no fallback */
  124. #define _WIN32_WINNT 0x0510
  125. #endif
  126. #endif
  127. #if defined(_MSC_VER) && (_MSC_VER >= 1300)
  128. /* The following two defines will prevent our own definitions below */
  129. #define HAVE_GETADDRINFO
  130. #define HAVE_GETNAMEINFO
  131. #define HAVE_STRUCT_SOCKADDR_STORAGE
  132. /* Unless _WIN32_WINNT > 0x0500, Ws2tcpip.h will try to find OS provided
  133. getaddrinfo at runtime. It will fallback to Microsoft emulation,
  134. if not found */
  135. #include <Ws2tcpip.h>
  136. #endif
  137. #if !defined(HAVE_STRUCT_SOCKADDR_STORAGE) && !defined(_SS_MAXSIZE)
  138. #define _SS_MAXSIZE 128 /* Implementation specific max size */
  139. #define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
  140. struct sockaddr_storage {
  141. struct sockaddr ss_sa;
  142. char __ss_pad2[_SS_PADSIZE];
  143. };
  144. # define ss_family ss_sa.sa_family
  145. #endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
  146. #ifndef AF_INET6
  147. /* Define it to something that should never appear */
  148. #define AF_INET6 AF_MAX
  149. #endif
  150. #ifndef HAVE_GETADDRINFO
  151. #define getaddrinfo sasl_getaddrinfo
  152. #define freeaddrinfo sasl_freeaddrinfo
  153. #define gai_strerror sasl_gai_strerror
  154. #endif
  155. #ifndef HAVE_GETNAMEINFO
  156. #define getnameinfo sasl_getnameinfo
  157. #endif
  158. #if !defined(HAVE_GETNAMEINFO) || !defined(HAVE_GETADDRINFO)
  159. #include "gai.h"
  160. #endif
  161. #ifndef AI_NUMERICHOST /* support glibc 2.0.x */
  162. #define AI_NUMERICHOST 4
  163. #define NI_NUMERICHOST 2
  164. #define NI_NAMEREQD 4
  165. #define NI_NUMERICSERV 8
  166. #endif
  167. #include <time.h>
  168. /* Keep in sync with SleepyCat definitions */
  169. typedef int int32_t;
  170. typedef __int64 int64_t;
  171. #ifdef _WIN64
  172. typedef int64_t ssize_t;
  173. #else
  174. typedef int32_t ssize_t;
  175. #endif
  176. #define HIER_DELIMITER '\\'
  177. #ifndef sleep
  178. #define sleep(seconds) plug_sleep(seconds)
  179. unsigned int plug_sleep(unsigned int seconds);
  180. #endif
  181. #define GCC_FALLTHROUGH
  182. #endif /* CONFIG_H */