[PATCH] Add ANONYMOUS_[STRUCT|UNION] in winddk.h

"Casper Hornstrup" <[email protected]> Sat, 12 Jul 2003 12:41:11 +0200
Newsgroups gmane.comp.gnu.mingw.patches
Message-ID <[email protected]>
2003-07-12  Casper S. Hornstrup  <[email protected]>

	* include/ddk/winddk.h (_IO_STATUS_BLOCK, _IRP, _OWNER_ENTRY,
_ERESOURCE,
	_IMAGE_INFO, _CREATE_DISK, _DISK_SIGNATURE, _KPCR_TIB): Apply
	_ANONYMOUS_UNION to anonymous unions and _ANONYMOUS_STRUCT to
anonymous
	structs.
anonunionstruct.diff (application/octet-stream, 3.8 KB)
2003-07-12  Casper S. Hornstrup  <[email protected]>

	* include/ddk/winddk.h (_IO_STATUS_BLOCK, _IRP, _OWNER_ENTRY, _ERESOURCE,
	_IMAGE_INFO, _CREATE_DISK, _DISK_SIGNATURE, _KPCR_TIB): Apply
	_ANONYMOUS_UNION to anonymous unions and _ANONYMOUS_STRUCT to anonymous
	structs.


Index: include/ddk/winddk.h
===================================================================
RCS file: /cvs/src/src/winsup/w32api/include/ddk/winddk.h,v
retrieving revision 1.8
diff -u -p -u -r1.8 winddk.h
--- include/ddk/winddk.h	2 Jun 2003 22:21:54 -0000	1.8
+++ include/ddk/winddk.h	12 Jul 2003 10:31:09 -0000
@@ -748,10 +748,10 @@ typedef VOID DDKAPI
   IN ULONG Reserved);
 
 typedef struct _IO_STATUS_BLOCK {
-  union {
+  _ANONYMOUS_UNION union {
     NTSTATUS  Status;
     PVOID  Pointer;
-  };
+  } DUMMYUNIONNAME;
   ULONG_PTR  Information;
 } IO_STATUS_BLOCK;
 
@@ -958,21 +958,21 @@ typedef struct _IRP {
   PVOID  UserBuffer;
   union {
     struct {
-      union {
+      _ANONYMOUS_UNION union {
         KDEVICE_QUEUE_ENTRY  DeviceQueueEntry;
-        struct {
+        _ANONYMOUS_STRUCT struct {
           PVOID  DriverContext[4];
-        };
-      };
+        } DUMMYSTRUCTNAME;
+      } DUMMYUNIONNAME;
       PETHREAD  Thread;
       PCHAR  AuxiliaryBuffer;
-      struct {
+      _ANONYMOUS_STRUCT struct {
         LIST_ENTRY  ListEntry;
-        union {
+        _ANONYMOUS_UNION union {
           struct _IO_STACK_LOCATION  *CurrentStackLocation;
           ULONG  PacketType;
-        };
-      };
+        } DUMMYUNIONNAME;
+      } DUMMYSTRUCTNAME;
       struct _FILE_OBJECT  *OriginalFileObject;
     } Overlay;
     KAPC  Apc;
@@ -2003,10 +2003,10 @@ typedef ERESOURCE_THREAD *PERESOURCE_THR
 
 typedef struct _OWNER_ENTRY {
   ERESOURCE_THREAD  OwnerThread;
-  union {
+  _ANONYMOUS_UNION union {
       LONG  OwnerCount;
       ULONG  TableSize;
-  };
+  } DUMMYUNIONNAME;
 } OWNER_ENTRY, *POWNER_ENTRY;
 
 /* ERESOURCE.Flag */
@@ -2028,10 +2028,10 @@ typedef struct _ERESOURCE {
   ULONG  ContentionCount;
   USHORT  NumberOfSharedWaiters;
   USHORT  NumberOfExclusiveWaiters;
-  union {
+  _ANONYMOUS_UNION union {
     PVOID  Address;
     ULONG_PTR  CreatorBackTraceIndex;
-  };
+  } DUMMYUNIONNAME;
   KSPIN_LOCK  SpinLock;
 } ERESOURCE, *PERESOURCE;
 
@@ -3380,15 +3380,15 @@ typedef VOID DDKAPI
   IN BOOLEAN  Create);
 
 typedef struct _IMAGE_INFO {
-  union {
+  _ANONYMOUS_UNION union {
     ULONG  Properties;
-    struct {
+    _ANONYMOUS_STRUCT struct {
       ULONG  ImageAddressingMode  : 8;
       ULONG  SystemModeImage      : 1;
       ULONG  ImageMappedToAllPids : 1;
       ULONG  Reserved             : 22;
-    };
-  };
+    } DUMMYSTRUCTNAME;
+  } DUMMYUNIONNAME;
   PVOID  ImageBase;
   ULONG  ImageSelector;
   SIZE_T  ImageSize;
@@ -3516,15 +3516,15 @@ typedef struct _CREATE_DISK_GPT {
 
 typedef struct _CREATE_DISK {
   PARTITION_STYLE  PartitionStyle;
-  union {
+  _ANONYMOUS_UNION union {
     CREATE_DISK_MBR  Mbr;
     CREATE_DISK_GPT  Gpt;
-  };
+  } DUMMYUNIONNAME;
 } CREATE_DISK, *PCREATE_DISK;
 
 typedef struct _DISK_SIGNATURE {
   ULONG  PartitionStyle;
-  union {
+  _ANONYMOUS_UNION union {
     struct {
       ULONG  Signature;
       ULONG  CheckSum;
@@ -3532,7 +3532,7 @@ typedef struct _DISK_SIGNATURE {
     struct {
       GUID  DiskId;
     } Gpt;
-  };
+  } DUMMYUNIONNAME;
 } DISK_SIGNATURE, *PDISK_SIGNATURE;
 
 typedef VOID DDKFASTAPI
@@ -3671,10 +3671,10 @@ typedef struct _KPCR_TIB {
   PVOID  StackBase;             /* 04 */
   PVOID  StackLimit;            /* 08 */
   PVOID  SubSystemTib;          /* 0C */
-  union {
+  _ANONYMOUS_UNION union {
     PVOID  FiberData;           /* 10 */
     DWORD  Version;             /* 10 */
-  };
+  } DUMMYUNIONNAME;
   PVOID  ArbitraryUserPointer;  /* 14 */
 } KPCR_TIB, *PKPCR_TIB;         /* 18 */