Skip to content

Commit d5c99d9

Browse files
committed
CI fixes
1 parent 0fe175e commit d5c99d9

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

c89stringutils/c89stringutils_string_extras.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ void c89stringutils_log_debug(const char *fmt, ...) {
6363
* SPDX-License-Identifier: BSD-2-Clause
6464
*/
6565

66-
#ifdef ANY_BSD
67-
#define _vsnprintf vsnprintf
68-
#endif /* ANY_BSD */
66+
#if !defined(_MSC_VER)
67+
#if !defined(ANY_BSD) && !defined(__APPLE__)
68+
extern int vsnprintf(char *str, size_t size, const char *format, va_list ap);
69+
#endif
70+
#endif
6971

7072
/**
7173
* @brief Implement vsnprintf for platforms that don't have it.
@@ -88,13 +90,13 @@ static int wtf_vsnprintf(char *buffer, size_t count, const char *format,
8890
}
8991
}
9092
#else
91-
rc = _vsnprintf(buffer, count, format, args);
93+
rc = vsnprintf(buffer, count, format, args);
9294
if (rc < 0) {
93-
LOG_DEBUG("_vsnprintf failed with rc=%d", rc);
95+
LOG_DEBUG("vsnprintf failed with rc=%d", rc);
9496
return rc;
9597
}
9698
#endif
97-
/* In the case where the string entirely filled the buffer, _vsnprintf will
99+
/* In the case where the string entirely filled the buffer, vsnprintf will
98100
not null-terminate it, but vsnprintf must. */
99101
if (count > 0)
100102
buffer[count - 1] = '\0';

0 commit comments

Comments
 (0)