Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <200102011244.NAA06873@mailhost.ri.silicomp.fr> To: Earnie Boyd cc: Eric PAIRE Subject: Re: misdefined macro _T in winnt.h In-reply-to: Your message of Wed, 31 Jan 2001 10:26:47 -0500. <3A782EB7 DOT BD09F881 AT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Feb 2001 13:44:45 +0100 From: Eric Paire Earnie Boyd wrote: > > Eric PAIRE wrote: > > > > Hi cygwin people, > > > > I have found a problem with the _T macro definition as it is defined in > > w32api/include/winnt.h: "#define _T TEXT" does not compile correctly the > > following small program: > > > > ------ Cut Here ------ Cut Here ------ Cut Here ------ Cut Here ------ > > #include > > #define __DIR "dir" > > > > main() { > > size_t len = wcslen(_T(__DIR)) + wcslen(_T("dir")); > > exit(len); > > } > > ------ Cut Here ------ Cut Here ------ Cut Here ------ Cut Here ------ > > > > What problems do you see compiling this with the current headers? I'm > not having problems compiling this example. > Sorry folks, I have forgotten to tell you to compile it with the _UNICODE and UNICODE defined. Here is a corrected version that has some problems when compiled: ------ Cut Here ------ Cut Here ------ Cut Here ------ Cut Here ------ #define __DIR "dir" #include #include main() { size_t len = wcslen(_T(__DIR)) + wcslen(_T("dir")); size_t len = wcslen(_TEXT(__DIR)) + wcslen(_TEXT("dir")); exit(len); } ------ Cut Here ------ Cut Here ------ Cut Here ------ Cut Here ------ You will see that the problem is around the evaluation of the __DIR macro (there is no problem with "dir"), both for _TEXT and _T. In addition, this should be fixed also for the _T and _TEXT definitions in , which should be coherent with those in (They are not for now, as _T is defined either as an object-like macro (in ) or as a function-like macro (in )). If you want me to provide you with a patch (and a ChangeLog), let me know... Best regards, -Eric +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ Eric PAIRE Web : http://www.ri.silicomp.com/~paire | Groupe SILICOMP - Research Institute Email: eric DOT paire AT ri DOT silicomp DOT com | 2, avenue de Vignate Phone: +33 (0) 476 63 48 71 | F-38610 Gieres Fax : +33 (0) 476 51 05 32 | FRANCE -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple