Author: tschoening Date: Mon Feb 10 14:09:43 2014 New Revision: 1566628 URL: http://svn.apache.org/r1566628 Log: LOGCXX-313: Build process fails in case of absence of iconv support in apr-util
Modified: incubator/log4cxx/trunk/src/changes/changes.xml incubator/log4cxx/trunk/src/main/cpp/charsetdecoder.cpp incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp Modified: incubator/log4cxx/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/changes/changes.xml?rev=1566628&r1=1566627&r2=1566628&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/changes/changes.xml (original) +++ incubator/log4cxx/trunk/src/changes/changes.xml Mon Feb 10 14:09:43 2014 @@ -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> Modified: incubator/log4cxx/trunk/src/main/cpp/charsetdecoder.cpp URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/charsetdecoder.cpp?rev=1566628&r1=1566627&r2=1566628&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/main/cpp/charsetdecoder.cpp (original) +++ incubator/log4cxx/trunk/src/main/cpp/charsetdecoder.cpp Mon Feb 10 14:09:43 2014 @@ -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::getDec 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 } Modified: incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp URL: http://svn.apache.org/viewvc/incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp?rev=1566628&r1=1566627&r2=1566628&view=diff ============================================================================== --- incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp (original) +++ incubator/log4cxx/trunk/src/main/cpp/charsetencoder.cpp Mon Feb 10 14:09:43 2014 @@ -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::getDef // 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::getEnc } 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 }