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