From 4957035be6b9aabe7556711233c6252cdf324724 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 3 Jan 2024 14:50:53 -0800 Subject: [PATCH] mikmod: fix compilation on Windows NarrowPath is needed. Signed-off-by: Rosen Penev --- src/decoder/plugins/MikmodDecoderPlugin.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/decoder/plugins/MikmodDecoderPlugin.cxx b/src/decoder/plugins/MikmodDecoderPlugin.cxx index f4b7b4d30..19dc98949 100644 --- a/src/decoder/plugins/MikmodDecoderPlugin.cxx +++ b/src/decoder/plugins/MikmodDecoderPlugin.cxx @@ -7,6 +7,7 @@ #include "lib/fmt/PathFormatter.hxx" #include "lib/fmt/RuntimeError.hxx" #include "tag/Handler.hxx" +#include "fs/NarrowPath.hxx" #include "fs/Path.hxx" #include "util/Domain.hxx" #include "Log.hxx" @@ -128,9 +129,10 @@ mikmod_decoder_finish() noexcept static void mikmod_decoder_file_decode(DecoderClient &client, Path path_fs) { + auto np = NarrowPath(path_fs); /* deconstify the path because libmikmod wants a non-const string pointer */ - char *const path2 = const_cast(path_fs.c_str()); + const auto path2 = const_cast(np.c_str()); MODULE *handle; int ret; @@ -167,9 +169,10 @@ mikmod_decoder_file_decode(DecoderClient &client, Path path_fs) static bool mikmod_decoder_scan_file(Path path_fs, TagHandler &handler) noexcept { + auto np = NarrowPath(path_fs); /* deconstify the path because libmikmod wants a non-const string pointer */ - char *const path2 = const_cast(path_fs.c_str()); + const auto path2 = const_cast(np.c_str()); MODULE *handle = Player_Load(path2, 128, 0);