Skip to content

Commit 68e6e4d

Browse files
committed
Changes to libxml.
1 parent 9bb5a87 commit 68e6e4d

File tree

4 files changed

+158
-31
lines changed

4 files changed

+158
-31
lines changed

config.h

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
#ifndef __LIBXML_WIN32_CONFIG__
2+
#define __LIBXML_WIN32_CONFIG__
3+
4+
#define HAVE_CTYPE_H
5+
#define HAVE_STDARG_H
6+
#define HAVE_MALLOC_H
7+
#define HAVE_ERRNO_H
8+
#define HAVE_STDINT_H
9+
10+
#if defined(_WIN32_WCE)
11+
#undef HAVE_ERRNO_H
12+
#include "wincecompat.h"
13+
#else
14+
#define HAVE_SYS_STAT_H
15+
#define HAVE__STAT
16+
#define HAVE_STAT
17+
#define HAVE_STDLIB_H
18+
#define HAVE_TIME_H
19+
#define HAVE_FCNTL_H
20+
#include <io.h>
21+
#include <direct.h>
22+
#endif
23+
24+
#include <libxml/xmlversion.h>
25+
26+
#ifndef ICONV_CONST
27+
#define ICONV_CONST const
28+
#endif
29+
30+
/*
31+
* Windows platforms may define except
32+
*/
33+
#undef except
34+
35+
#define HAVE_ISINF
36+
#define HAVE_ISNAN
37+
#include <math.h>
38+
#if defined(_MSC_VER) || defined(__BORLANDC__)
39+
/* MS C-runtime has functions which can be used in order to determine if
40+
a given floating-point variable contains NaN, (+-)INF. These are
41+
preferred, because floating-point technology is considered propriatary
42+
by MS and we can assume that their functions know more about their
43+
oddities than we do. */
44+
#include <float.h>
45+
/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
46+
function. */
47+
#ifndef isinf
48+
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
49+
: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
50+
#endif
51+
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
52+
#ifndef isnan
53+
#define isnan(d) (_isnan(d))
54+
#endif
55+
#else /* _MSC_VER */
56+
#ifndef isinf
57+
static int isinf (double d) {
58+
int expon = 0;
59+
double val = frexp (d, &expon);
60+
if (expon == 1025) {
61+
if (val == 0.5) {
62+
return 1;
63+
} else if (val == -0.5) {
64+
return -1;
65+
} else {
66+
return 0;
67+
}
68+
} else {
69+
return 0;
70+
}
71+
}
72+
#endif
73+
#ifndef isnan
74+
static int isnan (double d) {
75+
int expon = 0;
76+
double val = frexp (d, &expon);
77+
if (expon == 1025) {
78+
if (val == 0.5) {
79+
return 0;
80+
} else if (val == -0.5) {
81+
return 0;
82+
} else {
83+
return 1;
84+
}
85+
} else {
86+
return 0;
87+
}
88+
}
89+
#endif
90+
#endif /* _MSC_VER */
91+
92+
#if defined(_MSC_VER)
93+
#define mkdir(p,m) _mkdir(p)
94+
#if _MSC_VER < 1900 // Cannot define this in VS 2015 and above!
95+
#define snprintf _snprintf
96+
#endif
97+
#if _MSC_VER < 1500
98+
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
99+
#endif
100+
#elif defined(__MINGW32__)
101+
#define mkdir(p,m) _mkdir(p)
102+
#endif
103+
104+
/* Threading API to use should be specified here for compatibility reasons.
105+
This is however best specified on the compiler's command-line. */
106+
#if defined(LIBXML_THREAD_ENABLED)
107+
#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
108+
#define HAVE_WIN32_THREADS
109+
#endif
110+
#endif
111+
112+
/* Some third-party libraries far from our control assume the following
113+
is defined, which it is not if we don't include windows.h. */
114+
#if !defined(FALSE)
115+
#define FALSE 0
116+
#endif
117+
#if !defined(TRUE)
118+
#define TRUE (!(FALSE))
119+
#endif
120+
121+
#endif /* __LIBXML_WIN32_CONFIG__ */
122+

