Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm Sender: cygwin-apps-owner AT cygwin DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps AT cygwin DOT com Delivered-To: mailing list cygwin-apps AT cygwin DOT com Message-ID: <3CCFC32B.3DF7AD12@yahoo.com> Date: Wed, 01 May 2002 06:27:55 -0400 From: Earnie Boyd X-Accept-Language: en MIME-Version: 1.0 To: Danny Smith CC: cygwin-apps , mingw-dvlpr Subject: Re: [MinGW-dvlpr] [w32api] : Move anonymous struct/union defines out of windows.h References: <20020501022052 DOT 7401 DOT qmail AT web14502 DOT mail DOT yahoo DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Fine by me. Earnie. Danny Smith wrote: > > Hello > > Can any one see any problems with moving this block of defines: > > #ifdef __GNUC__ > #ifndef NONAMELESSUNION > #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) > #define _ANONYMOUS_UNION __extension__ > #define _ANONYMOUS_STRUCT __extension__ > #else > #if defined(__cplusplus) > #define _ANONYMOUS_UNION __extension__ > #endif /* __cplusplus */ > #endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */ > #endif /* NONAMELESSUNION */ > #elif defined(__WATCOMC__) > #define _ANONYMOUS_UNION > #define _ANONYMOUS_STRUCT > #endif /* __GNUC__/__WATCOMC__ */ > > #ifndef _ANONYMOUS_UNION > #define _ANONYMOUS_UNION > #define _UNION_NAME(x) x > #define DUMMYUNIONNAME u > #define DUMMYUNIONNAME2 u2 > #define DUMMYUNIONNAME3 u3 > #define DUMMYUNIONNAME4 u4 > #define DUMMYUNIONNAME5 u5 > #define DUMMYUNIONNAME6 u6 > #define DUMMYUNIONNAME7 u7 > #define DUMMYUNIONNAME8 u8 > #else > #define _UNION_NAME(x) > #define DUMMYUNIONNAME > #define DUMMYUNIONNAME2 > #define DUMMYUNIONNAME3 > #define DUMMYUNIONNAME4 > #define DUMMYUNIONNAME5 > #define DUMMYUNIONNAME6 > #define DUMMYUNIONNAME7 > #define DUMMYUNIONNAME8 > #endif > #ifndef _ANONYMOUS_STRUCT > #define _ANONYMOUS_STRUCT > #define _STRUCT_NAME(x) x > #define DUMMYSTRUCTNAME s > #define DUMMYSTRUCTNAME2 s2 > #define DUMMYSTRUCTNAME3 s3 > #else > #define _STRUCT_NAME(x) > #define DUMMYSTRUCTNAME > #define DUMMYSTRUCTNAME2 > #define DUMMYSTRUCTNAME3 > #endif > > #ifndef NO_STRICT > #ifndef STRICT > #define STRICT 1 > #endif > #endif > > from windows.h to windef.h, which is the first w32api header that > windows.h includes. Thus anything that includes to get these > defines will still get them through windef.h > > Why? Often (specifically, in g++-v3 header gthr-win32.h, which is included > by STL userland headers to get inlined TLS functions) user only needs > the windef.h, winnt.h and winbase.h w32api declarations and defines. Doing > this: > > #include > #include /* includes winnt.h and winerror.h */ > #include > #ifdef __cplusplus > extern "C" > #endif > DWORD WINAPI GetLastError(void); /* from winuser.h */ > > is much preferable to: > > #include , even if we do the sort of MEANER_AND_LEANER dance > that winsup.h does. > > The anonymous union/structure business is needed in winnt.h and > elsewhere. I can't find any MSDN documnetation that says they should be in > windows.h, though > > Danny > > http://messenger.yahoo.com.au - Yahoo! Messenger > - A great way to communicate long-distance for FREE!