diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2015-02-05 20:50:47 -0500 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2015-02-06 15:52:12 +0100 |
commit | 19ad99f68aa4ae39fc1157192a5c35bde7b84adf (patch) | |
tree | 67dc3bc502b7905aa7aac1dc926d7a013fff4cb1 | |
parent | 238b89bc5ad1ee1ad74325cf4e7ad822bebbaeaa (diff) | |
download | gtk-doc-19ad99f68aa4ae39fc1157192a5c35bde7b84adf.tar.gz |
Fix unions not being treated consistently like structs
https://bugzilla.gnome.org/show_bug.cgi?id=744075
-rwxr-xr-x | gtkdoc-mkdb.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in index 55f1625..9543a3c 100755 --- a/gtkdoc-mkdb.in +++ b/gtkdoc-mkdb.in @@ -5442,7 +5442,7 @@ sub ReadDeclarationsFile { # If the declaration is an empty typedef struct _XXX XXX # set the flag to indicate the struct has a typedef. - if ($declaration_type eq 'STRUCT' + if (($declaration_type eq 'STRUCT' || $declaration_type eq 'UNION') && $declaration =~ m/^\s*$/) { @TRACE@("Struct has typedef: $declaration_name\n"); $StructHasTypedef{$declaration_name} = 1; @@ -5464,13 +5464,13 @@ sub ReadDeclarationsFile { eq $declaration_type) { # If the existing declaration is empty, or is just a # forward declaration of a struct, override it. - if ($declaration_type eq 'STRUCT') { - if ($Declarations{$declaration_name} =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) { + if ($declaration_type eq 'STRUCT' || $declaration_type eq 'UNION') { + if ($Declarations{$declaration_name} =~ m/^\s*((struct|union)\s+\w+\s*;)?\s*$/) { if ($is_deprecated) { $Deprecated{$declaration_name} = ""; } $Declarations{$declaration_name} = $declaration; - } elsif ($declaration =~ m/^\s*(struct\s+\w+\s*;)?\s*$/) { + } elsif ($declaration =~ m/^\s*((struct|union)\s+\w+\s*;)?\s*$/) { # Ignore an empty or forward declaration. } else { &LogWarning ($file, $., "Structure $declaration_name has multiple definitions."); |