open-plc-utils: new package
[buildroot-gz.git] / package / log4cxx / 0001-charset-fixes.patch
blob75567fdad198ca335cce536e6f52d8cd365af2a2
1 Fix build when iconv support is not available
3 When iconv support is not available, the apr-util library does not
4 provide character set conversion features, and therefore APR_HAS_XLATE
5 is false.
7 However, on Linux !defined(_WIN32) is always true, but the part of the
8 code that defines the APRCharsetDecoder and APRCharsetEncoder are only
9 enclosed in a #if APR_HAS_XLATE, without the "|| defined(_WIN32)"
10 which leads to build failures: the APRCharsetEncoder and
11 APRCharsetDecoder classes are used without being defined.
13 This patch removes the || !defined(_WIN32) so that when iconv support
14 is not here, we fall back to raising an exception at runtime.
16 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
18 Index: b/src/main/cpp/charsetdecoder.cpp
19 ===================================================================
20 --- a/src/main/cpp/charsetdecoder.cpp
21 +++ b/src/main/cpp/charsetdecoder.cpp
22 @@ -476,7 +476,7 @@
23 StringHelper::equalsIgnoreCase(charset, LOG4CXX_STR("ISO-LATIN-1"), LOG4CXX_STR("iso-latin-1"))) {
24 return new ISOLatinCharsetDecoder();
26 -#if APR_HAS_XLATE || !defined(_WIN32)
27 +#if APR_HAS_XLATE
28 return new APRCharsetDecoder(charset);
29 #else
30 throw IllegalArgumentException(charset);
31 Index: b/src/main/cpp/charsetencoder.cpp
32 ===================================================================
33 --- a/src/main/cpp/charsetencoder.cpp
34 +++ b/src/main/cpp/charsetencoder.cpp
35 @@ -484,7 +484,7 @@
36 } else if (StringHelper::equalsIgnoreCase(charset, LOG4CXX_STR("UTF-16LE"), LOG4CXX_STR("utf-16le"))) {
37 return new UTF16LECharsetEncoder();
39 -#if APR_HAS_XLATE || !defined(_WIN32)
40 +#if APR_HAS_XLATE
41 return new APRCharsetEncoder(charset);
42 #else
43 throw IllegalArgumentException(charset);