* include/windows.h: Define _ANONYMOUS_STRUCT and _ANONYMOUS_UNION

as __extenstion__ when appropriate.
	* include/mmsystem.h: Mark anonymous structs and unions as
	__extension__ to prevent compiler warning when invoked with
	-pedantic
	* include/oaidl.h: Ditto.
	* include/objidl.h: Ditto.
	* include/olectl.h: Ditto.
	* include/prsht.h: Ditto.
	* include/shlobj.h: Ditto.
	* include/winbase.h: Ditto.
	* include/winnt.h: Ditto.
	* include/wtypes.h: Ditto.
This commit is contained in:
Earnie Boyd 2001-04-17 12:58:06 +00:00
parent 8aefe7c08b
commit 91874e20bf
11 changed files with 66 additions and 48 deletions

View File

@ -1,4 +1,20 @@
2001-04-17 Egor Duda <deo@logos-m.ru>
* include/windows.h: Define _ANONYMOUS_STRUCT and _ANONYMOUS_UNION
as __extenstion__ when appropriate.
* include/mmsystem.h: Mark anonymous structs and unions as
__extension__ to prevent compiler warning when invoked with
-pedantic
* include/oaidl.h: Ditto.
* include/objidl.h: Ditto.
* include/olectl.h: Ditto.
* include/prsht.h: Ditto.
* include/shlobj.h: Ditto.
* include/winbase.h: Ditto.
* include/winnt.h: Ditto.
* include/wtypes.h: Ditto.
2001-04-11 Danny Smith <dannysmith@users.sourceforge.net>
* include/windows.h (#include <winsock.h>): Include <winsock2.h>

View File

@ -1185,11 +1185,11 @@ typedef struct tagMIXERCONTROLA {
CHAR szShortName[MIXER_SHORT_NAME_CHARS];
CHAR szName[MIXER_LONG_NAME_CHARS];
union {
struct {
_ANONYMOUS_STRUCT struct {
LONG lMinimum;
LONG lMaximum;
}_STRUCT_NAME(s);
struct {
_ANONYMOUS_STRUCT struct {
DWORD dwMinimum;
DWORD dwMaximum;
}_STRUCT_NAME(s1);
@ -1210,11 +1210,11 @@ typedef struct tagMIXERCONTROLW {
WCHAR szShortName[MIXER_SHORT_NAME_CHARS];
WCHAR szName[MIXER_LONG_NAME_CHARS];
union {
struct {
_ANONYMOUS_STRUCT struct {
LONG lMinimum;
LONG lMaximum;
}_STRUCT_NAME(s);
struct {
_ANONYMOUS_STRUCT struct {
DWORD dwMinimum;
DWORD dwMaximum;
}_STRUCT_NAME(s1);
@ -1229,7 +1229,7 @@ typedef struct tagMIXERCONTROLW {
typedef struct tagMIXERLINECONTROLSA {
DWORD cbStruct;
DWORD dwLineID;
union {
_ANONYMOUS_UNION union {
DWORD dwControlID;
DWORD dwControlType;
} DUMMYUNIONNAME;
@ -1240,7 +1240,7 @@ typedef struct tagMIXERLINECONTROLSA {
typedef struct tagMIXERLINECONTROLSW {
DWORD cbStruct;
DWORD dwLineID;
union {
_ANONYMOUS_UNION union {
DWORD dwControlID;
DWORD dwControlType;
} DUMMYUNIONNAME;
@ -1252,7 +1252,7 @@ typedef struct tMIXERCONTROLDETAILS {
DWORD cbStruct;
DWORD dwControlID;
DWORD cChannels;
union {
_ANONYMOUS_UNION union {
HWND hwndOwner;
DWORD cMultipleItems;
} DUMMYUNIONNAME;

View File

@ -216,7 +216,7 @@ typedef struct _wireVARIANT {
USHORT wReserved1;
USHORT wReserved2;
USHORT wReserved3;
union {
_ANONYMOUS_UNION union {
LONG lVal;
BYTE bVal;
SHORT iVal;
@ -292,7 +292,7 @@ typedef struct tagIDLDESC {
}IDLDESC,*LPIDLDESC;
typedef struct tagELEMDESC {
TYPEDESC tdesc;
union {
_ANONYMOUS_UNION union {
IDLDESC idldesc;
PARAMDESC paramdesc;
} DUMMYUNIONNAME;
@ -367,7 +367,7 @@ typedef enum tagVARKIND {
typedef struct tagVARDESC {
MEMBERID memid;
LPOLESTR lpstrSchema;
union {
_ANONYMOUS_UNION union {
ULONG oInst;
VARIANT *lpvarValue;
} DUMMYUNIONNAME;

View File

@ -151,7 +151,7 @@ typedef enum tagBIND_FLAGS {
} BIND_FLAGS;
typedef struct tagSTGMEDIUM {
DWORD tymed;
union {
_ANONYMOUS_UNION union {
HBITMAP hBitmap;
PVOID hMetaFilePict;
HENHMETAFILE hEnhMetaFile;
@ -297,7 +297,7 @@ typedef struct tagPROPVARIANT {
WORD wReserved1;
WORD wReserved2;
WORD wReserved3;
union {
_ANONYMOUS_UNION union {
UCHAR bVal;
short iVal;
USHORT uiVal;
@ -349,7 +349,7 @@ typedef struct tagPROPVARIANT {
} PROPVARIANT;
typedef struct tagPROPSPEC {
ULONG ulKind;
union {
_ANONYMOUS_UNION union {
PROPID propid;
LPOLESTR lpwstr;
} DUMMYUNIONNAME;

View File

@ -325,7 +325,7 @@ typedef struct tagFONTDESC {
typedef struct tagPICTDESC {
UINT cbSizeofstruct;
UINT picType;
union {
_ANONYMOUS_UNION union {
struct {
HBITMAP hbitmap;
HPALETTE hpal;

View File

@ -97,11 +97,11 @@ typedef struct _PROPSHEETPAGEA {
DWORD dwSize;
DWORD dwFlags;
HINSTANCE hInstance;
union {
_ANONYMOUS_UNION union {
LPCSTR pszTemplate;
LPCDLGTEMPLATE pResource;
} DUMMYUNIONNAME;
union {
_ANONYMOUS_UNION union {
HICON hIcon;
LPCSTR pszIcon;
} DUMMYUNIONNAME2;
@ -116,11 +116,11 @@ typedef struct _PROPSHEETPAGEW {
DWORD dwSize;
DWORD dwFlags;
HINSTANCE hInstance;
union {
_ANONYMOUS_UNION union {
LPCWSTR pszTemplate;
LPCDLGTEMPLATE pResource;
} DUMMYUNIONNAME;
union {
_ANONYMOUS_UNION union {
HICON hIcon;
LPCWSTR pszIcon;
} DUMMYUNIONNAME2;
@ -140,17 +140,17 @@ typedef struct _PROPSHEETHEADERA {
DWORD dwFlags;
HWND hwndParent;
HINSTANCE hInstance;
union {
_ANONYMOUS_UNION union {
HICON hIcon;
LPCSTR pszIcon;
}DUMMYUNIONNAME;
LPCSTR pszCaption;
UINT nPages;
union {
_ANONYMOUS_UNION union {
UINT nStartPage;
LPCSTR pStartPage;
}DUMMYUNIONNAME2;
union {
_ANONYMOUS_UNION union {
LPCPROPSHEETPAGEA ppsp;
HPROPSHEETPAGE *phpage;
}DUMMYUNIONNAME3;
@ -162,17 +162,17 @@ typedef struct _PROPSHEETHEADERW {
DWORD dwFlags;
HWND hwndParent;
HINSTANCE hInstance;
union {
_ANONYMOUS_UNION union {
HICON hIcon;
LPCWSTR pszIcon;
}DUMMYUNIONNAME;
LPCWSTR pszCaption;
UINT nPages;
union {
_ANONYMOUS_UNION union {
UINT nStartPage;
LPCWSTR pStartPage;
}DUMMYUNIONNAME2;
union {
_ANONYMOUS_UNION union {
LPCPROPSHEETPAGEW ppsp;
HPROPSHEETPAGE *phpage;
}DUMMYUNIONNAME3;

View File

@ -272,7 +272,7 @@ typedef enum tagSHCONTF {
} SHCONTF;
typedef struct _STRRET {
UINT uType;
union {
_ANONYMOUS_UNION union {
LPWSTR pOleStr;
UINT uOffset;
char cStr[MAX_PATH];

View File

@ -807,9 +807,9 @@ typedef enum _GET_FILEEX_INFO_LEVELS {
GetFileExMaxInfoLevel
} GET_FILEEX_INFO_LEVELS;
typedef struct _SYSTEM_INFO {
union {
_ANONYMOUS_UNION union {
DWORD dwOemId;
struct {
_ANONYMOUS_STRUCT struct {
WORD wProcessorArchitecture;
WORD wReserved;
} DUMMYSTRUCTNAME;
@ -897,7 +897,7 @@ typedef struct _PROCESS_HEAP_ENTRY {
BYTE cbOverhead;
BYTE iRegionIndex;
WORD wFlags;
union {
_ANONYMOUS_UNION union {
struct {
HANDLE hMem;
DWORD dwReserved[3];

View File

@ -42,18 +42,19 @@
#ifdef __GNUC__
#ifndef NONAMELESSUNION
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
#define _ANONYMOUS_UNION
#define _ANONYMOUS_STRUCT
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
#define _ANONYMOUS_UNION __extension__
#define _ANONYMOUS_STRUCT __extension__
#else
#if defined(__cplusplus)
#define _ANONYMOUS_UNION
#define _ANONYMOUS_UNION __extension__
#endif
#endif /* __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) */
#endif /* NONAMELESSUNION */
#endif /* __GNUC__ */
#ifndef _ANONYMOUS_UNION
#define _ANONYMOUS_UNION
#define _UNION_NAME(x) x
#define DUMMYUNIONNAME u
#define DUMMYUNIONNAME2 u2
@ -75,6 +76,7 @@
#define DUMMYUNIONNAME8
#endif
#ifndef _ANONYMOUS_STRUCT
#define _ANONYMOUS_STRUCT
#define _STRUCT_NAME(x) x
#define DUMMYSTRUCTNAME s
#define DUMMYSTRUCTNAME2 s2

View File

@ -1693,7 +1693,7 @@ typedef struct _EXCEPTION_POINTERS {
PCONTEXT ContextRecord;
} EXCEPTION_POINTERS,*PEXCEPTION_POINTERS,*LPEXCEPTION_POINTERS;
typedef union _LARGE_INTEGER {
struct {
_ANONYMOUS_STRUCT struct {
DWORD LowPart;
LONG HighPart;
}_STRUCT_NAME(u);
@ -1701,7 +1701,7 @@ typedef union _LARGE_INTEGER {
} LARGE_INTEGER;
typedef LARGE_INTEGER *PLARGE_INTEGER;
typedef union _ULARGE_INTEGER {
struct {
_ANONYMOUS_STRUCT struct {
DWORD LowPart;
DWORD HighPart;
}_STRUCT_NAME(u);
@ -2231,7 +2231,7 @@ typedef struct _IMAGE_COFF_SYMBOLS_HEADER {
DWORD RvaToLastByteOfData;
} IMAGE_COFF_SYMBOLS_HEADER,*PIMAGE_COFF_SYMBOLS_HEADER;
typedef struct _IMAGE_RELOCATION {
union {
_ANONYMOUS_UNION union {
DWORD VirtualAddress;
DWORD RelocCount;
} DUMMYUNIONNAME;
@ -2290,7 +2290,7 @@ typedef struct _IMAGE_THUNK_DATA {
} u1;
} IMAGE_THUNK_DATA,*PIMAGE_THUNK_DATA;
typedef struct _IMAGE_IMPORT_DESCRIPTOR {
union {
_ANONYMOUS_UNION union {
DWORD Characteristics;
PIMAGE_THUNK_DATA OriginalFirstThunk;
} DUMMYUNIONNAME;
@ -2326,18 +2326,18 @@ typedef struct _IMAGE_RESOURCE_DIRECTORY {
WORD NumberOfNamedEntries;
WORD NumberOfIdEntries;
} IMAGE_RESOURCE_DIRECTORY,*PIMAGE_RESOURCE_DIRECTORY;
typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
union {
struct {
_ANONYMOUS_STRUCT typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
_ANONYMOUS_UNION union {
_ANONYMOUS_STRUCT struct {
DWORD NameOffset:31;
DWORD NameIsString:1;
}DUMMYSTRUCTNAME;
DWORD Name;
WORD Id;
} DUMMYUNIONNAME;
union {
_ANONYMOUS_UNION union {
DWORD OffsetToData;
struct {
_ANONYMOUS_STRUCT struct {
DWORD OffsetToDirectory:31;
DWORD DataIsDirectory:1;
} DUMMYSTRUCTNAME2;
@ -2455,7 +2455,7 @@ typedef struct _NT_TIB {
PVOID StackBase;
PVOID StackLimit;
PVOID SubSystemTib;
union {
_ANONYMOUS_UNION union {
PVOID FiberData;
DWORD Version;
} DUMMYUNIONNAME;
@ -2466,7 +2466,7 @@ typedef struct _REPARSE_DATA_BUFFER {
DWORD ReparseTag;
WORD ReparseDataLength;
WORD Reserved;
union {
_ANONYMOUS_UNION union {
struct {
WORD SubstituteNameOffset;
WORD SubstituteNameLength;

View File

@ -78,7 +78,7 @@ typedef BSTR *LPBSTR;
typedef LONG SCODE;
typedef void *HCONTEXT;
typedef union tagCY {
struct {
_ANONYMOUS_STRUCT struct {
unsigned long Lo;
long Hi;
}_STRUCT_NAME(s);
@ -138,16 +138,16 @@ typedef struct _HYPER_SIZEDARR {
typedef double DOUBLE;
typedef struct tagDEC {
USHORT wReserved;
union {
struct {
_ANONYMOUS_UNION union {
_ANONYMOUS_STRUCT struct {
BYTE scale;
BYTE sign;
}_STRUCT_NAME(s);
USHORT signscale;
} DUMMYUNIONNAME;
ULONG Hi32;
union {
struct {
_ANONYMOUS_UNION union {
_ANONYMOUS_STRUCT struct {
ULONG Lo32;
ULONG Mid32;
}_STRUCT_NAME(s2);