7kaa: Fix build on NetBSD 9.99.17

Adapt the local patch for the POSIX iconv(3) API change in new NetBSD.
This commit is contained in:
kamil 2019-10-25 10:00:58 +00:00
parent 8fc38d0d69
commit cddc102971
2 changed files with 21 additions and 5 deletions

View file

@ -1,7 +1,7 @@
$NetBSD: distinfo,v 1.2 2019/07/19 09:13:50 nia Exp $
$NetBSD: distinfo,v 1.3 2019/10/25 10:00:58 kamil Exp $
SHA1 (7kaa-2.15.2.tar.xz) = 12ee27dc4f49e969edfff7593b06ac47f22ca6b7
RMD160 (7kaa-2.15.2.tar.xz) = 39a358665bb5e88643d124cdee70da6558a50ca9
SHA512 (7kaa-2.15.2.tar.xz) = df053b9934fa3fc32a9a0a239fdafdfb7e441b7e98e280d1c74622f867919be48335ddbc54abb06b12b11e4a84b7a20ebb244fac9e4d7aebb8ad3cbe3192c29a
Size (7kaa-2.15.2.tar.xz) = 46821276 bytes
SHA1 (patch-src_LocaleRes.cpp) = ba6c201dbf2f9dbae1a6c8bc4e46e88b5eb61e8c
SHA1 (patch-src_LocaleRes.cpp) = e7d1be36769b225912930960771dab9ea6290e72

View file

@ -1,14 +1,30 @@
$NetBSD: patch-src_LocaleRes.cpp,v 1.2 2019/07/19 09:13:51 nia Exp $
$NetBSD: patch-src_LocaleRes.cpp,v 1.3 2019/10/25 10:00:58 kamil Exp $
Support NetBSD and SunOS iconv being special.
--- src/LocaleRes.cpp.orig 2019-06-22 22:22:26.000000000 +0000
+++ src/LocaleRes.cpp
@@ -169,7 +169,11 @@ const char *LocaleRes::conv_str(iconv_t
@@ -30,6 +30,15 @@
#include <ODB.h>
#include <LocaleRes.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
+
//------------- End of function Constructor -------//
//
LocaleRes::LocaleRes()
@@ -169,7 +178,11 @@ const char *LocaleRes::conv_str(iconv_t
size_t c;
while( in_left>0 )
{
+#if defined(__NetBSD__) || defined(__sun)
+#if (defined(__NetBSD__) && !NETBSD_POSIX_ICONV) || defined(__sun)
+ c = iconv(cd, (const char **)&p1, &in_left, &p2, &out_left);
+#else
c = iconv(cd, &p1, &in_left, &p2, &out_left);