2
0

xmlrpc_win32_config.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /* Win32 version of xmlrpc_config.h.
  2. For other platforms, this is generated automatically, but for Windows,
  3. someone generates it manually. Nonetheless, we keep it looking as much
  4. as possible like the automatically generated one to make it easier to
  5. maintain (e.g. you can compare the two and see why something builds
  6. differently for Windows than for some other platform).
  7. The purpose of this file is to define stuff particular to the build
  8. environment being used to build Xmlrpc-c. Xmlrpc-c source files can
  9. #include this file and have build-environment-independent source code.
  10. A major goal of this file is to reduce conditional compilation in
  11. the other source files as much as possible. Even more, we want to avoid
  12. having to generate source code particular to a build environment
  13. except in this file.
  14. This file is NOT meant to be used by any code outside of the
  15. Xmlrpc-c source tree. There is a similar file that gets installed
  16. as <xmlrpc-c/config.h> that performs the same function for Xmlrpc-c
  17. interface header files that get compiled as part of a user's program.
  18. Logical macros are 0 or 1 instead of the more traditional defined and
  19. undefined. That's so we can distinguish when compiling code between
  20. "false" and some problem with the code.
  21. */
  22. #ifndef XMLRPC_CONFIG_H_INCLUDED
  23. #define XMLRPC_CONFIG_H_INCLUDED
  24. /* From xmlrpc_amconfig.h */
  25. #define HAVE__STRICMP 1
  26. #define HAVE__STRTOUI64 1
  27. /* Name of package */
  28. #define PACKAGE "xmlrpc-c"
  29. /*----------------------------------*/
  30. #ifndef HAVE_SETGROUPS
  31. #define HAVE_SETGROUPS 0
  32. #endif
  33. #ifndef HAVE_ASPRINTF
  34. #define HAVE_ASPRINTF 0
  35. #endif
  36. #ifndef HAVE_SETENV
  37. #define HAVE_SETENV 0
  38. #endif
  39. #ifndef HAVE_PSELECT
  40. #define HAVE_PSELECT 0
  41. #endif
  42. #ifndef HAVE_WCSNCMP
  43. #define HAVE_WCSNCMP 1
  44. #endif
  45. #ifndef HAVE_GETTIMEOFDAY
  46. #define HAVE_GETTIMEOFDAY 0
  47. #endif
  48. #ifndef HAVE_LOCALTIME_R
  49. #define HAVE_LOCALTIME_R 0
  50. #endif
  51. #ifndef HAVE_GMTIME_R
  52. #define HAVE_GMTIME_R 0
  53. #endif
  54. #ifndef HAVE_STRCASECMP
  55. #define HAVE_STRCASECMP 0
  56. #endif
  57. #ifndef HAVE_STRICMP
  58. #define HAVE_STRICMP 0
  59. #endif
  60. #ifndef HAVE__STRICMP
  61. #define HAVE__STRICMP 0
  62. #endif
  63. #define HAVE_WCHAR_H 1
  64. #define HAVE_SYS_FILIO_H 0
  65. #define HAVE_SYS_IOCTL_H 0
  66. #define HAVE_SYS_SELECT_H 0
  67. #define VA_LIST_IS_ARRAY 0
  68. #define HAVE_LIBWWW_SSL 0
  69. /* Used to mark an unused function parameter */
  70. #define ATTR_UNUSED
  71. #define DIRECTORY_SEPARATOR "\\"
  72. #define HAVE_UNICODE_WCHAR 1
  73. /* Xmlrpc-c code uses __inline__ to declare functions that should
  74. be compiled as inline code. GNU C recognizes the __inline__ keyword.
  75. Others recognize 'inline' or '__inline' or nothing at all to say
  76. a function should be inlined.
  77. We could make 'configure' simply do a trial compile to figure out
  78. which one, but for now, this approximation is easier:
  79. */
  80. #if (!defined(__GNUC__))
  81. #if (!defined(__inline__))
  82. #if (defined(__sgi) || defined(_AIX) || defined(_MSC_VER))
  83. #define __inline__ __inline
  84. #else
  85. #define __inline__
  86. #endif
  87. #endif
  88. #endif
  89. /* MSVCRT means we're using the Microsoft Visual C++ runtime library */
  90. #ifdef _MSC_VER
  91. /* The compiler is Microsoft Visual C++. */
  92. #define MSVCRT _MSC_VER
  93. #else
  94. #define MSVCRT 0
  95. #endif
  96. #if MSVCRT
  97. /* The MSVC runtime library _does_ have a 'struct timeval', but it is
  98. part of the Winsock interface (along with select(), which is probably
  99. its intended use), so isn't intended for use for general timekeeping.
  100. */
  101. #define HAVE_TIMEVAL 0
  102. #define HAVE_TIMESPEC 0
  103. #else
  104. #define HAVE_TIMEVAL 1
  105. /* timespec is Posix.1b. If we need to work on a non-Posix.1b non-Windows
  106. system, we'll have to figure out how to make Configure determine this.
  107. */
  108. #define HAVE_TIMESPEC 1
  109. #endif
  110. #if MSVCRT
  111. #define HAVE_WINDOWS_THREAD 1
  112. #else
  113. #define HAVE_WINDOWS_THREAD 0
  114. #endif
  115. /* Some people have and use pthreads on Windows. See
  116. http://sourceware.org/pthreads-win32 . For that case, we can set
  117. HAVE_PTHREAD to 1. The builder prefers to use pthreads if it has
  118. a choice.
  119. */
  120. #define HAVE_PTHREAD 0
  121. /* Note that the return value of XMLRPC_VSNPRINTF is int on Windows,
  122. ssize_t on POSIX.
  123. */
  124. #if MSVCRT
  125. #define XMLRPC_VSNPRINTF _vsnprintf
  126. #else
  127. #define XMLRPC_VSNPRINTF vsnprintf
  128. #endif
  129. #if MSVCRT
  130. #define HAVE_REGEX 0
  131. #else
  132. #define HAVE_REGEX 1
  133. #endif
  134. #if MSVCRT
  135. #define XMLRPC_SOCKETPAIR xmlrpc_win32_socketpair
  136. #define XMLRPC_CLOSESOCKET closesocket
  137. #else
  138. #define XMLRPC_SOCKETPAIR socketpair
  139. #define XMLRPC_CLOSESOCKET close
  140. #endif
  141. #if defined(_MSC_VER) && (_MSC_VER >= 1400)
  142. /* Starting with MSVC 8, the runtime library defines various POSIX functions
  143. such as strdup() whose names violate the ISO C standard (the standard
  144. says the strXXX names are reserved for the standard), but warns you of
  145. the standards violation. That warning is 4996, along with other warnings
  146. that tell you you're using a function that Microsoft thinks you
  147. shouldn't.
  148. Well, POSIX is more important than that element of ISO C, so we disable
  149. that warning.
  150. FYI, msvcrt also defines _strdup(), etc, which doesn't violate the
  151. naming standard. But since other environments don't define _strdup(),
  152. we can't use it in portable code.
  153. */
  154. #pragma warning(disable:4996)
  155. #endif
  156. /* Warning C4090 is "different 'const' qualifiers".
  157. We disable this warning because MSVC erroneously issues it when there is
  158. in fact no difference in const qualifiers:
  159. const char ** p;
  160. void * q;
  161. q = p;
  162. Note that both p and q are pointers to non-const.
  163. We have seen this in MSVC 7.1, 8, and 9 (but not 6).
  164. */
  165. #pragma warning(disable:4090)
  166. #if HAVE_STRTOLL
  167. # define XMLRPC_STRTOLL strtoll
  168. #elif HAVE_STRTOQ
  169. # define XMLRPC_STRTOLL strtoq /* Interix */
  170. #elif HAVE___STRTOLL
  171. # define XMLRPC_STRTOLL __strtoll /* HP-UX <= 11.11 */
  172. #elif HAVE__STRTOUI64
  173. #define XMLRPC_STRTOLL _strtoui64 /* Windows MSVC */
  174. #endif
  175. #if HAVE_STRTOULL
  176. # define XMLRPC_STRTOULL strtoull
  177. #elif HAVE_STRTOUQ
  178. # define XMLRPC_STRTOULL strtouq /* Interix */
  179. #elif HAVE___STRTOULL
  180. # define XMLRPC_STRTOULL __strtoull /* HP-UX <= 11.11 */
  181. #elif HAVE__STRTOUI64
  182. #define XMLRPC_STRTOULL _strtoui64 /* Windows MSVC */
  183. #endif
  184. #if _MSC_VER < 1900
  185. #define snprintf _snprintf
  186. #endif
  187. #define popen _popen
  188. #endif