diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2019-07-16 20:51:53 -0700 |
---|---|---|
committer | Stefan Sauer <ensonic@users.sf.net> | 2019-07-16 20:53:38 -0700 |
commit | 53295ae10e2e3160480b6d0e52cc0602b4ca4e7a (patch) | |
tree | ae729a397b22a3becede74538b90c953919b4da6 | |
parent | 9af81b409dc2789f1bc4204024d2c0c7a2810c3a (diff) | |
download | gtk-doc-53295ae10e2e3160480b6d0e52cc0602b4ca4e7a.tar.gz |
scan: enable having '_' as a public api in glib
This is essentially a revert of 070acc5.
Fixes #92
-rw-r--r-- | gtkdoc/scan.py | 12 | ||||
-rw-r--r-- | tests/bugs/docs/tester-sections.txt | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py index 2a7214d..7da060f 100644 --- a/gtkdoc/scan.py +++ b/gtkdoc/scan.py @@ -522,15 +522,17 @@ def ScanHeaderContent(input_lines, decl_list, get_types, options): if cm[0]: symbol = cm[0].group(1) decl = line - # We assume all macros which start with '_' are private. + # We assume all macros which start with '_' are private, but + # we accept '_' itself which is the standard gettext macro. # We also try to skip the first macro if it looks like the # standard #ifndef HEADER_FILE #define HEADER_FILE etc. # And we only want TRUE & FALSE defined in GLib. if not symbol.startswith('_') \ - and (not re.search(r'#ifndef\s+' + symbol, previous_line) - or first_macro == 0) \ - and ((symbol != 'TRUE' and symbol != 'FALSE') - or options.module == 'glib'): + and (not re.search(r'#ifndef\s+' + symbol, previous_line) + or first_macro == 0) \ + and ((symbol != 'TRUE' and symbol != 'FALSE') + or options.module == 'glib') \ + or symbol == '_': in_declaration = 'macro' logging.info('Macro: "%s"', symbol) else: diff --git a/tests/bugs/docs/tester-sections.txt b/tests/bugs/docs/tester-sections.txt index ab22e35..9e6a5ff 100644 --- a/tests/bugs/docs/tester-sections.txt +++ b/tests/bugs/docs/tester-sections.txt @@ -58,6 +58,7 @@ bug_732689 bug_783420 gst_play_marshal_BUFFER__BOXED BUG_791928 +_ <SUBSECTION Standard> <SUBSECTION Private> GTKDOC_GNUC_CONST |