include/libxml/xmlexports.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
#define XMLPUBVAR __declspec(dllexport)
6262
#else
6363
#define XMLPUBFUN
64-
#if !defined(LIBXML_STATIC)
64+
#if !defined(LIBXML_STATIC) && !defined(_LIB)
6565
#define XMLPUBVAR __declspec(dllimport) extern
6666
#else
6767
#define XMLPUBVAR extern

include/libxml/xmlversion.h

+35-28
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
#ifndef __XML_VERSION_H__
1111
#define __XML_VERSION_H__
1212

13+
/* ImageMagick defines _DLL for DLL builds */
14+
#if !defined(_DLL)
15+
# if !defined(LIBXML_STATIC)
16+
# define LIBXML_STATIC 1
17+
# endif
18+
#endif
19+
1320
#include <libxml/xmlexports.h>
1421

1522
#ifdef __cplusplus
@@ -111,7 +118,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
111118
*
112119
* Whether the DOM like tree manipulation API support is configured in
113120
*/
114-
#if 1
121+
#if 0
115122
#define LIBXML_TREE_ENABLED
116123
#endif
117124

@@ -120,7 +127,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
120127
*
121128
* Whether the serialization/saving support is configured in
122129
*/
123-
#if 1
130+
#if 0
124131
#define LIBXML_OUTPUT_ENABLED
125132
#endif
126133

@@ -138,7 +145,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
138145
*
139146
* Whether the xmlReader parsing interface is configured in
140147
*/
141-
#if 1
148+
#if 0
142149
#define LIBXML_READER_ENABLED
143150
#endif
144151

@@ -147,7 +154,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
147154
*
148155
* Whether the xmlPattern node selection interface is configured in
149156
*/
150-
#if 1
157+
#if 0
151158
#define LIBXML_PATTERN_ENABLED
152159
#endif
153160

@@ -156,7 +163,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
156163
*
157164
* Whether the xmlWriter saving interface is configured in
158165
*/
159-
#if 1
166+
#if 0
160167
#define LIBXML_WRITER_ENABLED
161168
#endif
162169

@@ -174,7 +181,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
174181
*
175182
* Whether the FTP support is configured in
176183
*/
177-
#if 1
184+
#if 0
178185
#define LIBXML_FTP_ENABLED
179186
#endif
180187

@@ -183,7 +190,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
183190
*
184191
* Whether the HTTP support is configured in
185192
*/
186-
#if 1
193+
#if 0
187194
#define LIBXML_HTTP_ENABLED
188195
#endif
189196

@@ -192,7 +199,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
192199
*
193200
* Whether the DTD validation support is configured in
194201
*/
195-
#if 1
202+
#if 0
196203
#define LIBXML_VALID_ENABLED
197204
#endif
198205

@@ -201,7 +208,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
201208
*
202209
* Whether the HTML support is configured in
203210
*/
204-
#if 1
211+
#if 0
205212
#define LIBXML_HTML_ENABLED
206213
#endif
207214

@@ -210,7 +217,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
210217
*
211218
* Whether the deprecated APIs are compiled in for compatibility
212219
*/
213-
#if 1
220+
#if 0
214221
#define LIBXML_LEGACY_ENABLED
215222
#endif
216223

@@ -219,7 +226,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
219226
*
220227
* Whether the Canonicalization support is configured in
221228
*/
222-
#if 1
229+
#if 0
223230
#define LIBXML_C14N_ENABLED
224231
#endif
225232

@@ -228,7 +235,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
228235
*
229236
* Whether the Catalog support is configured in
230237
*/
231-
#if 1
238+
#if 0
232239
#define LIBXML_CATALOG_ENABLED
233240
#endif
234241

