2 * Summary: Windows configuration header
3 * Description: Windows configuration header
5 * Copy: See Copyright for the status of this software.
7 * Author: Igor Zlatkovic
9 #ifndef __LIBXSLT_WIN32_CONFIG__
10 #define __LIBXSLT_WIN32_CONFIG__
12 #define HAVE_CTYPE_H 1
13 #define HAVE_STDLIB_H 1
14 #define HAVE_STDARG_H 1
15 #define HAVE_MALLOC_H 1
17 #define HAVE_LOCALTIME 1
21 #define HAVE_FCNTL_H 1
29 #if defined _MSC_VER || defined __MINGW32__
30 /* MS C-runtime has functions which can be used in order to determine if
31 a given floating-point variable contains NaN, (+-)INF. These are
32 preferred, because floating-point technology is considered propriatary
33 by MS and we can assume that their functions know more about their
34 oddities than we do. */
36 /* Bjorn Reese figured a quite nice construct for isinf() using the
37 _fpclass() function. */
39 #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
40 : ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
42 /* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
44 #define isnan(d) (_isnan(d))
47 static int isinf (double d
) {
49 double val
= frexp (d
, &expon
);
53 } else if (val
== -0.5) {
62 static int isnan (double d
) {
64 double val
= frexp (d
, &expon
);
68 } else if (val
== -0.5) {
81 #if defined(_MSC_VER) || defined(__MINGW32__)
82 #define mkdir(p,m) _mkdir(p)
83 #define snprintf _snprintf
85 #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
88 #else /* __REACTOS__ */
89 /* snprintf emulation taken from http://stackoverflow.com/a/8712996/1956010 */
90 #if defined(_MSC_VER) && _MSC_VER < 1900
95 #define snprintf c99_snprintf
96 #define vsnprintf c99_vsnprintf
98 __inline
int c99_vsnprintf(char *outBuf
, size_t size
, const char *format
, va_list ap
)
103 count
= _vsnprintf_s(outBuf
, size
, _TRUNCATE
, format
, ap
);
105 count
= _vscprintf(format
, ap
);
110 __inline
int c99_snprintf(char *outBuf
, size_t size
, const char *format
, ...)
115 va_start(ap
, format
);
116 count
= c99_vsnprintf(outBuf
, size
, format
, ap
);
122 #endif /* defined(_MSC_VER) && _MSC_VER < 1900 */
123 #endif /* __REACTOS__ */
125 #define HAVE_SYS_STAT_H
127 #define HAVE_STRING_H
129 #include <libxml/xmlversion.h>
131 #ifndef ATTRIBUTE_UNUSED
132 #define ATTRIBUTE_UNUSED
137 #endif /* __LIBXSLT_WIN32_CONFIG__ */