Make sure that unnamed union/struct are prefix by __GCC_EXTENSION.
[reactos.git] / include / ddk / d3dnthal.h
index b7bb06e..b396e6f 100644 (file)
@@ -9,6 +9,15 @@
 #include <d3dtypes.h>
 #include <d3dcaps.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
@@ -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;