[gtk-doc] gtkdoc-mkdb: ensure macros appear in the correct section



commit c82497df70e8037def31935beae097fa3376bbfd
Author: Thomas Wood <thomas wood intel com>
Date:   Thu Dec 3 16:35:01 2015 +0000

    gtkdoc-mkdb: ensure macros appear in the correct section
    
    Macros should only appear in the function section if there is no space
    between the macro name and the parameter list.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=758996

 gtkdoc-mkdb.in                      |    2 +-
 tests/bugs/docs/tester-sections.txt |    2 ++
 tests/bugs/src/tester.h             |   15 +++++++++++++++
 3 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc-mkdb.in b/gtkdoc-mkdb.in
index 15825ba..35a6ca4 100755
--- a/gtkdoc-mkdb.in
+++ b/gtkdoc-mkdb.in
@@ -961,7 +961,7 @@ EOF
                         if ($type eq 'FUNCTION' || $type eq 'USER_FUNCTION') {
                           $functions_synop .= $synop;
                           $functions_details .= $desc;
-                        } elsif ($type eq 'MACRO' && $declaration =~ /$symbol[ ]*\(/) {
+                        } elsif ($type eq 'MACRO' && $declaration =~ /$symbol\(/) {
                           $functions_synop .= $synop;
                           $functions_details .= $desc;
                         } else {
diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt
index 1d179fb..ca23ab0 100644
--- a/tests/bugs/docs/tester-sections.txt
+++ b/tests/bugs/docs/tester-sections.txt
@@ -2,6 +2,8 @@
 <FILE>tester</FILE>
 <TITLE>GtkdocTester</TITLE>
 BUG_530758
+MACRO_FUNCTION
+MACRO_VALUE
 <SUBSECTION Compounds>
 Bug165425a
 Bug165425b
diff --git a/tests/bugs/src/tester.h b/tests/bugs/src/tester.h
index ecbda08..bd4e60b 100644
--- a/tests/bugs/src/tester.h
+++ b/tests/bugs/src/tester.h
@@ -529,4 +529,19 @@ typedef enum
   BUG_730658_IS_DEPRECATED = 1 << 2
 } Bug730658;
 
+/**
+ * MACRO_VALUE:
+ *
+ * This should be listed in the types and values section.
+ */
+#define MACRO_VALUE (1 << 1)
+
+/**
+ * MACRO_FUNCTION:
+ * @x: a value
+ *
+ * This should be listed in the functions section.
+ */
+#define MACRO_FUNCTION(x) (x << 1)
+
 #endif // GTKDOC_TESTER_H


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