GNOME Bugzilla – Bug 729914
instead of DEBUG_CODE and IF_DEBUG, provide a common macro to support GOBJECT_DEBUG environment variable
Last modified: 2016-07-17 00:55:46 UTC
to support GOBJECT_DEBUG environment(see gtype.c), gtype.c defines DEBUG_CODE but never uses it. gobject.c and gsignal.c both define IF_DEBUG macro.(though IF_DEBUG is removed from gsignal.c now.) I think we should provide a single macro to clean things up. in the following two patches, I add a new macro _GOBJECT_DEBUG_CODE based on DEBUG_CODE and move _g_type_debug_flags into gtype-private.h
Created attachment 276279 [details] [review] add _GOBJECT_DEBUG_CODE
Created attachment 276280 [details] [review] move _g_type_debug_flags out of gtype.h to gtype-private.h
Review of attachment 276279 [details] [review]: Thanks. This is a nice cleanup. A small nitpick below. ::: gobject/gtype-private.h @@ +26,3 @@ +/** + * _GOBJECT_DEBUG_CODE: Please don't write a gtk-doc style comment here. Start it like so instead: /*< private > * Also: we don't use (anymore) underscore prefixing for private functions or macros in GLib... I'd also prefer to keep 'IF' in the name, since it reads nicer at the points that it is used... so maybe GOBJECT_IF_DEBUG() or so?
Review of attachment 276280 [details] [review]: Agreed. This is not currently on our ABI, so it could never possibly work from outside anyway.
Created attachment 277145 [details] [review] this is the version 2 of the 0001-gobject-add-_GOBJECT_DEBUG_CODE-macro-for-debugging-.patch
Created attachment 277169 [details] [review] remove signoff in the previous patch
Review of attachment 277169 [details] [review]: hi, i updated the patch several weeks ago according to Ryan Lortie's suggestions. but no one has reviewed it since then. i'm not sure if it's appropriate for me to change this patch status.