You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by Tommi Mäkitalo <to...@epgmbh.de> on 2005/05/14 21:41:20 UTC

patch for autoconf

Hi,

I added a check for wchar_t and the header 
include/log4cxx/private/log4cxx_private.h in configure.in. Patch is attached.

It would have been easier to do a #define or #undef on 
LOG4CXX_LOGCHAR_IS_UTF8, because this is the normal behaviour for tests. But 
log4cxx.h.in expects a value for it. Should we change it or are there 
problems at the ant-side then?

Tommi

Re: patch for autoconf

Posted by Curt Arnold <ca...@apache.org>.
On May 16, 2005, at 3:47 AM, Tommi Mäkitalo wrote:

> Am Montag, 16. Mai 2005 10:19 schrieb Christophe de VIENNE:
>
>> Le Samedi 14 Mai 2005 21:52, Tommi Mäkitalo a écrit :
>>
>>> Sorry - updated - I forgot LOG4CXX_HAS_WCHAR_T. And now I read  
>>> once again
>>> the mail from Curt about LOG4CXX_HAS_WCHAR_T and  
>>> LOG4CXX_LOGCHAR_IS_UTF8.
>>>
>>
>> If I'm right your patch disable utf8 if wchar is present.
>> Personnaly I'd use utf-8 even if my compiler can use wchar. I'll soon
>> commit an up-to-date autoconf which permit to choose.
>>

That is why they are distinct macros.  You don't have an option when  
your compiler does not support wchar_t, logchar has to be UTF-8.   
However, if your compiler does have wchar_t, you have a choice.  My  
current thinking is the default logchar should be UTF-8 on Unix's and  
wchar_t on Windows.


Re: patch for autoconf

Posted by Tommi Mäkitalo <to...@epgmbh.de>.
Am Montag, 16. Mai 2005 10:19 schrieb Christophe de VIENNE:
> Le Samedi 14 Mai 2005 21:52, Tommi Mäkitalo a écrit :
> > Sorry - updated - I forgot LOG4CXX_HAS_WCHAR_T. And now I read once again
> > the mail from Curt about LOG4CXX_HAS_WCHAR_T and LOG4CXX_LOGCHAR_IS_UTF8.
>
> If I'm right your patch disable utf8 if wchar is present.
> Personnaly I'd use utf-8 even if my compiler can use wchar. I'll soon
> commit an up-to-date autoconf which permit to choose.
>
> Regards,
>
> Christophe
Yes. That's how I interpreted Curts comment:

> LOG4CXX_LOGCHAR_IS_UTF8 indicates that LogString (the internal string 
> type) is a std::string encoded in UTF-8.  Currently either 
> LOG4CXX_LOGCHAR_IS_UTF8 or LOG4CXX_LOGCHAR_IS_WCHAR is 1 and the other 
> 0.  It is possible, but unlikely, that at some future date that other 
> options for LogString would be provided.

But if you have a improved solution, that's great.

By the way - I replaced include/log4cxx/private/log4cxx.h with 
include/log4cxx/log4cxx.h, include/log4cxx/private/log4cxx_private.h and 
include/log4cxx/private/Makefile in AC_CONFIG_FILES. I attach my current diff 
here. After that log4cxx compiled and the examples run fine.

Tommi

Re: patch for autoconf

Posted by Christophe de VIENNE <cd...@alphacent.com>.
Le Samedi 14 Mai 2005 21:52, Tommi Mäkitalo a écrit :
> Sorry - updated - I forgot LOG4CXX_HAS_WCHAR_T. And now I read once again
> the mail from Curt about LOG4CXX_HAS_WCHAR_T and LOG4CXX_LOGCHAR_IS_UTF8.

If I'm right your patch disable utf8 if wchar is present.
Personnaly I'd use utf-8 even if my compiler can use wchar. I'll soon commit 
an up-to-date autoconf which permit to choose.

Regards,

Christophe

Re: patch for autoconf

Posted by Tommi Mäkitalo <to...@epgmbh.de>.
Sorry - updated - I forgot LOG4CXX_HAS_WCHAR_T. And now I read once again the 
mail from Curt about LOG4CXX_HAS_WCHAR_T and LOG4CXX_LOGCHAR_IS_UTF8.