summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortschoening <tschoening@13f79535-47bb-0310-9956-ffa450edef68>2014-02-10 14:09:43 +0000
committertschoening <tschoening@13f79535-47bb-0310-9956-ffa450edef68>2014-02-10 14:09:43 +0000
commitd20b684e7a4f9c24c2f5e4f3482b85b05954749c (patch)
tree16c3d4ffe753ceb28e0227d2a02c84374dc10608
parent4354a77b2eea1f56c1f1fd8fafc8432caf1bd9c7 (diff)
downloadlog4cxx-d20b684e7a4f9c24c2f5e4f3482b85b05954749c.tar.gz
LOGCXX-313: Build process fails in case of absence of iconv support in apr-util
git-svn-id: http://svn.apache.org/repos/asf/incubator/log4cxx/trunk@1566628 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/changes/changes.xml1
-rw-r--r--src/main/cpp/charsetdecoder.cpp14
-rw-r--r--src/main/cpp/charsetencoder.cpp10
3 files changed, 13 insertions, 12 deletions
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 3250bba..4478bfc 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,6 +54,7 @@
<action issue="LOGCXX-303" type="fix">DOMConfigurator does not set ErrorHandler.</action>
<action issue="LOGCXX-304" type="fix">BasicConfigurator::configure results in writer not set warning.</action>
<action issue="LOGCXX-305" type="fix">Property/DOMConfigurator::configureAndWatch can continue to run after APR termination</action>
+ <action issue="LOGCXX-313" type="fix">Build process fails in case of absence of iconv support in apr-util</action>
<action issue="LOGCXX-317" type="fix">Log4cxx triggers locking inversion which can result in a deadlock.</action>
<action issue="LOGCXX-319" type="fix">Please make sure that the LOG4CXX_* macro's can be used as ordinary statements.</action>
<action issue="LOGCXX-331" type="fix">DailyRollingFileAppender should roll if program doesn't run at rolling time</action>
diff --git a/src/main/cpp/charsetdecoder.cpp b/src/main/cpp/charsetdecoder.cpp
index 19534c0..d288725 100644
--- a/src/main/cpp/charsetdecoder.cpp
+++ b/src/main/cpp/charsetdecoder.cpp
@@ -122,7 +122,7 @@ namespace log4cxx
Mutex mutex;
apr_xlate_t *convset;
};
-
+
#endif
#if LOG4CXX_LOGCHAR_IS_WCHAR && LOG4CXX_HAS_MBSRTOWCS
@@ -365,12 +365,12 @@ private:
LogString& out) {
const char* p = in.current();
size_t i = in.position();
-#if !LOG4CXX_CHARSET_EBCDIC
+#if !LOG4CXX_CHARSET_EBCDIC
for (; i < in.limit() && ((unsigned int) *p) < 0x80; i++, p++) {
out.append(1, *p);
}
in.position(i);
-#endif
+#endif
if (i < in.limit()) {
Pool subpool;
const char* enc = apr_os_locale_encoding(subpool.getAPRPool());
@@ -392,9 +392,9 @@ private:
}
}
}
- return decoder->decode(in, out);
+ return decoder->decode(in, out);
}
- return APR_SUCCESS;
+ return APR_SUCCESS;
}
private:
Pool pool;
@@ -476,9 +476,9 @@ CharsetDecoderPtr CharsetDecoder::getDecoder(const LogString& charset) {
StringHelper::equalsIgnoreCase(charset, LOG4CXX_STR("ISO-LATIN-1"), LOG4CXX_STR("iso-latin-1"))) {
return new ISOLatinCharsetDecoder();
}
-#if APR_HAS_XLATE || !defined(_WIN32)
+#if APR_HAS_XLATE
return new APRCharsetDecoder(charset);
-#else
+#else
throw IllegalArgumentException(charset);
#endif
}
diff --git a/src/main/cpp/charsetencoder.cpp b/src/main/cpp/charsetencoder.cpp
index a5a09c4..18812e6 100644
--- a/src/main/cpp/charsetencoder.cpp
+++ b/src/main/cpp/charsetencoder.cpp
@@ -378,13 +378,13 @@ public:
char* current = out.current();
size_t remain = out.remaining();
for(;
- iter != in.end() && ((unsigned int) *iter) < 0x80 && remain > 0;
+ iter != in.end() && ((unsigned int) *iter) < 0x80 && remain > 0;
iter++, remain--, current++) {
*current = *iter;
}
out.position(current - out.data());
#endif
- if (iter != in.end() && out.remaining() > 0) {
+ if (iter != in.end() && out.remaining() > 0) {
Pool subpool;
const char* enc = apr_os_locale_encoding(subpool.getAPRPool());
{
@@ -438,7 +438,7 @@ CharsetEncoderPtr CharsetEncoder::getDefaultEncoder() {
// if invoked after static variable destruction
// (if logging is called in the destructor of a static object)
// then create a new decoder.
- //
+ //
if (encoder == 0) {
return createDefaultEncoder();
}
@@ -484,9 +484,9 @@ CharsetEncoderPtr CharsetEncoder::getEncoder(const LogString& charset) {
} else if (StringHelper::equalsIgnoreCase(charset, LOG4CXX_STR("UTF-16LE"), LOG4CXX_STR("utf-16le"))) {
return new UTF16LECharsetEncoder();
}
-#if APR_HAS_XLATE || !defined(_WIN32)
+#if APR_HAS_XLATE
return new APRCharsetEncoder(charset);
-#else
+#else
throw IllegalArgumentException(charset);
#endif
}