Date: Tue, 21 Feb 2012 04:23:42 GMT From: Pedro Giffuni <giffunip@tutopia.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/165348: converters/libiconv solve problem related to C++ Message-ID: <201202210423.q1L4NgRV078653@red.freebsd.org> Resent-Message-ID: <201202210430.q1L4UAT1046317@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 165348 >Category: ports >Synopsis: converters/libiconv solve problem related to C++ >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Feb 21 04:30:10 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Pedro Giffuni >Release: 9.0-RELEASE >Organization: >Environment: FreeBSD pcbsd-8714 9.0-RELEASE FreeBSD 9.0-RELEASE #3: Tue Dec 27 14:14:29 PST 2011 root@build9x64.pcbsd.org:/usr/obj/builds/amd64/pcbsd-build90/fbsd-source/9.0/sys/GENERIC amd64 >Description: While building Apache OpenOffice we repeatedly saw a nasty error related to the use of the iconv header with C++: https://issues.apache.org/ooo/show_bug.cgi?id=118574 >How-To-Repeat: This is easy to reproduce in FreeBSD but it went noticed because linux uses a different libiconv from glibc. >Fix: Upstream author has acknowledged the error and says it was fixed for libiconv 1.14: http://git.savannah.gnu.org/gitweb/?p=libiconv.git;a=commitdiff;h=a47098b3779b9febf25e8a5ba1b0407e29d67acf Of course updating libiconv would solve the problem but for the time being the attached patch adds the fix to the current version 1.13.1. Patch attached with submission follows: diff -ruN libiconv.orig/files/patch-include_iconv.h.in libiconv/files/patch-include_iconv.h.in --- libiconv.orig/files/patch-include_iconv.h.in 1969-12-31 19:00:00.000000000 -0500 +++ libiconv/files/patch-include_iconv.h.in 2012-02-20 23:08:20.000000000 -0500 @@ -0,0 +1,44 @@ +diff --git include/iconv.h.in include/iconv.h.in +--- include/iconv.h.in ++++ include/iconv.h.in +@@ -89,6 +89,11 @@ extern size_t iconv (iconv_t cd, @ICONV_CONST@ char* * inbuf, size_t *inbyteslef + extern int iconv_close (iconv_t cd); + + ++#ifdef __cplusplus ++} ++#endif ++ ++ + #ifndef LIBICONV_PLUG + + /* Nonstandard extensions. */ +@@ -106,6 +111,10 @@ extern int iconv_close (iconv_t cd); + #include <wchar.h> + #endif + ++#ifdef __cplusplus ++extern "C" { ++#endif ++ + /* A type that holds all memory needed by a conversion descriptor. + A pointer to such an object can be used as an iconv_t. */ + typedef struct { +@@ -223,12 +232,11 @@ extern const char * iconv_canonicalize (const char * name); + extern void libiconv_set_relocation_prefix (const char *orig_prefix, + const char *curr_prefix); + +-#endif +- +- + #ifdef __cplusplus + } + #endif + ++#endif ++ + + #endif /* _LIBICONV_H */ +-- +1.7.2.5 + >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202210423.q1L4NgRV078653>