diff options
author | nia <nia@pkgsrc.org> | 2022-09-18 12:21:18 +0000 |
---|---|---|
committer | nia <nia@pkgsrc.org> | 2022-09-18 12:21:18 +0000 |
commit | d6607788aebe6c4016e5fd15b4ff8454afcffb75 (patch) | |
tree | 98f93a1a5977e544a6d15bf4b748f6e89cb0b6b2 /chat | |
parent | 108bf4a18ee70848d21d3b8ae89cb00ef0e2b045 (diff) | |
download | pkgsrc-d6607788aebe6c4016e5fd15b4ff8454afcffb75.tar.gz |
swirc: Fix building on NetBSD 9
Diffstat (limited to 'chat')
-rw-r--r-- | chat/swirc/distinfo | 3 | ||||
-rw-r--r-- | chat/swirc/patches/patch-src_printtext.cpp | 36 |
2 files changed, 38 insertions, 1 deletions
diff --git a/chat/swirc/distinfo b/chat/swirc/distinfo index 5c58b76e429..25e370ef668 100644 --- a/chat/swirc/distinfo +++ b/chat/swirc/distinfo @@ -1,5 +1,6 @@ -$NetBSD: distinfo,v 1.3 2022/07/28 22:18:05 fcambus Exp $ +$NetBSD: distinfo,v 1.4 2022/09/18 12:21:18 nia Exp $ BLAKE2s (swirc-3.3.5.tgz) = 9723254acc50f0b8680c4f78bdef7934c1984a7b7fa91201360d4ee648862145 SHA512 (swirc-3.3.5.tgz) = 424b567709cd82aa84efb2623b52d4586077dab5e025c3dce8fae382a5de2a4531819b1f7fde353b84c462c7c7b6cac6142c7d807d05f534a7599d706237d4ee Size (swirc-3.3.5.tgz) = 291300 bytes +SHA1 (patch-src_printtext.cpp) = 476d813c9c4aff2c3d81920d66aa5baafddfaaaa diff --git a/chat/swirc/patches/patch-src_printtext.cpp b/chat/swirc/patches/patch-src_printtext.cpp new file mode 100644 index 00000000000..2c27400e40f --- /dev/null +++ b/chat/swirc/patches/patch-src_printtext.cpp @@ -0,0 +1,36 @@ +$NetBSD: patch-src_printtext.cpp,v 1.1 2022/09/18 12:21:18 nia Exp $ + +Support iconv prototype on NetBSD 9 and earlier. + +--- src/printtext.cpp.orig 2022-07-28 13:19:25.000000000 +0000 ++++ src/printtext.cpp +@@ -39,6 +39,15 @@ + #include <iconv.h> + #endif + ++#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 ++ + #include "assertAPI.h" + #include "atomicops.h" + #ifdef UNIT_TESTING +@@ -1473,8 +1482,13 @@ get_buffer(const char *orig) + out[outbytes] = '\0'; + out_p = addrof(out[0]); + errno = 0; ++#if (defined(__NetBSD__) && !NETBSD_POSIX_ICONV) || defined(__sun) ++ if (iconv(cd, (const char **)&in, &inbytes, &out_p, &outbytes) == static_cast ++ <size_t>(-1)) { ++#else + if (iconv(cd, &in, &inbytes, &out_p, &outbytes) == static_cast + <size_t>(-1)) { ++#endif + free(orig_copy); + free(out); + (void) iconv_close(cd); |