View | Details | Raw Unified | Return to bug 215393 | Differences between
and this patch

Collapse All | Expand All

(-)devel/boost-libs/files/patch-libs_locale_src_encoding_iconv_codepage.ipp (+11 lines)
Line 0 Link Here
1
--- libs/locale/src/encoding/iconv_codepage.ipp.orig	2017-09-02 09:56:14 UTC
2
+++ libs/locale/src/encoding/iconv_codepage.ipp
3
@@ -43,7 +43,7 @@ class iconverter_base { (public)
4
     bool open(char const *to,char const *from,method_type how)
5
     {
6
         close();
7
-        cvt_ = iconv_open(to,from);
8
+        cvt_ = call_iconv_open(to,from);
9
         how_ = how;
10
         return cvt_ != (iconv_t)(-1);
11
     }
(-)devel/boost-libs/files/patch-libs_locale_src_posix_codecvt.cpp (+20 lines)
Line 0 Link Here
1
--- libs/locale/src/posix/codecvt.cpp.orig	2017-09-02 09:56:14 UTC
2
+++ libs/locale/src/posix/codecvt.cpp
3
@@ -38,7 +38,7 @@ namespace impl_posix {
4
             iconv_t d = (iconv_t)(-1);
5
             std::vector<uint32_t> first_byte_table;
6
             try {
7
-                d = iconv_open(utf32_encoding(),encoding.c_str());
8
+                d = call_iconv_open(utf32_encoding(),encoding.c_str());
9
                 if(d == (iconv_t)(-1)) {
10
                     throw std::runtime_error("Unsupported encoding" + encoding);
11
                 }
12
@@ -186,7 +186,7 @@ namespace impl_posix {
13
         {
14
             if(d!=(iconv_t)(-1))
15
                 return;
16
-            d=iconv_open(to,from);
17
+            d=call_iconv_open(to,from);
18
         }
19
 
20
         static char const *utf32_encoding()
(-)devel/boost-libs/files/patch-libs_locale_src_util_iconv.hpp (+49 lines)
Line 0 Link Here
1
--- libs/locale/src/util/iconv.hpp.orig	2017-09-02 09:56:14 UTC
2
+++ libs/locale/src/util/iconv.hpp
3
@@ -12,27 +12,7 @@
4
 
5
 namespace boost {
6
     namespace locale {
7
-#if defined(__ICONV_F_HIDE_INVALID) && defined(__FreeBSD__)
8
         extern "C" {
9
-            typedef size_t (*const_iconv_ptr_type)(iconv_t d,char const **in,size_t *insize,char **out,size_t *outsize,uint32_t,size_t *);
10
-            typedef size_t (*nonconst_iconv_ptr_type)(iconv_t d,char **in,size_t *insize,char **out,size_t *outsize,uint32_t,size_t *);
11
-        }
12
-        inline size_t do_iconv(const_iconv_ptr_type ptr,iconv_t d,char **in,size_t *insize,char **out,size_t *outsize)
13
-        {
14
-            char const **rin = const_cast<char const **>(in);
15
-            return ptr(d,rin,insize,out,outsize,__ICONV_F_HIDE_INVALID,0);
16
-        }
17
-        inline size_t do_iconv(nonconst_iconv_ptr_type ptr,iconv_t d,char **in,size_t *insize,char **out,size_t *outsize)
18
-        {
19
-            return ptr(d,in,insize,out,outsize,__ICONV_F_HIDE_INVALID,0);
20
-        }
21
-        inline size_t call_iconv(iconv_t d,char **in,size_t *insize,char **out,size_t *outsize)
22
-        {
23
-            char const **rin = const_cast<char const **>(in);
24
-            return do_iconv(__iconv, d, in,insize,out,outsize);
25
-        }
26
-#else
27
-        extern "C" {
28
             typedef size_t (*gnu_iconv_ptr_type)(iconv_t d,char const **in,size_t *insize,char **out,size_t *outsize);
29
             typedef size_t (*posix_iconv_ptr_type)(iconv_t d,char **in,size_t *insize,char **out,size_t *outsize);
30
         }
31
@@ -49,8 +29,17 @@ namespace boost {
32
         {
33
             return do_iconv( iconv, d, in,insize,out,outsize);
34
         }
35
+        inline iconv_t call_iconv_open(char const *to,char const *from)
36
+        {
37
+            iconv_t d = iconv_open(to,from);
38
+#if defined(ICONV_SET_ILSEQ_INVALID) && defined(__FreeBSD__)
39
+            if(d != (iconv_t)(-1)) {
40
+                int ilseq_invalid = 1;
41
+                iconvctl(d,ICONV_SET_ILSEQ_INVALID,&ilseq_invalid);
42
+            }
43
 #endif
44
-
45
+            return d;
46
+        }
47
     } // locale 
48
 } // boost
49
 

Return to bug 215393