OLD | NEW |
1 /* | 1 /* |
2 * Summary: Windows configuration header | 2 * Summary: Windows configuration header |
3 * Description: Windows configuration header | 3 * Description: Windows configuration header |
4 * | 4 * |
5 * Copy: See Copyright for the status of this software. | 5 * Copy: See Copyright for the status of this software. |
6 * | 6 * |
7 * Author: Igor Zlatkovic | 7 * Author: Igor Zlatkovic |
8 */ | 8 */ |
9 #ifndef __LIBXSLT_WIN32_CONFIG__ | 9 #ifndef __LIBXSLT_WIN32_CONFIG__ |
10 #define __LIBXSLT_WIN32_CONFIG__ | 10 #define __LIBXSLT_WIN32_CONFIG__ |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } else { | 70 } else { |
71 return 1; | 71 return 1; |
72 } | 72 } |
73 } else { | 73 } else { |
74 return 0; | 74 return 0; |
75 } | 75 } |
76 } | 76 } |
77 #endif /* _MSC_VER */ | 77 #endif /* _MSC_VER */ |
78 | 78 |
79 #include <direct.h> | 79 #include <direct.h> |
80 #if defined(_MSC_VER) || defined(__MINGW32__) | 80 |
81 #define mkdir(p,m) _mkdir(p) | 81 /* snprintf emulation taken from http://stackoverflow.com/a/8712996/1956010 */ |
82 #define snprintf _snprintf | 82 #if defined(_MSC_VER) && _MSC_VER < 1900 |
83 #if _MSC_VER < 1500 | 83 |
84 #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a) | 84 #include <stdarg.h> |
85 #endif | 85 #include <stdio.h> |
86 #endif | 86 |
| 87 #define snprintf c99_snprintf |
| 88 #define vsnprintf c99_vsnprintf |
| 89 |
| 90 __inline int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_lis
t ap) |
| 91 { |
| 92 int count = -1; |
| 93 |
| 94 if (size != 0) |
| 95 count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap); |
| 96 if (count == -1) |
| 97 count = _vscprintf(format, ap); |
| 98 |
| 99 return count; |
| 100 } |
| 101 |
| 102 __inline int c99_snprintf(char *outBuf, size_t size, const char *format, ...) |
| 103 { |
| 104 int count; |
| 105 va_list ap; |
| 106 |
| 107 va_start(ap, format); |
| 108 count = c99_vsnprintf(outBuf, size, format, ap); |
| 109 va_end(ap); |
| 110 |
| 111 return count; |
| 112 } |
| 113 |
| 114 #endif /* defined(_MSC_VER) && _MSC_VER < 1900 */ |
87 | 115 |
88 #define HAVE_SYS_STAT_H | 116 #define HAVE_SYS_STAT_H |
89 #define HAVE__STAT | 117 #define HAVE__STAT |
90 #define HAVE_STRING_H | 118 #define HAVE_STRING_H |
91 | 119 |
92 #include <libxml/xmlversion.h> | 120 #include <libxml/xmlversion.h> |
93 | 121 |
94 #ifndef ATTRIBUTE_UNUSED | 122 #ifndef ATTRIBUTE_UNUSED |
95 #define ATTRIBUTE_UNUSED | 123 #define ATTRIBUTE_UNUSED |
96 #endif | 124 #endif |
97 | 125 |
98 #define _WINSOCKAPI_ | 126 #define _WINSOCKAPI_ |
99 | 127 |
100 #endif /* __LIBXSLT_WIN32_CONFIG__ */ | 128 #endif /* __LIBXSLT_WIN32_CONFIG__ */ |
101 | 129 |
OLD | NEW |