From 9d6a449a8fc6dd481ff80ce18c2df6679597a6f4 Mon Sep 17 00:00:00 2001 From: Kai Tietz Date: Sat, 27 Feb 2010 13:53:12 +0000 Subject: [PATCH] Make sure that unnamed union/struct are prefix by __GCC_EXTENSION. svn path=/branches/header-work/; revision=45694 --- include/ddk/bdasup.h | 11 ++++++++++- include/ddk/d3dhal.h | 11 ++++++++++- include/ddk/d3dnthal.h | 19 ++++++++++++++----- include/ddk/ddkmapi.h | 14 +++++++++++--- include/ddk/ddrawi.h | 39 ++++++++++++++++++++++++--------------- include/ddk/ddrawint.h | 24 ++++++++++++++++-------- include/ddk/dmemmgr.h | 11 ++++++++++- include/ddk/ide.h | 11 ++++++++++- include/ddk/minitape.h | 13 +++++++++++-- include/ddk/ndis.h | 23 ++++++++++++++++------- include/ddk/ntdddisk.h | 11 ++++++++++- include/ddk/ntifs.h | 19 ++++++++++++++----- include/ddk/stdunk.h | 11 ++++++++++- include/ddk/strmini.h | 21 +++++++++++++++------ include/ddk/usb.h | 11 ++++++++++- include/ddk/usb200.h | 13 +++++++++++-- include/ddk/usbdi.h | 11 ++++++++++- include/ddk/winddk.h | 29 +++++++++++++++++++---------- 18 files changed, 231 insertions(+), 71 deletions(-) diff --git a/include/ddk/bdasup.h b/include/ddk/bdasup.h index 69fcecedf85..0bdd590d337 100644 --- a/include/ddk/bdasup.h +++ b/include/ddk/bdasup.h @@ -2,6 +2,15 @@ extern "C" { #endif +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #define STDMETHODCALLTYPE __stdcall typedef GUID *PGUID; @@ -30,7 +39,7 @@ typedef struct _BDA_FILTER_TEMPLATE typedef struct _KSM_PIN { KSMETHOD Method; - union + __GNU_EXTENSION union { ULONG PinId; ULONG PinType; diff --git a/include/ddk/d3dhal.h b/include/ddk/d3dhal.h index 7cbe1e99dc5..d4ecc2ca4e9 100644 --- a/include/ddk/d3dhal.h +++ b/include/ddk/d3dhal.h @@ -22,6 +22,15 @@ #ifndef _D3DHAL_H_ #define _D3DHAL_H_ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -787,7 +796,7 @@ typedef struct _DD_GETD3DQUERYCOUNTDATA typedef struct _DD_GETD3DQUERYDATA { DD_GETDRIVERINFO2DATA gdi2; - union + __GNU_EXTENSION union { DWORD dwQueryIndex; D3DQUERYTYPE QueryType; diff --git a/include/ddk/d3dnthal.h b/include/ddk/d3dnthal.h index b7bb06e9e1e..b396e6f23a3 100644 --- a/include/ddk/d3dnthal.h +++ b/include/ddk/d3dnthal.h @@ -9,6 +9,15 @@ #include #include +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -22,17 +31,17 @@ DEFINE_GUID(GUID_DDStereoMode, 0xF828169C, 0xA8E8, 0x11D2, 0xA typedef struct _D3DNTHAL_CONTEXTCREATEDATA { - union + __GNU_EXTENSION union { PDD_DIRECTDRAW_GLOBAL lpDDGbl; PDD_DIRECTDRAW_LOCAL lpDDLcl; }; - union + __GNU_EXTENSION union { PDD_SURFACE_LOCAL lpDDS; PDD_SURFACE_LOCAL lpDDSLcl; }; - union + __GNU_EXTENSION union { PDD_SURFACE_LOCAL lpDDSZ; PDD_SURFACE_LOCAL lpDDSZLcl; @@ -223,7 +232,7 @@ typedef struct _D3DNTHAL_DRAWPRIMITIVES2DATA PDD_SURFACE_LOCAL lpDDCommands; DWORD dwCommandOffset; DWORD dwCommandLength; - union + __GNU_EXTENSION union { PDD_SURFACE_LOCAL lpDDVertex; LPVOID lpVertices; @@ -233,7 +242,7 @@ typedef struct _D3DNTHAL_DRAWPRIMITIVES2DATA DWORD dwReqVertexBufSize; DWORD dwReqCommandBufSize; LPDWORD lpdwRStates; - union + __GNU_EXTENSION union { DWORD dwVertexSize; HRESULT ddrval; diff --git a/include/ddk/ddkmapi.h b/include/ddk/ddkmapi.h index 88d52ecf6c0..fdd23a9dc35 100644 --- a/include/ddk/ddkmapi.h +++ b/include/ddk/ddkmapi.h @@ -21,6 +21,14 @@ #ifndef __DDKMAPI_INCLUDED__ #define __DDKMAPI_INCLUDED__ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif #if defined(_DXAPI_) #define DXAPI @@ -219,17 +227,17 @@ typedef struct _DDLOCKOUT DWORD dwFormatFlags; DWORD dwFormatFourCC; DWORD dwFormatBitCount; - union + __GNU_EXTENSION union { DWORD dwRBitMask; DWORD dwYBitMask; }; - union + __GNU_EXTENSION union { DWORD dwGBitMask; DWORD dwUBitMask; }; - union + __GNU_EXTENSION union { DWORD dwBBitMask; DWORD dwVBitMask; diff --git a/include/ddk/ddrawi.h b/include/ddk/ddrawi.h index a133f71d479..6b658ff5120 100644 --- a/include/ddk/ddrawi.h +++ b/include/ddk/ddrawi.h @@ -22,6 +22,15 @@ #ifndef __DDRAWI_INCLUDED__ #define __DDRAWI_INCLUDED__ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -203,13 +212,13 @@ typedef struct _DDHALMODEINFO { typedef struct _VIDMEM { DWORD dwFlags; FLATPTR fpStart; - union { + __GNU_EXTENSION union { FLATPTR fpEnd; DWORD dwWidth; }; DDSCAPS ddsCaps; DDSCAPS ddsCapsAlt; - union { + __GNU_EXTENSION union { LPVMEMHEAP lpHeap; DWORD dwHeight; }; @@ -1404,21 +1413,21 @@ typedef struct _DDRAWI_DDRAWSURFACE_INT { typedef struct _DDRAWI_DDRAWSURFACE_GBL { DWORD dwRefCnt; DWORD dwGlobalFlags; - union { + __GNU_EXTENSION union { LPACCESSRECTLIST lpRectList; DWORD dwBlockSizeY; LONG lSlicePitch; }; - union { + __GNU_EXTENSION union { LPVMEMHEAP lpVidMemHeap; DWORD dwBlockSizeX; }; - union { + __GNU_EXTENSION union { LPDDRAWI_DIRECTDRAW_GBL lpDD; LPVOID lpDDHandle; }; FLATPTR fpVidMem; - union { + __GNU_EXTENSION union { LONG lPitch; DWORD dwLinearSize; }; @@ -1454,7 +1463,7 @@ typedef struct _DDRAWI_DDRAWSURFACE_GBL { typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE { DWORD dwSize; - union { + __GNU_EXTENSION union { DWORD dwPhysicalPageTable; FLATPTR fpPhysicalVidMem; }; @@ -1551,15 +1560,15 @@ typedef struct _DDRAWI_DDRAWSURFACE_LCL { DWORD dwProcessId; DWORD dwFlags; DDSCAPS ddsCaps; - union + __GNU_EXTENSION union { - LPDDRAWI_DDRAWPALETTE_INT lpDDPalette; + LPDDRAWI_DDRAWPALETTE_INT lpDDPalette; LPDDRAWI_DDRAWPALETTE_INT lp16DDPalette; - }; - union + }; + __GNU_EXTENSION union { - LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper; - LPDDRAWI_DDRAWCLIPPER_INT lp16DDClipper; + LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper; + LPDDRAWI_DDRAWCLIPPER_INT lp16DDClipper; }; DWORD dwModeCreatedIn; DWORD dwBackBufferCount; @@ -1628,7 +1637,7 @@ typedef struct _DDRAWI_DDRAWPALETTE_GBL { LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; DWORD dwProcessId; LPPALETTEENTRY lpColorTable; - union { + __GNU_EXTENSION union { ULONG_PTR dwReserved1; HPALETTE hHELGDIPalette; }; @@ -1762,7 +1771,7 @@ typedef struct _DDMCBUFFERINFO typedef struct _DDHAL_GETDRIVERSTATEDATA { DWORD dwFlags; - union + __GNU_EXTENSION union { ULONG_PTR dwhContext; }; diff --git a/include/ddk/ddrawint.h b/include/ddk/ddrawint.h index b1af17b6a0d..b78c209bc9d 100644 --- a/include/ddk/ddrawint.h +++ b/include/ddk/ddrawint.h @@ -5,6 +5,14 @@ #ifndef __DD_INCLUDED__ #define __DD_INCLUDED__ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif DEFINE_GUID( GUID_MiscellaneousCallbacks, 0xEFD60CC0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a); DEFINE_GUID( GUID_Miscellaneous2Callbacks, 0x406B2F00, 0x3E5A, 0x11D1, 0xB6, 0x40, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x6A); @@ -81,14 +89,14 @@ typedef struct _VIDEOMEMORY { DWORD dwFlags; FLATPTR fpStart; - union + __GNU_EXTENSION union { FLATPTR fpEnd; DWORD dwWidth; }; DDSCAPS ddsCaps; DDSCAPS ddsCapsAlt; - union + __GNU_EXTENSION union { struct _VMEMHEAP *lpHeap; DWORD dwHeight; @@ -128,13 +136,13 @@ typedef struct _DD_DIRECTDRAW_LOCAL typedef struct _DD_SURFACE_GLOBAL { - union + __GNU_EXTENSION union { DWORD dwBlockSizeY; LONG lSlicePitch; }; - union + __GNU_EXTENSION union { PVIDEOMEMORY lpVidMemHeap; DWORD dwBlockSizeX; @@ -142,7 +150,7 @@ typedef struct _DD_SURFACE_GLOBAL }; FLATPTR fpVidMem; - union + __GNU_EXTENSION union { LONG lPitch; DWORD dwLinearSize; @@ -174,12 +182,12 @@ typedef struct _DD_SURFACE_LOCAL DWORD dwFlags; DDSCAPS ddsCaps; ULONG_PTR dwReserved1; - union + __GNU_EXTENSION union { DDCOLORKEY ddckCKSrcOverlay; DDCOLORKEY ddckCKSrcBlt; }; - union + __GNU_EXTENSION union { DDCOLORKEY ddckCKDestOverlay; DDCOLORKEY ddckCKDestBlt; @@ -591,7 +599,7 @@ typedef DWORD (WINAPI *PDD_CREATESURFACEEX)(PDD_CREATESURFACEEXDATA); typedef struct _DD_GETDRIVERSTATEDATA { DWORD dwFlags; - union + __GNU_EXTENSION union { PDD_DIRECTDRAW_GLOBAL lpDD; DWORD_PTR dwhContext; diff --git a/include/ddk/dmemmgr.h b/include/ddk/dmemmgr.h index ee9b0a9a561..3d11f0b559c 100644 --- a/include/ddk/dmemmgr.h +++ b/include/ddk/dmemmgr.h @@ -12,6 +12,15 @@ #ifndef __DMEMMGR_INCLUDED__ #define __DMEMMGR_INCLUDED__ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -70,7 +79,7 @@ typedef struct _VMEMR typedef struct _SURFACEALIGNMENT { - union + __GNU_EXTENSION union { struct { diff --git a/include/ddk/ide.h b/include/ddk/ide.h index 83da58a5948..5744a3fc0eb 100644 --- a/include/ddk/ide.h +++ b/include/ddk/ide.h @@ -23,6 +23,15 @@ #ifndef __IDE_H #define __IDE_H +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -104,7 +113,7 @@ typedef struct _EXTENDED_IDENTIFY_DATA { USHORT UnformattedBytesPerTrack; /* 08 */ USHORT UnformattedBytesPerSector; /* 10 */ USHORT NumSectorsPerTrack; /* 12 */ - union + __GNU_EXTENSION union { USHORT VendorUnique1[3]; /* 14 */ struct diff --git a/include/ddk/minitape.h b/include/ddk/minitape.h index f1d2b224087..d8f7532f32e 100644 --- a/include/ddk/minitape.h +++ b/include/ddk/minitape.h @@ -22,6 +22,15 @@ #ifndef __MINITAPE_H #define __MINITAPE_H +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -77,9 +86,9 @@ typedef struct _INQUIRYDATA { UCHAR DeviceTypeQualifier : 3; UCHAR DeviceTypeModifier : 7; UCHAR RemovableMedia : 1; - union { + __GNU_EXTENSION union { UCHAR Versions; - struct { + __GNU_EXTENSION struct { UCHAR ANSIVersion : 3; UCHAR ECMAVersion : 3; UCHAR ISOVersion : 2; diff --git a/include/ddk/ndis.h b/include/ddk/ndis.h index 023b1035a59..b08fb683b8c 100644 --- a/include/ddk/ndis.h +++ b/include/ddk/ndis.h @@ -32,6 +32,15 @@ #ifndef __NDIS_H #define __NDIS_H +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #include "ntddk.h" #include "ntddndis.h" #include "netpnp.h" @@ -238,8 +247,8 @@ typedef union _NDIS_RW_LOCK_REFCOUNT { } NDIS_RW_LOCK_REFCOUNT; typedef struct _NDIS_RW_LOCK { - union { - struct { + __GNU_EXTENSION union { + __GNU_EXTENSION struct { KSPIN_LOCK SpinLock; PVOID Context; }; @@ -380,16 +389,16 @@ typedef struct _NDIS_PACKET_PRIVATE { typedef struct _NDIS_PACKET { NDIS_PACKET_PRIVATE Private; - union { - struct { + __GNU_EXTENSION union { + __GNU_EXTENSION struct { UCHAR MiniportReserved[2 * sizeof(PVOID)]; UCHAR WrapperReserved[2 * sizeof(PVOID)]; }; - struct { + __GNU_EXTENSION struct { UCHAR MiniportReservedEx[3 * sizeof(PVOID)]; UCHAR WrapperReservedEx[sizeof(PVOID)]; }; - struct { + __GNU_EXTENSION struct { UCHAR MacReserved[4 * sizeof(PVOID)]; }; }; @@ -474,7 +483,7 @@ typedef struct _NDIS_REQUEST { } DATA; #if (defined(NDIS50) || defined(NDIS51)) UCHAR NdisReserved[9 * sizeof(PVOID)]; - union { + __GNU_EXTENSION union { UCHAR CallMgrReserved[2 * sizeof(PVOID)]; UCHAR ProtocolReserved[2 * sizeof(PVOID)]; }; diff --git a/include/ddk/ntdddisk.h b/include/ddk/ntdddisk.h index 716609b7f98..e7c89a19fee 100644 --- a/include/ddk/ntdddisk.h +++ b/include/ddk/ntdddisk.h @@ -23,6 +23,15 @@ #ifndef __NTDDDISK_H #define __NTDDDISK_H +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #include "ntddstor.h" #ifdef __cplusplus @@ -394,7 +403,7 @@ typedef struct _DRIVE_LAYOUT_INFORMATION_GPT { typedef struct _DRIVE_LAYOUT_INFORMATION_EX { ULONG PartitionStyle; ULONG PartitionCount; - union { + __GNU_EXTENSION union { DRIVE_LAYOUT_INFORMATION_MBR Mbr; DRIVE_LAYOUT_INFORMATION_GPT Gpt; }; diff --git a/include/ddk/ntifs.h b/include/ddk/ntifs.h index ae1e5025ecf..dd58ed2f855 100644 --- a/include/ddk/ntifs.h +++ b/include/ddk/ntifs.h @@ -24,6 +24,15 @@ #define _NTIFS_ #define _GNU_NTIFS_ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #define NTKERNELAPI DECLSPEC_IMPORT #include @@ -962,7 +971,7 @@ typedef struct _REPARSE_DATA_BUFFER { ULONG ReparseTag; USHORT ReparseDataLength; USHORT Reserved; - union { + __GNU_EXTENSION union { struct { USHORT SubstituteNameOffset; USHORT SubstituteNameLength; @@ -1351,11 +1360,11 @@ typedef struct _FILE_OBJECTID_INFORMATION { LONGLONG FileReference; UCHAR ObjectId[16]; _ANONYMOUS_UNION union { - struct { + __GNU_EXTENSION struct { UCHAR BirthVolumeId[16]; UCHAR BirthObjectId[16]; UCHAR DomainId[16]; - } ; + }; UCHAR ExtendedInfo[48]; } DUMMYUNIONNAME; } FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION; @@ -1985,13 +1994,13 @@ typedef struct _PORT_MESSAGE } s2; ULONG ZeroInit; } u2; - union + __GNU_EXTENSION union { LPC_CLIENT_ID ClientId; double DoNotUseThisField; }; ULONG MessageId; - union + __GNU_EXTENSION union { LPC_SIZE_T ClientViewSize; ULONG CallbackId; diff --git a/include/ddk/stdunk.h b/include/ddk/stdunk.h index d4652f6b911..c50e5b1c1b0 100644 --- a/include/ddk/stdunk.h +++ b/include/ddk/stdunk.h @@ -13,6 +13,15 @@ #include +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + /* =============================================================== INonDelegatingUnknown interface */ @@ -110,7 +119,7 @@ Unknown_Release( typedef struct CUnknown { - union + __GNU_EXTENSION union { IUnknown IUnknown; INonDelegatingUnknown INonDelegatingUnknown; diff --git a/include/ddk/strmini.h b/include/ddk/strmini.h index a223fa24d02..1558174e0b9 100644 --- a/include/ddk/strmini.h +++ b/include/ddk/strmini.h @@ -5,6 +5,15 @@ #include #include +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #define STREAMAPI __stdcall #define STREAM_SYSTEM_TIME_MASK ((STREAM_SYSTEM_TIME)0x00000001FFFFFFFF) @@ -61,7 +70,7 @@ typedef struct _HW_EVENT_DESCRIPTOR BOOLEAN Enable; PKSEVENT_ENTRY EventEntry; PKSEVENTDATA EventData; - union + __GNU_EXTENSION union { struct _HW_STREAM_OBJECT * StreamObject; struct _HW_DEVICE_EXTENSION *DeviceExtension; @@ -285,7 +294,7 @@ typedef struct _HW_STREAM_REQUEST_BLOCK ULONG Flags; PVOID HwInstanceExtension; - union + __GNU_EXTENSION union { ULONG NumberOfBytesToTransfer; ULONG ActualBytesTransferred; @@ -376,11 +385,11 @@ typedef enum _STREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE typedef struct _HW_INITIALIZATION_DATA { #if (NTDDI_VERSION >= NTDDI_WINXP) - union - { + __GNU_EXTENSION union + { ULONG HwInitializationDataSize; - struct - { + __GNU_EXTENSION struct + { USHORT SizeOfThisPacket; USHORT StreamClassVersion; }; diff --git a/include/ddk/usb.h b/include/ddk/usb.h index 4a294b1269f..0ac209d99ce 100644 --- a/include/ddk/usb.h +++ b/include/ddk/usb.h @@ -3,6 +3,15 @@ #ifndef __USB_H__ #define __USB_H__ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __USBDI_H__ error #endif @@ -323,7 +332,7 @@ struct _URB_ISOCH_TRANSFER typedef struct _URB { - union + __GNU_EXTENSION union { struct _URB_HEADER UrbHeader; diff --git a/include/ddk/usb200.h b/include/ddk/usb200.h index 7419b7f0b43..2dea2012690 100644 --- a/include/ddk/usb200.h +++ b/include/ddk/usb200.h @@ -1,6 +1,15 @@ #ifndef __USB200_H__ #define __USB200_H__ +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #include "usb100.h" #include @@ -37,7 +46,7 @@ typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET UCHAR bRequest; union _wValue { - struct + __GNU_EXTENSION struct { UCHAR LowByte; UCHAR HiByte; @@ -46,7 +55,7 @@ typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET } wValue; union _wIndex { - struct + __GNU_EXTENSION struct { UCHAR LowByte; UCHAR HiByte; diff --git a/include/ddk/usbdi.h b/include/ddk/usbdi.h index 7dd565f07f0..739a0136170 100644 --- a/include/ddk/usbdi.h +++ b/include/ddk/usbdi.h @@ -23,6 +23,15 @@ #ifndef __USBDI_H #define __USBDI_H +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __USB_H #error usb.h cannot be included with usbdi.h #else @@ -372,7 +381,7 @@ typedef struct _USBD_VERSION_INFORMATION { } USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; typedef struct _URB { - union { + __GNU_EXTENSION union { struct _URB_HEADER UrbHeader; struct _URB_SELECT_INTERFACE UrbSelectInterface; struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; diff --git a/include/ddk/winddk.h b/include/ddk/winddk.h index a2bbeb1e3d2..3c16d907d5c 100644 --- a/include/ddk/winddk.h +++ b/include/ddk/winddk.h @@ -23,6 +23,15 @@ #ifndef __WINDDK_H #define __WINDDK_H +/* Helper macro to enable gcc's extension. */ +#ifndef __GNU_EXTENSION +#ifdef __GNUC__ +#define __GNU_EXTENSION __extension__ +#else +#define __GNU_EXTENSION +#endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -556,7 +565,7 @@ typedef struct _KUSER_SHARED_DATA ULONG SystemCall; ULONG SystemCallReturn; ULONGLONG SystemCallPad[3]; - union { + __GNU_EXTENSION union { volatile KSYSTEM_TIME TickCount; volatile ULONG64 TickCountQuad; }; @@ -569,10 +578,10 @@ typedef struct _KUSER_SHARED_DATA USHORT UserModeGlobalLogger[8]; ULONG HeapTracingPid[2]; ULONG CritSecTracingPid[2]; - union + __GNU_EXTENSION union { ULONG SharedDataFlags; - struct + __GNU_EXTENSION struct { ULONG DbgErrorPortPresent:1; ULONG DbgElevationEnabled:1; @@ -1276,9 +1285,9 @@ typedef struct _KGUARDED_MUTEX PKTHREAD Owner; ULONG Contention; KGATE Gate; - union + __GNU_EXTENSION union { - struct + __GNU_EXTENSION struct { SHORT KernelApcDisable; SHORT SpecialApcDisable; @@ -4591,7 +4600,7 @@ typedef struct _NT_TIB32 { ULONG StackBase; ULONG StackLimit; ULONG SubSystemTib; - union { + __GNU_EXTENSION union { ULONG FiberData; ULONG Version; }; @@ -4604,7 +4613,7 @@ typedef struct _NT_TIB64 { ULONG64 StackBase; ULONG64 StackLimit; ULONG64 SubSystemTib; - union { + __GNU_EXTENSION union { ULONG64 FiberData; ULONG Version; }; @@ -4705,7 +4714,7 @@ typedef struct _PROCESS_WS_WATCH_INFORMATION typedef struct _PROCESS_DEVICEMAP_INFORMATION { - union + __GNU_EXTENSION union { struct { @@ -5382,10 +5391,10 @@ extern NTKERNELAPI ULONG_PTR MmUserProbeAddress; typedef struct _KPCR { - union + __GNU_EXTENSION union { NT_TIB NtTib; - struct + __GNU_EXTENSION struct { union _KGDTENTRY64 *GdtBase; struct _KTSS64 *TssBase;