qt patch for winnt.h

Christopher Faylor cgf@redhat.com
Thu Jul 25 10:40:00 GMT 2002

On Thu, Jul 25, 2002 at 01:15:38PM -0400, Nicholas Wourms wrote:
>Christopher Faylor wrote:
>>On Thu, Jul 25, 2002 at 11:29:20AM -0400, Nicholas Wourms wrote:
>>>2002-07-25  Nicholas Wourms  <nwourms@netscape.net>
>>>  * winnt.h (HANDLE): Add guard for compiling qt.
>>I really think this sets an incredibly bad precedent.  Littering the
>>system headers with project specific defines is really distasteful
>>to me.
>Perhaps you would prefer this better.  I changed the ifdef to be 
>feature-centric as opposed to project-centric.  Perhaps this is a little 
>more to your liking?

I do prefer feature-centric ifdefs, but I don't think that adding this
particular definition of HANDLE to the windows headers makes sense.
I'd rather see something like a "DONT_DEFINE_HANDLE" define and have
the handle defined elsewhere.

Isn't it possible to protect the handle with a define somewhere prior
to calling winnt.h and then undefine it after the includes?

I don't understand why the project needs a non-standard definition for
HANDLE unless they are using it in some other context than the Windows
one.  It is defined as a void * in my MSVC headers so why would
anyone try to use anything else?



>2002-07-25  Nicholas Wourms  <nwourms@netscape.net>
>    * winnt.h (HANDLE): Allow uint type for HANDLE.

>Index: winnt.h
>RCS file: /cvs/src/src/winsup/w32api/include/winnt.h,v
>retrieving revision 1.52
>diff -u -3 -p -u -p -r1.52 winnt.h
>--- winnt.h 17 Jul 2002 03:37:45 -0000  1.52
>+++ winnt.h 25 Jul 2002 15:09:11 -0000
>@@ -108,7 +108,11 @@ typedef const TCHAR *LPCTSTR;
> #define TEXT(q) __TEXT(q)    
> typedef SHORT *PSHORT;
> typedef LONG *PLONG;
>+#ifndef WINNT_H_UINT_HANDLE    /* Allow uint typedef for HANDLE  */
> typedef void *HANDLE;
>+typedef unsigned int HANDLE;
>+#endif /* WINNT_H_UINT_HANDLE */
> #ifdef STRICT
> #define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n

More information about the Cygwin-patches mailing list