From 2b8ca5a9d7496cc9709678e4226b705cb52010a4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 7 Aug 2022 14:47:41 -0700 Subject: [PATCH] fix compilation with mingw iconv The parameter there is const. Use the appropriate macro. Signed-off-by: Rosen Penev --- src/convert.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/convert.cpp b/src/convert.cpp index 93f49182..4ede29e6 100644 --- a/src/convert.cpp +++ b/src/convert.cpp @@ -1576,7 +1576,11 @@ bool convertStringCharsetIconv(std::string& str, const char* from, const char* t return false; } std::string outstr; +#ifdef WINICONV_CONST + auto inptr = (WINICONV_CONST char*)(str.c_str()); +#else auto inptr = const_cast(str.c_str()); +#endif size_t inbytesleft = str.length(); while (inbytesleft) { char outbuf[256];