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
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
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)
28 return new APRCharsetDecoder(charset);
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
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)
41 return new APRCharsetEncoder(charset);
43 throw IllegalArgumentException(charset);