Browse code

move libxml2 config.h to include/libxml for windows build.

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