diff options
Diffstat (limited to 'wm/icewm14/patches/patch-src_ylocale.cc')
-rw-r--r-- | wm/icewm14/patches/patch-src_ylocale.cc | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/wm/icewm14/patches/patch-src_ylocale.cc b/wm/icewm14/patches/patch-src_ylocale.cc index ce19f8a71fd..e42d9f9bc58 100644 --- a/wm/icewm14/patches/patch-src_ylocale.cc +++ b/wm/icewm14/patches/patch-src_ylocale.cc @@ -1,8 +1,23 @@ -$NetBSD: patch-src_ylocale.cc,v 1.1 2018/11/01 09:25:29 bsiegert Exp $ +$NetBSD: patch-src_ylocale.cc,v 1.2 2019/10/25 10:21:32 kamil Exp $ ---- src/ylocale.cc.orig 2017-07-30 08:53:35.000000000 +0000 +--- src/ylocale.cc.orig 2017-07-30 08:53:35.524267864 +0000 +++ src/ylocale.cc -@@ -55,6 +55,8 @@ YLocale::YLocale(char const * localeName +@@ -28,6 +28,14 @@ + #include "ylib.h" + #include "yprefs.h" + ++#if defined(__NetBSD__) ++#include <sys/param.h> ++#if __NetBSD_Prereq__(9,99,17) ++#define NETBSD_POSIX_ICONV 1 ++#else ++#define NETBSD_POSIX_ICONV 0 ++#endif ++#endif + + #ifdef CONFIG_I18N + YLocale * YLocale::instance(NULL); +@@ -55,6 +63,8 @@ YLocale::YLocale(char const * localeName int const codesetItems[] = { #ifdef CONFIG_NL_CODESETS CONFIG_NL_CODESETS @@ -11,11 +26,11 @@ $NetBSD: patch-src_ylocale.cc,v 1.1 2018/11/01 09:25:29 bsiegert Exp $ #else CODESET, _NL_CTYPE_CODESET_NAME, 0 #endif -@@ -159,7 +161,11 @@ YUChar *YLocale::unicodeString(const YLC +@@ -159,7 +169,11 @@ YUChar *YLocale::unicodeString(const YLC char * inbuf((char *) lStr), * outbuf((char *) uStr); size_t inlen(lLen), outlen(4 * lLen); -+#if defined(__NetBSD__) || defined(__sun) ++#if (defined(__NetBSD__) && !NETBSD_POSIX_ICONV) || defined(__sun) + if (0 > (int) iconv(instance->toUnicode, const_cast<const char **>(&inbuf), &inlen, &outbuf, &outlen)) +#else if (0 > (int) iconv(instance->toUnicode, &inbuf, &inlen, &outbuf, &outlen)) |