Update mojo sdk to rev 1dc8a9a5db73d3718d99917fadf31f5fb2ebad4f
[chromium-blink-merge.git] / third_party / libxml / win32 / config.h
blob5112ce6426440fbee2d6ead1e2e77dd274459b6c
1 #ifndef __LIBXML_WIN32_CONFIG__
2 #define __LIBXML_WIN32_CONFIG__
4 #define HAVE_CTYPE_H
5 #define HAVE_STDARG_H
6 #define HAVE_MALLOC_H
7 #define HAVE_ERRNO_H
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
24 #include <libxml/xmlversion.h>
26 #ifndef ICONV_CONST
27 #define ICONV_CONST const
28 #endif
30 #ifdef NEED_SOCKETS
31 #include <wsockcompat.h>
32 #endif
35 * Windows platforms may define except
37 #undef except
39 #define HAVE_ISINF
40 #define HAVE_ISNAN
41 #include <math.h>
42 #if defined(_MSC_VER) || defined(__BORLANDC__)
43 /* MS C-runtime has functions which can be used in order to determine if
44 a given floating-point variable contains NaN, (+-)INF. These are
45 preferred, because floating-point technology is considered propriatary
46 by MS and we can assume that their functions know more about their
47 oddities than we do. */
48 #include <float.h>
49 /* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
50 function. */
51 #ifndef isinf
52 #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
53 : ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
54 #endif
55 /* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
56 #ifndef isnan
57 #define isnan(d) (_isnan(d))
58 #endif
59 #else /* _MSC_VER */
60 #ifndef isinf
61 static int isinf (double d) {
62 int expon = 0;
63 double val = frexp (d, &expon);
64 if (expon == 1025) {
65 if (val == 0.5) {
66 return 1;
67 } else if (val == -0.5) {
68 return -1;
69 } else {
70 return 0;
72 } else {
73 return 0;
76 #endif
77 #ifndef isnan
78 static int isnan (double d) {
79 int expon = 0;
80 double val = frexp (d, &expon);
81 if (expon == 1025) {
82 if (val == 0.5) {
83 return 0;
84 } else if (val == -0.5) {
85 return 0;
86 } else {
87 return 1;
89 } else {
90 return 0;
93 #endif
94 #endif /* _MSC_VER */
96 #if defined(_MSC_VER)
97 #define mkdir(p,m) _mkdir(p)
98 #if _MSC_VER < 1900
99 #define snprintf _snprintf
100 #endif
101 #if _MSC_VER < 1500
102 #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
103 #endif
104 #elif defined(__MINGW32__)
105 #define mkdir(p,m) _mkdir(p)
106 #endif
108 /* Threading API to use should be specified here for compatibility reasons.
109 This is however best specified on the compiler's command-line. */
110 #if defined(LIBXML_THREAD_ENABLED)
111 #if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
112 #define HAVE_WIN32_THREADS
113 #endif
114 #endif
116 /* Some third-party libraries far from our control assume the following
117 is defined, which it is not if we don't include windows.h. */
118 #if !defined(FALSE)
119 #define FALSE 0
120 #endif
121 #if !defined(TRUE)
122 #define TRUE (!(FALSE))
123 #endif
125 #endif /* __LIBXML_WIN32_CONFIG__ */