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