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 |
|
---|
9 | #if defined(_WIN32_WCE)
|
---|
10 | #undef HAVE_ERRNO_H
|
---|
11 | #include <windows.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 | #ifdef NEED_SOCKETS
|
---|
27 | #include <wsockcompat.h>
|
---|
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 | #define snprintf _snprintf
|
---|
95 | #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
|
---|
96 | #elif defined(__MINGW32__)
|
---|
97 | #define mkdir(p,m) _mkdir(p)
|
---|
98 | #endif
|
---|
99 |
|
---|
100 | /* Threading API to use should be specified here for compatibility reasons.
|
---|
101 | This is however best specified on the compiler's command-line. */
|
---|
102 | #if defined(LIBXML_THREAD_ENABLED)
|
---|
103 | #if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
|
---|
104 | #define HAVE_WIN32_THREADS
|
---|
105 | #endif
|
---|
106 | #endif
|
---|
107 |
|
---|
108 | /* Some third-party libraries far from our control assume the following
|
---|
109 | is defined, which it is not if we don't include windows.h. */
|
---|
110 | #if !defined(FALSE)
|
---|
111 | #define FALSE 0
|
---|
112 | #endif
|
---|
113 | #if !defined(TRUE)
|
---|
114 | #define TRUE (!(FALSE))
|
---|
115 | #endif
|
---|
116 |
|
---|
117 | #endif /* __LIBXML_WIN32_CONFIG__ */
|
---|
118 |
|
---|