lib/SPVM/Builder/src/spvm_strerror.c | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 3 | 3 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | n/a | ||
pod | n/a | ||
total | 3 | 3 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | // Copyright (c) 2023 Yuki Kimoto | ||||||
2 | // MIT License | ||||||
3 | |||||||
4 | // This is for XSI strerror_r | ||||||
5 | #define _POSIX_C_SOURCE 200112L | ||||||
6 | #undef _GNU_SOURCE | ||||||
7 | |||||||
8 | #include "spvm_native.h" | ||||||
9 | #include |
||||||
10 | |||||||
11 | 8 | int32_t SPVM_STRERROR_strerror(int errnum, char *buf, size_t buflen) { | |||||
12 | |||||||
13 | int32_t status; | ||||||
14 | |||||||
15 | #ifdef _WIN32 | ||||||
16 | status = strerror_s(buf, buflen, errnum); | ||||||
17 | #else | ||||||
18 | 8 | status = strerror_r(errnum, buf, buflen); | |||||
19 | #endif | ||||||
20 | |||||||
21 | 8 | return status; | |||||
22 | } |