diff --git a/glnx-backports.h b/glnx-backports.h index 7fa6a920..b3480c71 100644 --- a/glnx-backports.h +++ b/glnx-backports.h @@ -125,16 +125,22 @@ _glnx_memdup2 (gconstpointer mem, (((a) > (b) ? (a) - (b) : (b) - (a)) < (epsilon)) #endif -#if !GLIB_CHECK_VERSION(2, 70, 0) -#define g_steal_fd _glnx_steal_fd static inline int _glnx_steal_fd (int *fdp) { +#if GLIB_CHECK_VERSION(2, 70, 0) + /* Allow it to be used without deprecation warnings, even if the target + * GLib version is older */ + G_GNUC_BEGIN_IGNORE_DEPRECATIONS + return g_steal_fd (fdp); + G_GNUC_END_IGNORE_DEPRECATIONS +#else int fd = *fdp; *fdp = -1; return fd; -} #endif +} +#define g_steal_fd _glnx_steal_fd #if !GLIB_CHECK_VERSION(2, 74, 0) #define G_APPLICATION_DEFAULT_FLAGS ((GApplicationFlags) 0)