blob: b63786b88d2296d4534047eca6c153446fc00ab7 [file] [log] [blame]
Daniel Veillard4151acb2001-06-22 10:48:57 +00001#ifndef __LIBXML_WIN32_CONFIG__
2#define __LIBXML_WIN32_CONFIG__
3
Owen Taylor3473f882001-02-23 17:55:21 +00004#define HAVE_CTYPE_H
5#define HAVE_STDLIB_H
6#define HAVE_MALLOC_H
7#define HAVE_TIME_H
8#define HAVE_FCNTL_H
9
10#include <io.h>
11
Daniel Veillard4151acb2001-06-22 10:48:57 +000012#ifndef LIBXML_DLL_IMPORT
Daniel Veillard12f7d292001-06-28 13:12:11 +000013#if !defined(STATIC)
14#define LIBXML_DLL_IMPORT __declspec(dllimport)
15#else
Owen Taylor3473f882001-02-23 17:55:21 +000016#define LIBXML_DLL_IMPORT
Daniel Veillard4151acb2001-06-22 10:48:57 +000017#endif
Daniel Veillard12f7d292001-06-28 13:12:11 +000018#endif
Owen Taylor3473f882001-02-23 17:55:21 +000019
Daniel Veillard12f7d292001-06-28 13:12:11 +000020#define SOCKLEN_T int
Daniel Veillardf3afa7d2001-06-09 13:52:58 +000021#ifdef NEED_SOCKETS
Owen Taylor3473f882001-02-23 17:55:21 +000022#include <winsock2.h>
23
24#define EWOULDBLOCK WSAEWOULDBLOCK
25#define EINPROGRESS WSAEINPROGRESS
26#define EALREADY WSAEALREADY
27#define ENOTSOCK WSAENOTSOCK
28#define EDESTADDRREQ WSAEDESTADDRREQ
29#define EMSGSIZE WSAEMSGSIZE
30#define EPROTOTYPE WSAEPROTOTYPE
31#define ENOPROTOOPT WSAENOPROTOOPT
32#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
33#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
34#define EOPNOTSUPP WSAEOPNOTSUPP
35#define EPFNOSUPPORT WSAEPFNOSUPPORT
36#define EAFNOSUPPORT WSAEAFNOSUPPORT
37#define EADDRINUSE WSAEADDRINUSE
38#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
39#define ENETDOWN WSAENETDOWN
40#define ENETUNREACH WSAENETUNREACH
41#define ENETRESET WSAENETRESET
42#define ECONNABORTED WSAECONNABORTED
43#define ECONNRESET WSAECONNRESET
44#define ENOBUFS WSAENOBUFS
45#define EISCONN WSAEISCONN
46#define ENOTCONN WSAENOTCONN
47#define ESHUTDOWN WSAESHUTDOWN
48#define ETOOMANYREFS WSAETOOMANYREFS
49#define ETIMEDOUT WSAETIMEDOUT
50#define ECONNREFUSED WSAECONNREFUSED
51#define ELOOP WSAELOOP
52#define ENAMETOOLONG WSAENAMETOOLONG
53#define EHOSTDOWN WSAEHOSTDOWN
54#define EHOSTUNREACH WSAEHOSTUNREACH
55#define ENOTEMPTY WSAENOTEMPTY
56#define EPROCLIM WSAEPROCLIM
57#define EUSERS WSAEUSERS
58#define EDQUOT WSAEDQUOT
59#define ESTALE WSAESTALE
60#define EREMOTE WSAEREMOTE
61#endif /* INCLUDE_WINSOCK */
62
63#define HAVE_ISINF
64#define HAVE_ISNAN
65
66#include <math.h>
67static int isinf (double d) {
68 int expon = 0;
69 double val = frexp (d, &expon);
70 if (expon == 1025) {
71 if (val == 0.5) {
72 return 1;
73 } else if (val == -0.5) {
74 return -1;
75 } else {
76 return 0;
77 }
78 } else {
79 return 0;
80 }
81}
82static 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
98#include <direct.h>
99
Daniel Veillard2d90de42001-04-16 17:46:18 +0000100#define HAVE_SYS_STAT_H
101#define HAVE__STAT
102
103/* Microsoft's C runtime names all non-ANSI functions with a leading
104 underscore. Since functionality is still the same, they can be used. */
105#ifdef _MSC_VER
Daniel Veillard87ee9142001-06-28 12:54:16 +0000106#include <libxml/xmlwin32version.h>
Daniel Veillardf3afa7d2001-06-09 13:52:58 +0000107#ifndef WITH_TRIO
Daniel Veillard2d90de42001-04-16 17:46:18 +0000108#define snprintf _snprintf
109#define vsnprintf _vsnprintf
Daniel Veillardf3afa7d2001-06-09 13:52:58 +0000110#endif /* WITH_TRIO */
Daniel Veillard2d90de42001-04-16 17:46:18 +0000111#endif /* _MSC_VER */
Owen Taylor3473f882001-02-23 17:55:21 +0000112
Daniel Veillardcc146db2001-06-22 11:10:52 +0000113
114#ifndef ATTRIBUTE_UNUSED
115#define ATTRIBUTE_UNUSED
116#endif
117
Daniel Veillard4151acb2001-06-22 10:48:57 +0000118#endif /* __LIBXML_WIN32_CONFIG__ */
119