From 0859d2c4721d6f7748d60cd232f0006e0957ef2f Mon Sep 17 00:00:00 2001 From: Guilherme Janczak Date: Fri, 3 May 2024 00:30:15 +0000 Subject: improve NetBSD-specific code NetBSD doesn't put packages in /usr/local like /CMakeLists.txt thought. The `#ifdef __NetBSD__` around iconv was actually breaking compilation on NetBSD when using the system libiconv (there's also a GNU iconv package) A C program included from C++ source broke on NetBSD specifically, work around it. This doesn't fix compilation on NetBSD, which is currently broken, but is closer to correct. --- Source/Core/Common/StringUtil.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'Source/Core/Common/StringUtil.cpp') diff --git a/Source/Core/Common/StringUtil.cpp b/Source/Core/Common/StringUtil.cpp index f960d6fcc6..4551600b4e 100644 --- a/Source/Core/Common/StringUtil.cpp +++ b/Source/Core/Common/StringUtil.cpp @@ -35,9 +35,6 @@ constexpr u32 CODEPAGE_SHIFT_JIS = 932; constexpr u32 CODEPAGE_WINDOWS_1252 = 1252; #else -#if defined(__NetBSD__) -#define LIBICONV_PLUG -#endif #include #include #include @@ -528,13 +525,8 @@ std::string CodeTo(const char* tocode, const char* fromcode, std::basic_string_v while (src_bytes != 0) { size_t const iconv_result = -#if defined(__NetBSD__) - iconv(conv_desc, reinterpret_cast(&src_buffer), &src_bytes, &dst_buffer, - &dst_bytes); -#else iconv(conv_desc, const_cast(reinterpret_cast(&src_buffer)), &src_bytes, &dst_buffer, &dst_bytes); -#endif if ((size_t)-1 == iconv_result) { if (EILSEQ == errno || EINVAL == errno) -- cgit v1.2.3