logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Rohead" <sean.roh...@nextpage.com>
Subject RE: win32 and UNICODE
Date Tue, 24 Aug 2004 22:15:57 GMT
I am still confused.  I am including windows' tchar.h before
log4cxx/logger.h.  Here's what windows' tchar.h looks like:

#ifndef _TCHAR_DEFINED
#if     !__STDC__
typedef wchar_t     TCHAR;
#endif
#define _TCHAR_DEFINED
#endif


Notice how it #defines _TCHAR_DEFINED.  However, log4cxx/helpers/tchar.h
looks for TCHAR to be #defined:

#ifndef TCHAR
	typedef wchar_t TCHAR;
#endif


Since windows has not #defined this, this results in a duplicate
definition.  I tried adding #define TCHAR to my code before including
log4cxx/logger.h, but that just results in all uses of TCHAR being
replaced by the preprocessor with the empty string.

Thanks!

Sean


-----Original Message-----
From: Curt Arnold [mailto:carnold@apache.org] 
Sent: Monday, August 23, 2004 3:19 PM
To: Log4CXX User
Subject: Re: win32 and UNICODE


On Aug 23, 2004, at 3:28 PM, Sean Rohead wrote:

> I'm trying to use log4cxx in a win32 Unicode project and am having
some
> difficulties.  If I don't #define UNICODE, the log4cxx::String is a
> basic_string<char> (because windows uses _UNICODE).  If I do #define
> UNICODE, then I get:
>
There are some pretty serious deficiencies with the UNICODE 
implementation which I've been assigned to rework.  The bug for this 
work is http://nagoya.apache.org/jira/browse/LOGCXX-10.  Reviewing that 
bug should get you up to speed on the discussion so far.

I believe the trick to get the current implementation to work is to 
force the Windows Platform SDK's version of tchar.h to be included 
before including log4cxx/logger.h.



Mime
View raw message