diff options
Diffstat (limited to 'glnx-backports.h')
-rw-r--r-- | glnx-backports.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/glnx-backports.h b/glnx-backports.h index f99f08f..ad70ed9 100644 --- a/glnx-backports.h +++ b/glnx-backports.h @@ -118,6 +118,17 @@ _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) +{ + int fd = *fdp; + *fdp = -1; + return fd; +} +#endif + #if !GLIB_CHECK_VERSION(2, 74, 0) #define G_APPLICATION_DEFAULT_FLAGS ((GApplicationFlags) 0) #define G_CONNECT_DEFAULT ((GConnectFlags) 0) |