aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEarnie Boyd <earnie@users.sf.net>2001-04-17 12:58:06 +0000
committerEarnie Boyd <earnie@users.sf.net>2001-04-17 12:58:06 +0000
commit91874e20bf881a7b519c2eeae57b07f456138f79 (patch)
tree2397d5f1b24de22c566c84393422b3f062a07e00
parent8aefe7c08b95d736d9e4ed7eee6bfd971191a67f (diff)
downloadnewlib-91874e20bf881a7b519c2eeae57b07f456138f79.zip
newlib-91874e20bf881a7b519c2eeae57b07f456138f79.tar.gz
newlib-91874e20bf881a7b519c2eeae57b07f456138f79.tar.bz2
* 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.
-rw-r--r--winsup/w32api/ChangeLog16
-rw-r--r--winsup/w32api/include/mmsystem.h14
-rw-r--r--winsup/w32api/include/oaidl.h6
-rw-r--r--winsup/w32api/include/objidl.h6
-rw-r--r--winsup/w32api/include/olectl.h2
-rw-r--r--winsup/w32api/include/prsht.h20
-rw-r--r--winsup/w32api/include/shlobj.h2
-rw-r--r--winsup/w32api/include/winbase.h6
-rw-r--r--winsup/w32api/include/windows.h10
-rw-r--r--winsup/w32api/include/winnt.h22
-rw-r--r--winsup/w32api/include/wtypes.h10
11 files changed, 66 insertions, 48 deletions
diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog
index 21f91bf..245a475 100644
--- a/winsup/w32api/ChangeLog
+++ b/winsup/w32api/ChangeLog
@@ -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>
diff --git a/winsup/w32api/include/mmsystem.h b/winsup/w32api/include/mmsystem.h
index a35a789..63451f9 100644
--- a/winsup/w32api/include/mmsystem.h
+++ b/winsup/w32api/include/mmsystem.h
@@ -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;
diff --git a/winsup/w32api/include/oaidl.h b/winsup/w32api/include/oaidl.h
index cc0e932..9eccd77 100644
--- a/winsup/w32api/include/oaidl.h
+++ b/winsup/w32api/include/oaidl.h
@@ -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;
diff --git a/winsup/w32api/include/objidl.h b/winsup/w32api/include/objidl.h
index 5a8fc3b..63d1448 100644
--- a/winsup/w32api/include/objidl.h
+++ b/winsup/w32api/include/objidl.h
@@ -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;
diff --git a/winsup/w32api/include/olectl.h b/winsup/w32api/include/olectl.h
index 97ea9f4..6c21630 100644
--- a/winsup/w32api/include/olectl.h
+++ b/winsup/w32api/include/olectl.h
@@ -325,7 +325,7 @@ typedef struct tagFONTDESC {
typedef struct tagPICTDESC {
UINT cbSizeofstruct;
UINT picType;
- union {
+ _ANONYMOUS_UNION union {
struct {
HBITMAP hbitmap;
HPALETTE hpal;
diff --git a/winsup/w32api/include/prsht.h b/winsup/w32api/include/prsht.h
index 8b2ab2d..296ea6b 100644
--- a/winsup/w32api/include/prsht.h
+++ b/winsup/w32api/include/prsht.h
@@ -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;
diff --git a/winsup/w32api/include/shlobj.h b/winsup/w32api/include/shlobj.h
index 77526cc..6f6eb87 100644
--- a/winsup/w32api/include/shlobj.h
+++ b/winsup/w32api/include/shlobj.h
@@ -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];
diff --git a/winsup/w32api/include/winbase.h b/winsup/w32api/include/winbase.h
index ed228b1..1713d61 100644
--- a/winsup/w32api/include/winbase.h
+++ b/winsup/w32api/include/winbase.h
@@ -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];
diff --git a/winsup/w32api/include/windows.h b/winsup/w32api/include/windows.h
index 59fc634..3b9273a 100644
--- a/winsup/w32api/include/windows.h
+++ b/winsup/w32api/include/windows.h
@@ -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
diff --git a/winsup/w32api/include/winnt.h b/winsup/w32api/include/winnt.h
index 1165426..35a0fac 100644
--- a/winsup/w32api/include/winnt.h
+++ b/winsup/w32api/include/winnt.h
@@ -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;
diff --git a/winsup/w32api/include/wtypes.h b/winsup/w32api/include/wtypes.h
index c35dcec..c540431 100644
--- a/winsup/w32api/include/wtypes.h
+++ b/winsup/w32api/include/wtypes.h
@@ -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);