[PATCH 2/2] widl: Mark struct/union by __C89_NAMELESS also for DUMMY...NAMEs

Kai Tietz ktietz70 at googlemail.com
Fri Aug 30 07:59:10 CDT 2013


Hello,

this patch adds the feature that unions/structs which are are named
with DUMMYUNIONNAMEs, or with DUMMYSTRUCTNAMEs still are prefixed in
header-output with __C89_NAMELESS.  By this warnings are avoided in
case that these names are empty.

Kai
-------------- next part --------------
From b9842df0210e72b4990c5c8cc0463b21c49b04f4 Mon Sep 17 00:00:00 2001
From: Kai Tietz <ktietz70 at googlemail.com>
Date: Fri, 30 Aug 2013 14:51:39 +0200
Subject: [PATCH 2/2] widl:  Mark struct/union by __C89_NAMELESS also for
 DUMMY...NAMEs.

---
 tools/widl/header.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/tools/widl/header.c b/tools/widl/header.c
index 1142435..e258972 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -201,9 +201,13 @@ static void write_fields(FILE *h, var_list_t *fields)
         switch(type_get_type_detect_alias(v->type)) {
         case TYPE_STRUCT:
         case TYPE_ENCAPSULATED_UNION:
-            if(!v->name) {
+            if(!v->name
+               || !strncmp(v->name, "DUMMYUNIONNAME", 14)
+               || !strncmp(v->name, "DUMMYSTRUCTNAME", 15)) {
                 fprintf(h, "__C89_NAMELESS ");
-                if(nameless_struct_cnt == 1) {
+                if(v->name)
+                    ;
+                else if(nameless_struct_cnt == 1) {
                     name = "__C89_NAMELESSSTRUCTNAME";
                 }else if(nameless_struct_i < 5 /* # of supporting macros */) {
                     sprintf(buf, "__C89_NAMELESSSTRUCTNAME%d", ++nameless_struct_i);
@@ -212,9 +216,13 @@ static void write_fields(FILE *h, var_list_t *fields)
             }
             break;
         case TYPE_UNION:
-            if(!v->name) {
+            if(!v->name
+               || !strncmp(v->name, "DUMMYUNIONNAME", 14)
+               || !strncmp(v->name, "DUMMYSTRUCTNAME", 15)) {
                 fprintf(h, "__C89_NAMELESS ");
-                if(nameless_union_cnt == 1) {
+                if(v->name)
+                    ;
+                else if(nameless_union_cnt == 1) {
                     name = "__C89_NAMELESSUNIONNAME";
                 }else if(nameless_union_i < 8 /* # of supporting macros */ ) {
                     sprintf(buf, "__C89_NAMELESSUNIONNAME%d", ++nameless_union_i);
-- 
1.7.9


More information about the wine-patches mailing list