After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 418027 - gtkdoc-mkdb does not handle #ifdef in enum {}
gtkdoc-mkdb does not handle #ifdef in enum {}
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal major
: 1.9
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2007-03-13 22:18 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2007-09-22 19:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes parsing structs or enums with #ifdefs (816 bytes, patch)
2007-03-14 19:00 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
committed Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2007-03-13 22:18:10 UTC
gtkdoc-mkdb --module=gobject --source-dir=../../../gobject --output-format=xml --expand-content-files="" --main-sgml-file=gobject-docs.sgml 
Cannot parse enumeration member "#ifndef G_DISABLE_DEPRECATED
  G_PARAM_PRIVATE             = G_PARAM_STATIC_NAME" at /opt/gnome/share/gtk-doc/data/gtkdoc-common.pl line 287, <INPUT> line 416.
Cannot parse enumeration member "#endif
  G_PARAM_STATIC_NICK         = 1 &lt;&lt; 6" at /opt/gnome/share/gtk-doc/data/gtkdoc-common.pl line 287, <INPUT> line 416.


This removes documentation from tmpl files!
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2007-03-14 19:00:53 UTC
Created attachment 84594 [details] [review]
fixes parsing structs or enums with #ifdefs

okay to commit?
Comment 2 Damon Chaplin 2007-03-14 21:36:18 UTC
The regular expressions look a bit weird to me.

Why not just something like:

      # ignore preprocessor directives
      next if $line =~ /^#/;

Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2007-03-14 21:57:53 UTC
That was my first attempt. Let me illustrate the problem:

enum {
  G_FLAG1 = 1,
#ifdef DEPRECATED
  G_FLAG2,
#endif
  G_FLAG3,
};

The whole enum gets processed using /msg in the regexp and line gets splitted on ',' thus for the #ifdef you have $line="#ifdef DEPRECATED\n  G_FLAG2," and if you drop that you loose the actual enum value. Same applies to #endif.
Comment 4 Damon Chaplin 2007-03-15 22:28:31 UTC
Oh yes, I see.

Go ahead and commit it then.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2007-03-16 16:33:36 UTC
2007-03-16  Stefan Kost  <ensonic@users.sf.net>

	* gtkdoc-common.pl.in: handle preprocessor statements in enum and
	struct declarations. Fixes #418027.