Skip to content

Commit

Permalink
fix(build): relace c16rtomb with wcrtomb on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Apr 29, 2024
1 parent 0b08431 commit e3911f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/io/Common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "_Internal.h"

#include <uchar.h>
#include <wchar.h>

void DmGuid_parse(DmGuid* slf, DmRiff* rif) {
DmRiff_read(rif, slf->data, sizeof slf->data);
Expand All @@ -20,7 +21,11 @@ static char* Dm_utf16ToUtf8Inline(char* out, char16_t const* u16) {
size_t i = 0;
size_t j = 0;
for (; i < len; ++i) {
#ifndef _WIN32
j += c16rtomb(out + j, u16[i], &state);
#else
j += wcrtomb(out + j, (wchar_t) u16[i], &state);
#endif
}

out[j] = '\0';
Expand Down

0 comments on commit e3911f0

Please sign in to comment.