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 |
Daniel Veillard | 12f7d29 | 2001-06-28 13:12:11 +0000 | [diff] [blame] | 13 | #if !defined(STATIC) |
| 14 | #define LIBXML_DLL_IMPORT __declspec(dllimport) |
| 15 | #else |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 16 | #define LIBXML_DLL_IMPORT |
Daniel Veillard | 4151acb | 2001-06-22 10:48:57 +0000 | [diff] [blame] | 17 | #endif |
Daniel Veillard | 12f7d29 | 2001-06-28 13:12:11 +0000 | [diff] [blame] | 18 | #endif |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 19 | |
Daniel Veillard | 12f7d29 | 2001-06-28 13:12:11 +0000 | [diff] [blame] | 20 | #define SOCKLEN_T int |
Daniel Veillard | f3afa7d | 2001-06-09 13:52:58 +0000 | [diff] [blame] | 21 | #ifdef NEED_SOCKETS |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 22 | #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> |
| 67 | static 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 | } |
| 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 | |
| 98 | #include <direct.h> |
| 99 | |
Daniel Veillard | 2d90de4 | 2001-04-16 17:46:18 +0000 | [diff] [blame] | 100 | #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 Veillard | 87ee914 | 2001-06-28 12:54:16 +0000 | [diff] [blame] | 106 | #include <libxml/xmlwin32version.h> |
Daniel Veillard | f3afa7d | 2001-06-09 13:52:58 +0000 | [diff] [blame] | 107 | #ifndef WITH_TRIO |
Daniel Veillard | 2d90de4 | 2001-04-16 17:46:18 +0000 | [diff] [blame] | 108 | #define snprintf _snprintf |
| 109 | #define vsnprintf _vsnprintf |
Daniel Veillard | f3afa7d | 2001-06-09 13:52:58 +0000 | [diff] [blame] | 110 | #endif /* WITH_TRIO */ |
Daniel Veillard | 2d90de4 | 2001-04-16 17:46:18 +0000 | [diff] [blame] | 111 | #endif /* _MSC_VER */ |
Owen Taylor | 3473f88 | 2001-02-23 17:55:21 +0000 | [diff] [blame] | 112 | |
Daniel Veillard | cc146db | 2001-06-22 11:10:52 +0000 | [diff] [blame] | 113 | |
| 114 | #ifndef ATTRIBUTE_UNUSED |
| 115 | #define ATTRIBUTE_UNUSED |
| 116 | #endif |
| 117 | |
Daniel Veillard | 4151acb | 2001-06-22 10:48:57 +0000 | [diff] [blame] | 118 | #endif /* __LIBXML_WIN32_CONFIG__ */ |
| 119 | |