mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-02 11:56:38 +02:00
GLib: clean up the "inline" mess once and for all
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
This commit is contained in:
17
glib/docs.c
17
glib/docs.c
@@ -1850,16 +1850,15 @@
|
||||
/**
|
||||
* G_INLINE_FUNC:
|
||||
*
|
||||
* This macro is used to export function prototypes so they can be linked
|
||||
* with an external version when no inlining is performed. The file which
|
||||
* implements the functions should define %G_IMPLEMENTS_INLINES
|
||||
* before including the headers which contain %G_INLINE_FUNC declarations.
|
||||
* Since inlining is very compiler-dependent using these macros correctly
|
||||
* is very difficult. Their use is strongly discouraged.
|
||||
* This macro used to be used to conditionally define inline functions
|
||||
* in a compatible way before this feature was supported in all
|
||||
* compilers. These days, GLib requires inlining support from the
|
||||
* compiler, so your GLib-using programs can safely assume that the
|
||||
* "inline" keywork works properly.
|
||||
*
|
||||
* This macro is often mistaken for a replacement for the inline keyword;
|
||||
* inline is already declared in a portable manner in the GLib headers
|
||||
* and can be used normally.
|
||||
* Never use this macro anymore. Just say "static inline".
|
||||
*
|
||||
* Deprecated: 2.48: Use "static inline" instead
|
||||
*/
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user