The mingw32 gcc compiler doesn't treat __inline as Visual C++ does. Use `static inline` instead of `__inline` for c99_vsnprintf. Don't use `__inline` for ts_utf8_sequence_length.
Unified · Split
| @@ -101,7 +101,13 @@ int cst_sprintf(char *s, const char *fmt, ...); · 100 unmodified lines | |||
| 101 | #ifdef _WIN32 | 101 | #ifdef _WIN32 |
| 102 | #define snprintf c99_snprintf | 102 | #define snprintf c99_snprintf |
| 103 | 103 | ||
| 104 | __inline int c99_vsnprintf(char* str, size_t size, const char* format, | 104 | #ifdef __GNUC__ |
| 105 | #define INLINE static inline | ||
| 106 | #else | ||
| 107 | #define INLINE __inline | ||
| 108 | #endif | ||
| 109 | |||
| 110 | INLINE int c99_vsnprintf(char* str, size_t size, const char* format, | ||
| 105 | va_list ap) { | 111 | va_list ap) { |
| 106 | int count = -1; | 112 | int count = -1; |
| 107 | if (size != 0) | 113 | if (size != 0) |
| @@ -110,7 +116,7 @@ va_list ap) { · 2 unmodified lines | |||
| 110 | count = _vscprintf(format, ap); | 116 | count = _vscprintf(format, ap); |
| 111 | return count; | 117 | return count; |
| 112 | } | 118 | } |
| 113 | __inline int c99_snprintf(char* str, size_t size, const char* format, ...) | 119 | INLINE int c99_snprintf(char* str, size_t size, const char* format, ...) |
| 114 | { | 120 | { |
| 115 | int count; | 121 | int count; |
| 116 | va_list ap; | 122 | va_list ap; |
| @@ -130,7 +130,7 @@ cst_tokenstream *ts_open_generic(const char *filename, · 129 unmodified lines | |||
| 130 | int (*getc)(cst_tokenstream *ts)); | 130 | int (*getc)(cst_tokenstream *ts)); |
| 131 | void ts_close(cst_tokenstream *ts); | 131 | void ts_close(cst_tokenstream *ts); |
| 132 | 132 | ||
| 133 | #ifdef _WIN32 | 133 | #if defined(_WIN32) && !defined(__GNUC__) |
| 134 | __inline int ts_utf8_sequence_length(char c0); | 134 | __inline int ts_utf8_sequence_length(char c0); |
| 135 | #else | 135 | #else |
| 136 | int ts_utf8_sequence_length(char c0); | 136 | int ts_utf8_sequence_length(char c0); |
| @@ -266,7 +266,7 @@ static void get_token_sub_part(cst_tokenstream *ts, · 265 unmodified lines | |||
| 266 | (*buffer)[p] = '\0'; | 266 | (*buffer)[p] = '\0'; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | #ifdef _WIN32 | 269 | #if defined _WIN32 && !defined(__GNUC__) |
| 270 | __inline int ts_utf8_sequence_length(char c0) | 270 | __inline int ts_utf8_sequence_length(char c0) |
| 271 | #else | 271 | #else |
| 272 | int ts_utf8_sequence_length(char c0) | 272 | int ts_utf8_sequence_length(char c0) |