xslt: Import upstream release 1.1.38.
[wine.git] / libs / xslt / libxslt / win32config.h
blobce7978ba886628ed800165ae6ee1fd8ec7f1c589
1 /*
2 * Summary: Windows configuration header
3 * Description: Windows configuration header
5 * Copy: See Copyright for the status of this software.
7 * Author: Igor Zlatkovic
8 */
9 #ifndef __LIBXSLT_WIN32_CONFIG__
10 #define __LIBXSLT_WIN32_CONFIG__
12 /* snprintf emulation taken from http://stackoverflow.com/a/8712996/1956010 */
13 #if defined(_MSC_VER) && _MSC_VER < 1900
15 #include <stdarg.h>
16 #include <stdio.h>
18 #define snprintf c99_snprintf
19 #define vsnprintf c99_vsnprintf
21 __inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
23 int count = -1;
25 if (size != 0)
26 count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);
27 if (count == -1)
28 count = _vscprintf(format, ap);
30 return count;
33 __inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
35 int count;
36 va_list ap;
38 va_start(ap, format);
39 count = c99_vsnprintf(outBuf, size, format, ap);
40 va_end(ap);
42 return count;
45 #endif /* defined(_MSC_VER) && _MSC_VER < 1900 */
47 #define HAVE_SYS_STAT_H
48 #define HAVE_STAT
50 #endif /* __LIBXSLT_WIN32_CONFIG__ */