GNOME Bugzilla – Bug 674119
glib-mkenum does not understand named enums
Last modified: 2017-10-24 12:18:44 UTC
glib-mkenums looks for typedef enums with this regex: if (m@^\s*typedef\s+enum\s* ({)?\s* (?:/\*< (([^*]|\*(?!/))*) >\s*\*/)? \s*({)? @x) { So, for example the following wouldn't work: typedef enum _my_enum { ... } my_enum; I like to add the name to the enum because gdb understands that better.
I can confirm this bug. It do breaks the compilation for Pidgin's Gobjectification branch. I do have glib 2.34.3 in an Archlinux system. I also have a preliminar patch which can fix it (I don't know perl but it looks like working in my quick test). I paste the patch here because I have the code in a VM and it is a mess to get stuff out from there. --- glib-mkenums.orig 2013-01-17 16:55:55.644141112 -0600 +++ glib-mkenums 2013-01-17 16:56:49.854144216 -0600 @@ -293,7 +293,7 @@ while (<>) { # ignore forward declarations next if /^\s*typedef\s+enum.*;/; - if (m@^\s*typedef\s+enum\s* + if (m@^\s*typedef\s+enum\s*\w*\s* ({)?\s* (?:/\*< (([^*]|\*(?!/))*)
Fixed as bug #669595. *** This bug has been marked as a duplicate of bug 669595 ***