[gtk-doc] mkdb: Prevent duplicate IDs in boxed union types



commit 9cab897834de0f8dddacec9c621276bea333c808
Author: Philip Chimento <philip chimento gmail com>
Date:   Sun Feb 5 14:37:51 2012 +0100

    mkdb: Prevent duplicate IDs in boxed union types
    
    When registering a C union as a GBoxed type, Gtk-Doc generates
    duplicate IDs. This handles the problem in the same way as structs
    handle it.
    
    Fixes bgo#669417.

 gtkdoc-mkdb.in |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 60d2c93..f3de08f 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -1701,8 +1701,22 @@ sub OutputStruct {
 
 sub OutputUnion {
     my ($symbol, $declaration) = @_;
-    my $id = &CreateValidSGMLID ($symbol);
-    my $condition = &MakeConditionDescription ($symbol);
+
+    my $is_gtype = 0;
+    if (&CheckIsObject ($symbol)) {
+        @TRACE@("Found union gtype: $symbol\n");
+        $is_gtype = 1;
+    }
+
+    my $id;
+    my $condition;
+    if ($is_gtype) {
+        $id = &CreateValidSGMLID ($symbol . "_union");
+        $condition = &MakeConditionDescription ($symbol . "_union");
+    } else {
+        $id = &CreateValidSGMLID ($symbol);
+        $condition = &MakeConditionDescription ($symbol);
+    }
 
     # Determine if it is a simple struct or it also has a typedef.
     my $has_typedef = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]