xmlrpc_config.h.in 5.8 KB

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