GLib: clean up the "inline" mess once and for all

Desktop / GNOME / GLib - Allison Ryan Lortie [desrt.ca] - 16 November 2015 12:14 UTC

It's been a long time since we've been unconditionally saying "static inline" in GLib headers without complaints so it's safe to assume that all compilers that we care about support this.

One thing that is not yet totally supported is the unadorned use of the word "inline". Depending on the flags (-std=c89, for example), even GCC will complain about this. Detect missing C99 support and define "inline" to "__inline" in that case. Some research shows "__inline" appears to be the most widely-supported keyword here, but we may need to tweak this if we get some reports of breakage.

Clean up all of the configure checks around this and define G_CAN_INLINE unconditionally. Unfortunately, we must assume that some people are still using G_IMPLEMENT_INLINES, we must continue to implement that (including undefining G_CAN_INLINE and redefining G_INLINE_FUNC) if requested.

It is not our intent to break existing users of the old-style G_INLINE_FUNC approach and if that has happened, we may need to make some further adjustments.

https://bugzilla.gnome.org/show_bug.cgi?id=757374

db2367e GLib: clean up the "inline" mess once and for all
configure.ac | 105 --------------------------------------------------------
glib/docs.c | 19 +++++-----
glib/gmacros.h | 21 ++++++++++++
glib/gutils.h | 35 -------------------
4 files changed, 30 insertions(+), 150 deletions(-)

Upstream: git.gnome.org


  • Share