This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: misdefined macro _T in winnt.h


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 <windows.h>
>  #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.

> In addition, the Microsoft VisualC programming manual also says that _T macro
> is identical to _TEXT macro, which is not defined in winnt.h (but TEXT is
> defined).
> 

Ok, I agree that TEXT is incorrect.  But the definition of _T I don't
believe to be incorrect.  However, the MSDN documentation describes this
macro for tchar.h not for winnt.h.  The macro is correct for tchar.h.

> You will find an obvious patch for these 2 problems appended to this mail:

Your patch has problems:
1) you did a reversed patch
2) you don't include a ChangeLog entry.

I will take care of modifying w32api/include/winnt.h and give you credit
for pointing it out.

Earnie.

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]