@@ -237,7 +244,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
237244
*
238245
* Whether the SGML Docbook support is configured in
239246
*/
240-
#if 1
247+
#if 0
241248
#define LIBXML_DOCB_ENABLED
242249
#endif
243250

@@ -246,7 +253,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
246253
*
247254
* Whether XPath is configured in
248255
*/
249-
#if 1
256+
#if 0
250257
#define LIBXML_XPATH_ENABLED
251258
#endif
252259

@@ -255,7 +262,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
255262
*
256263
* Whether XPointer is configured in
257264
*/
258-
#if 1
265+
#if 0
259266
#define LIBXML_XPTR_ENABLED
260267
#endif
261268

@@ -264,7 +271,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
264271
*
265272
* Whether XInclude is configured in
266273
*/
267-
#if 1
274+
#if 0
268275
#define LIBXML_XINCLUDE_ENABLED
269276
#endif
270277

@@ -273,7 +280,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
273280
*
274281
* Whether iconv support is available
275282
*/
276-
#if 1
283+
#if 0
277284
#define LIBXML_ICONV_ENABLED
278285
#endif
279286

@@ -291,7 +298,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
291298
*
292299
* Whether ISO-8859-* support is made available in case iconv is not
293300
*/
294-
#if 1
301+
#if 0
295302
#define LIBXML_ISO8859X_ENABLED
296303
#endif
297304

@@ -300,7 +307,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
300307
*
301308
* Whether Debugging module is configured in
302309
*/
303-
#if 1
310+
#if 0
304311
#define LIBXML_DEBUG_ENABLED
305312
#endif
306313

@@ -327,7 +334,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
327334
*
328335
* Whether the Unicode related interfaces are compiled in
329336
*/
330-
#if 1
337+
#if 0
331338
#define LIBXML_UNICODE_ENABLED
332339
#endif
333340

@@ -336,7 +343,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
336343
*
337344
* Whether the regular expressions interfaces are compiled in
338345
*/
339-
#if 1
346+
#if 0
340347
#define LIBXML_REGEXP_ENABLED
341348
#endif
342349

@@ -345,7 +352,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
345352
*
346353
* Whether the automata interfaces are compiled in
347354
*/
348-
#if 1
355+
#if 0
349356
#define LIBXML_AUTOMATA_ENABLED
350357
#endif
351358

@@ -354,7 +361,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
354361
*
355362
* Whether the formal expressions interfaces are compiled in
356363
*/
357-
#if 1
364+
#if 0
358365
#define LIBXML_EXPR_ENABLED
359366
#endif
360367

@@ -363,7 +370,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
363370
*
364371
* Whether the Schemas validation interfaces are compiled in
365372
*/
366-
#if 1
373+
#if 0
367374
#define LIBXML_SCHEMAS_ENABLED
368375
#endif
369376

@@ -372,7 +379,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
372379
*
373380
* Whether the Schematron validation interfaces are compiled in
374381
*/
375-
#if 1
382+
#if 0
376383
#define LIBXML_SCHEMATRON_ENABLED
377384
#endif
378385

@@ -381,7 +388,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
381388
*
382389
* Whether the module interfaces are compiled in
383390
*/
384-
#if 1
391+
#if 0
385392
#define LIBXML_MODULES_ENABLED
386393
/**
387394
* LIBXML_MODULE_EXTENSION:
@@ -396,7 +403,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
396403
*
397404
* Whether the Zlib support is compiled in
398405
*/
399-
#if 1
406+
#if 0
400407
#define LIBXML_ZLIB_ENABLED
401408
#endif
402409

@@ -405,7 +412,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
405412
*
406413
* Whether the Lzma support is compiled in
407414
*/
408-
#if 1
415+
#if 0
409416
#define LIBXML_LZMA_ENABLED
410417
#endif
411418

0 commit comments

Comments
 (0)