GNOME Bugzilla – Bug 346647
add option to make glib-genmarshal generate internal functions
Last modified: 2011-02-18 16:14:11 UTC
glib-genmarshal should have a command-line option that makes it mark the generated functions as G_GNUC_INTERNAL. That would allow marshallers that are used in libraries, but not exported, to be marked as internal functions using the visibility(hidden) attribute. This would be cleaner and also slightly more efficient. If there is interest, I could write a patch that adds this feature to glib-genmarshal.
sounds like a good idea to me; in fact, there may even be a bug about it already. Or maybe I'm misremembering
Created attachment 68724 [details] [review] patch to implement and document the suggested feature
(In reply to comment #2) > Created an attachment (id=68724) [edit] > patch to implement and document the suggested feature thanks, the patch looks mostly good to me. it contains a distracting amount of empty line replacements though like: - + which don't really help in reading it, but other than that, i just think the global variable "internal" should be renamed to "gen_internal" to match in with the rest of the generation flags and then the patch can be comitted as soon as we have created a new development branch.
The empty lines are because I removed trailing whitespace while editing the code. I will try to avoid that in the future. But perhaps it would be a good idea to avoid such problems by removing all trailing whitespace from glib (and gtk+) and making sure that changes don't introduce any new trailing whitespace.
I will take care of committing the change with the suggested variable name as soon as glib has branched.
(In reply to comment #5) > I will take care of committing the change with the suggested variable name as > soon as glib has branched. did you just mean to volounteer to put up such a patch?
foget my last (comment #6) it contains wrong pastage. (In reply to comment #4) > But perhaps it would be a good idea to avoid such problems by removing all > trailing whitespace from glib (and gtk+) and making sure that changes don't > introduce any new trailing whitespace. did you just mean to volounteer to put up such a patch? one problem i see here is that differente editors of different developers will fight each other over the spaces. e.g. iirc, my emacs settings put no extra trailing spaces at line ends, but preserve indentation spaces like this: { bar; __ baz; } "__" indicating two sapces before line end. your editor may or may not remove those automatically.
I have committed a variant of this to the HEAD branch: 2006-08-23 Sven Neumann <sven@gimp.org> * gobject/glib-genmarshal.[c1]: added new command-line option "--internal" that can be used to let glib-genmarshal generate internal functions using the G_GNUC_INTERNAL attribute (bug #346647). The difference to the discussed patch is that it now puts the G_GNUC_INTERNAL attribute at the beginning of the line. This is to avoid problems as outlined in bug #352268. I have tried the change but of course further review would be appreciated.
i reviewed the diff that went into CVS, which looked ok.