Daniel Veillard | 4151acb | 2001-06-22 10:48:57 +0000 | [diff] [blame] | 1 | #ifndef __LIBXML_WIN32_CONFIG__ |
| 2 | #define __LIBXML_WIN32_CONFIG__ |
| 3 | |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 4 | #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 Veillard | 4151acb | 2001-06-22 10:48:57 +0000 | [diff] [blame] | 12 | #ifndef LIBXML_DLL_IMPORT |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 13 | #define LIBXML_DLL_IMPORT |
Daniel Veillard | 4151acb | 2001-06-22 10:48:57 +0000 | [diff] [blame] | 14 | #endif |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 15 | #define SOCKLEN_T int |
| 16 | |
Daniel Veillard | f3afa7d | 2001-06-09 13:52:58 +0000 | [diff] [blame] | 17 | #ifdef NEED_SOCKETS |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 18 | #include <winsock2.h> |
| 19 | |
| 20 | #define EWOULDBLOCK WSAEWOULDBLOCK |
| 21 | #define EINPROGRESS WSAEINPROGRESS |
| 22 | #define EALREADY WSAEALREADY |
| 23 | #define ENOTSOCK WSAENOTSOCK |
| 24 | #define EDESTADDRREQ WSAEDESTADDRREQ |
| 25 | #define EMSGSIZE WSAEMSGSIZE |
| 26 | #define EPROTOTYPE WSAEPROTOTYPE |
| 27 | #define ENOPROTOOPT WSAENOPROTOOPT |
| 28 | #define EPROTONOSUPPORT WSAEPROTONOSUPPORT |
| 29 | #define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT |
| 30 | #define EOPNOTSUPP WSAEOPNOTSUPP |
| 31 | #define EPFNOSUPPORT WSAEPFNOSUPPORT |
| 32 | #define EAFNOSUPPORT WSAEAFNOSUPPORT |
| 33 | #define EADDRINUSE WSAEADDRINUSE |
| 34 | #define EADDRNOTAVAIL WSAEADDRNOTAVAIL |
| 35 | #define ENETDOWN WSAENETDOWN |
| 36 | #define ENETUNREACH WSAENETUNREACH |
| 37 | #define ENETRESET WSAENETRESET |
| 38 | #define ECONNABORTED WSAECONNABORTED |
| 39 | #define ECONNRESET WSAECONNRESET |
| 40 | #define ENOBUFS WSAENOBUFS |
| 41 | #define EISCONN WSAEISCONN |
| 42 | #define ENOTCONN WSAENOTCONN |
| 43 | #define ESHUTDOWN WSAESHUTDOWN |
| 44 | #define ETOOMANYREFS WSAETOOMANYREFS |
| 45 | #define ETIMEDOUT WSAETIMEDOUT |
| 46 | #define ECONNREFUSED WSAECONNREFUSED |
| 47 | #define ELOOP WSAELOOP |
| 48 | #define ENAMETOOLONG WSAENAMETOOLONG |
| 49 | #define EHOSTDOWN WSAEHOSTDOWN |
| 50 | #define EHOSTUNREACH WSAEHOSTUNREACH |
| 51 | #define ENOTEMPTY WSAENOTEMPTY |
| 52 | #define EPROCLIM WSAEPROCLIM |
| 53 | #define EUSERS WSAEUSERS |
| 54 | #define EDQUOT WSAEDQUOT |
| 55 | #define ESTALE WSAESTALE |
| 56 | #define EREMOTE WSAEREMOTE |
| 57 | #endif /* INCLUDE_WINSOCK */ |
| 58 | |
| 59 | #define HAVE_ISINF |
| 60 | #define HAVE_ISNAN |
| 61 | |
| 62 | #include <math.h> |
| 63 | static int isinf (double d) { |
| 64 | int expon = 0; |
| 65 | double val = frexp (d, &expon); |
| 66 | if (expon == 1025) { |
| 67 | if (val == 0.5) { |
| 68 | return 1; |
| 69 | } else if (val == -0.5) { |
| 70 | return -1; |
| 71 | } else { |
| 72 | return 0; |
| 73 | } |
| 74 | } else { |
| 75 | return 0; |
| 76 | } |
| 77 | } |
| 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; |
| 88 | } |
| 89 | } else { |
| 90 | return 0; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | #include <direct.h> |
| 95 | |
Daniel Veillard | 2d90de4 | 2001-04-16 17:46:18 +0000 | [diff] [blame] | 96 | #define HAVE_SYS_STAT_H |
| 97 | #define HAVE__STAT |
| 98 | |
| 99 | /* Microsoft's C runtime names all non-ANSI functions with a leading |
| 100 | underscore. Since functionality is still the same, they can be used. */ |
| 101 | #ifdef _MSC_VER |
Daniel Veillard | f3afa7d | 2001-06-09 13:52:58 +0000 | [diff] [blame] | 102 | #include <libxml/xmlversion.h> |
| 103 | #ifndef WITH_TRIO |
Daniel Veillard | 2d90de4 | 2001-04-16 17:46:18 +0000 | [diff] [blame] | 104 | #define snprintf _snprintf |
| 105 | #define vsnprintf _vsnprintf |
Daniel Veillard | f3afa7d | 2001-06-09 13:52:58 +0000 | [diff] [blame] | 106 | #endif /* WITH_TRIO */ |
Daniel Veillard | 2d90de4 | 2001-04-16 17:46:18 +0000 | [diff] [blame] | 107 | #endif /* _MSC_VER */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 108 | |
Daniel Veillard | cc146db | 2001-06-22 11:10:52 +0000 | [diff] [blame] | 109 | |
| 110 | #ifndef ATTRIBUTE_UNUSED |
| 111 | #define ATTRIBUTE_UNUSED |
| 112 | #endif |
| 113 | |
Daniel Veillard | 4151acb | 2001-06-22 10:48:57 +0000 | [diff] [blame] | 114 | #endif /* __LIBXML_WIN32_CONFIG__ */ |
| 115 | |