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