diff --git a/src/internal.h b/src/internal.h index 4cfb022b41..1e8e2908bf 100644 --- a/src/internal.h +++ b/src/internal.h @@ -109,18 +109,6 @@ # endif #endif -/** - * G_GNUC_NO_INLINE: - * - * Force compiler not to inline a method. Should be used if - * the method need to be overridable by test mocks. - * - * TODO: Remove after upgrading to GLib >= 2.58 - */ -#ifndef G_GNUC_NO_INLINE -# define G_GNUC_NO_INLINE __attribute__((__noinline__)) -#endif - /** * ATTRIBUTE_PACKED * diff --git a/src/util/glibcompat.h b/src/util/glibcompat.h index 1f3a6f728f..e3a8b9f6b3 100644 --- a/src/util/glibcompat.h +++ b/src/util/glibcompat.h @@ -94,3 +94,12 @@ char *vir_g_strdup_vprintf(const char *msg, va_list args) #define g_fsync vir_g_fsync void vir_g_source_unref(GSource *src, GMainContext *ctx); + +/* Intentionally redefine macro so that it's not marked as available in 2.58 + * and newer. Drop when bumping to 2.58 or newer. */ +#undef G_GNUC_NO_INLINE +#if g_macro__has_attribute(__noinline__) +# define G_GNUC_NO_INLINE __attribute__ ((__noinline__)) +#else +# define G_GNUC_NO_INLINE +#endif