* 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> 2001-04-11 Danny Smith <dannysmith@users.sourceforge.net>
* include/windows.h (#include <winsock.h>): Include <winsock2.h> * 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 szShortName[MIXER_SHORT_NAME_CHARS];
CHAR szName[MIXER_LONG_NAME_CHARS]; CHAR szName[MIXER_LONG_NAME_CHARS];
union { union {
struct { _ANONYMOUS_STRUCT struct {
LONG lMinimum; LONG lMinimum;
LONG lMaximum; LONG lMaximum;
}_STRUCT_NAME(s); }_STRUCT_NAME(s);
struct { _ANONYMOUS_STRUCT struct {
DWORD dwMinimum; DWORD dwMinimum;
DWORD dwMaximum; DWORD dwMaximum;
}_STRUCT_NAME(s1); }_STRUCT_NAME(s1);
@ -1210,11 +1210,11 @@ typedef struct tagMIXERCONTROLW {
WCHAR szShortName[MIXER_SHORT_NAME_CHARS]; WCHAR szShortName[MIXER_SHORT_NAME_CHARS];
WCHAR szName[MIXER_LONG_NAME_CHARS]; WCHAR szName[MIXER_LONG_NAME_CHARS];
union { union {
struct { _ANONYMOUS_STRUCT struct {
LONG lMinimum; LONG lMinimum;
LONG lMaximum; LONG lMaximum;
}_STRUCT_NAME(s); }_STRUCT_NAME(s);
struct { _ANONYMOUS_STRUCT struct {
DWORD dwMinimum; DWORD dwMinimum;
DWORD dwMaximum; DWORD dwMaximum;
}_STRUCT_NAME(s1); }_STRUCT_NAME(s1);
@ -1229,7 +1229,7 @@ typedef struct tagMIXERCONTROLW {
typedef struct tagMIXERLINECONTROLSA { typedef struct tagMIXERLINECONTROLSA {
DWORD cbStruct; DWORD cbStruct;
DWORD dwLineID; DWORD dwLineID;
union { _ANONYMOUS_UNION union {
DWORD dwControlID; DWORD dwControlID;
DWORD dwControlType; DWORD dwControlType;
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
@ -1240,7 +1240,7 @@ typedef struct tagMIXERLINECONTROLSA {
typedef struct tagMIXERLINECONTROLSW { typedef struct tagMIXERLINECONTROLSW {
DWORD cbStruct; DWORD cbStruct;
DWORD dwLineID; DWORD dwLineID;
union { _ANONYMOUS_UNION union {
DWORD dwControlID; DWORD dwControlID;
DWORD dwControlType; DWORD dwControlType;
} DUMMYUNIONNAME; } DUMMYUNIONNAME;
@ -1252,7 +1252,7 @@ typedef struct tMIXERCONTROLDETAILS {
DWORD cbStruct; DWORD cbStruct;
DWORD dwControlID; DWORD dwControlID;
DWORD cChannels; DWORD cChannels;
union { _ANONYMOUS_UNION union {
HWND hwndOwner; HWND hwndOwner;
DWORD cMultipleItems; DWORD cMultipleItems;
} DUMMYUNIONNAME; } DUMMYUNIONNAME;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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