From e3911f0cf9efa156d961f2663ecddd8383590ec0 Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Mon, 29 Apr 2024 15:15:57 +0200 Subject: [PATCH] fix(build): relace `c16rtomb` with `wcrtomb` on Windows --- src/io/Common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/io/Common.c b/src/io/Common.c index 7dc4d81..754d20f 100644 --- a/src/io/Common.c +++ b/src/io/Common.c @@ -3,6 +3,7 @@ #include "_Internal.h" #include +#include void DmGuid_parse(DmGuid* slf, DmRiff* rif) { DmRiff_read(rif, slf->data, sizeof slf->data); @@ -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';