2001-06-22 10:48:57 +00:00
# ifndef __LIBXML_WIN32_CONFIG__
# define __LIBXML_WIN32_CONFIG__
2001-02-23 17:55:21 +00:00
# define HAVE_CTYPE_H
2002-02-08 13:44:24 +00:00
# define HAVE_STDARG_H
2001-02-23 17:55:21 +00:00
# define HAVE_MALLOC_H
2002-09-29 17:51:32 +00:00
# define HAVE_ERRNO_H
2007-04-18 07:51:50 +00:00
# if defined(_WIN32_WCE)
2002-09-29 17:51:32 +00:00
# undef HAVE_ERRNO_H
# include <windows.h>
# include "wincecompat.h"
# else
# define HAVE_SYS_STAT_H
# define HAVE__STAT
# define HAVE_STAT
# define HAVE_STDLIB_H
2001-02-23 17:55:21 +00:00
# define HAVE_TIME_H
# define HAVE_FCNTL_H
# include <io.h>
2002-09-29 17:51:32 +00:00
# include <direct.h>
2002-04-17 18:35:57 +00:00
# endif
2002-10-31 15:59:57 +00:00
# include <libxml/xmlversion.h>
2002-04-17 18:35:57 +00:00
2008-03-10 15:26:27 +00:00
# ifndef ICONV_CONST
# define ICONV_CONST const
# endif
2002-09-29 17:51:32 +00:00
# ifdef NEED_SOCKETS
# include <wsockcompat.h>
# endif
2001-02-23 17:55:21 +00:00
2007-04-18 07:51:50 +00:00
/*
* Windows platforms may define except
*/
# undef except
2001-02-23 17:55:21 +00:00
# define HAVE_ISINF
# define HAVE_ISNAN
# include <math.h>
2003-06-14 16:48:26 +00:00
# if defined(_MSC_VER) || defined(__BORLANDC__)
2001-08-03 12:06:36 +00:00
/* MS C-runtime has functions which can be used in order to determine if
a given floating - point variable contains NaN , ( + - ) INF . These are
preferred , because floating - point technology is considered propriatary
by MS and we can assume that their functions know more about their
oddities than we do . */
# include <float.h>
/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
function . */
# ifndef isinf
# define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
: ( ( _fpclass ( d ) = = _FPCLASS_NINF ) ? - 1 : 0 ) )
# endif
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
# ifndef isnan
# define isnan(d) (_isnan(d))
# endif
# else /* _MSC_VER */
2002-12-11 17:00:40 +00:00
# ifndef isinf
2001-02-23 17:55:21 +00:00
static int isinf ( double d ) {
int expon = 0 ;
double val = frexp ( d , & expon ) ;
if ( expon = = 1025 ) {
if ( val = = 0.5 ) {
return 1 ;
} else if ( val = = - 0.5 ) {
return - 1 ;
} else {
return 0 ;
}
} else {
return 0 ;
}
}
2002-12-11 17:00:40 +00:00
# endif
# ifndef isnan
2001-02-23 17:55:21 +00:00
static int isnan ( double d ) {
int expon = 0 ;
double val = frexp ( d , & expon ) ;
if ( expon = = 1025 ) {
if ( val = = 0.5 ) {
return 0 ;
} else if ( val = = - 0.5 ) {
return 0 ;
} else {
return 1 ;
}
} else {
return 0 ;
}
}
2002-12-11 17:00:40 +00:00
# endif
2001-08-03 12:06:36 +00:00
# endif /* _MSC_VER */
2001-02-23 17:55:21 +00:00
2005-11-01 10:55:24 +00:00
# if defined(_MSC_VER)
2002-11-14 17:43:55 +00:00
# define mkdir(p,m) _mkdir(p)
2001-04-16 17:46:18 +00:00
# define snprintf _snprintf
2008-01-25 19:03:37 +00:00
# if _MSC_VER < 1500
2002-11-14 17:43:55 +00:00
# define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
2008-01-25 19:03:37 +00:00
# endif
2005-11-01 10:55:24 +00:00
# elif defined(__MINGW32__)
# define mkdir(p,m) _mkdir(p)
2002-11-14 17:43:55 +00:00
# endif
2001-02-23 17:55:21 +00:00
2002-10-31 15:59:57 +00:00
/* Threading API to use should be specified here for compatibility reasons.
This is however best specified on the compiler ' s command - line . */
# if defined(LIBXML_THREAD_ENABLED)
2007-04-18 07:51:50 +00:00
# if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS) && !defined(_WIN32_WCE)
2002-01-13 13:35:00 +00:00
# define HAVE_WIN32_THREADS
2002-10-31 15:59:57 +00:00
# endif
# endif
/* Some third-party libraries far from our control assume the following
is defined , which it is not if we don ' t include windows . h . */
# if !defined(FALSE)
# define FALSE 0
# endif
# if !defined(TRUE)
# define TRUE (!(FALSE))
# endif
2002-01-13 13:35:00 +00:00
2001-06-22 10:48:57 +00:00
# endif /* __LIBXML_WIN32_CONFIG__ */