Skip to content

Commit 516b180

Browse files
committed
CI fixes and improved typing
1 parent 71dcb9d commit 516b180

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

c89stringutils/c89stringutils_string_extras.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ extern "C" {
1616
#include <stdarg.h>
1717
#include <stdio.h>
1818
#include <string.h>
19+
#include <errno.h>
1920

2021
#if defined(_MSC_VER)
2122
#define NUM_FORMAT "%I64d"
@@ -89,9 +90,9 @@ extern "C" {
8990

9091
#else
9192

92-
#if !defined(__APPLE__) && !defined(__APPLE_CC__)
93+
#if !defined(__APPLE__) && !defined(__APPLE_CC__) && !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
9394
typedef int errno_t;
94-
#endif /* !defined(__APPLE__) && !defined(__APPLE_CC__) */
95+
#endif /* !defined(__APPLE__) && !defined(__APPLE_CC__) && !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__WATCOMC__) */
9596

9697
#if defined(__linux__) || defined(linux) || defined(__linux) || defined(ANY_BSD)
9798
#define strerror_s strerror_r

c89stringutils/tests/test_string_extras.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,13 @@ TEST x_mock_failures(void) {
347347
g_mock_vsnprintf_fail_call = 0;
348348

349349
s = malloc(10);
350-
if (s)
350+
if (s) {
351+
#if defined(_MSC_VER)
352+
strcpy_s(s, 10, "123");
353+
#else
351354
strcpy(s, "123");
355+
#endif
356+
}
352357
g_mock_realloc_fail = 1;
353358
ASSERT_EQ(-1, c89stringutils_jasprintf(&s, "test"));
354359
ASSERT_EQ(-1, jasprintf(&s, "test"));

0 commit comments

Comments
 (0)