Skip to content

Commit

Permalink
LOGCXX-313: Build process fails in case of absence of iconv support i…
Browse files Browse the repository at this point in the history
…n apr-util
  • Loading branch information
Thorsten Schöning committed Feb 10, 2014
1 parent a4b4507 commit 33ca357
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/changes/changes.xml
Expand Up @@ -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>
Expand Down
14 changes: 7 additions & 7 deletions src/main/cpp/charsetdecoder.cpp
Expand Up @@ -122,7 +122,7 @@ namespace log4cxx
Mutex mutex;
apr_xlate_t *convset;
};

#endif

#if LOG4CXX_LOGCHAR_IS_WCHAR && LOG4CXX_HAS_MBSRTOWCS
Expand Down Expand Up @@ -365,12 +365,12 @@ class USASCIICharsetDecoder : public CharsetDecoder
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());
Expand All @@ -392,9 +392,9 @@ class USASCIICharsetDecoder : public CharsetDecoder
}
}
}
return decoder->decode(in, out);
return decoder->decode(in, out);
}
return APR_SUCCESS;
return APR_SUCCESS;
}
private:
Pool pool;
Expand Down Expand Up @@ -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
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/cpp/charsetencoder.cpp
Expand Up @@ -378,13 +378,13 @@ class LocaleCharsetEncoder : public CharsetEncoder {
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());
{
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 33ca357

Please sign in to comment.