GNOME Bugzilla – Bug 661797
glib-mkenums.in: fix @ENUMPREFIX@ with /*< underscore_name=... >*/
Last modified: 2017-10-24 10:07:31 UTC
seen trying to port NetworkManager to use glib-mkenums... I can haz glib-2-30? (of course, really, glib-mkenums should probably take a --symbol-prefix arg like g-i-scanner does, so you don't have to use /*< underscore_name >*/ everywhere... right?)
Created attachment 199024 [details] [review] glib-mkenums.in: fix @ENUMPREFIX@ with /*< underscore_name=... >*/ For enums defined with an underscore_name override, @ENUMPREFIX@ would include a trailing "_". Fix.
(In reply to comment #0) > (of course, really, glib-mkenums should probably take a > --symbol-prefix arg like g-i-scanner does, so you don't have to > use /*< underscore_name >*/ everywhere... right?) or better yet, glib-mkenums should be reimplemented using the guts of g-ir-scanner so it parses everything consistently
Created attachment 200217 [details] [review] docs: don't refer to a deprecated glib-mkenums flag Refer to the new flag instead
Created attachment 200218 [details] [review] glib-mkenums: add --identifier-prefix and --symbol-prefix args Allow passing --identifier-prefix and --symbol-prefix to glib-mkenums, with the same meanings as in g-ir-scanner, to allow fixing up the enum name parsing globally rather than needing to add a /<* *>/ override to each enum. ==== The patch could be smaller by merging the new code with the existing code, but I did it this way on purpose to guarantee that it wasn't going to end up changing glib-mkenum's behavior in some edge case.
Review of attachment 199024 [details] [review]: Would be great to have some tests for glib-mkenums. But this looks fine, anyway
Review of attachment 200217 [details] [review]: Looks good
Review of attachment 200218 [details] [review]: Looks fine
Attachment 199024 [details] pushed as dd4a8d3 - glib-mkenums.in: fix @ENUMPREFIX@ with /*< underscore_name=... >*/ Attachment 200217 [details] pushed as 78a0dbd - docs: don't refer to a deprecated glib-mkenums flag Attachment 200218 [details] pushed as f9c2362 - glib-mkenums: add --identifier-prefix and --symbol-prefix args
*** Bug 621942 has been marked as a duplicate of this bug. ***