libsysprof: use macro to preserve types

This commit is contained in:
Christian Hergert
2019-05-10 19:36:29 -07:00
parent 84fc3f3c0f
commit 71d64d6732

View File

@ -13,13 +13,11 @@
#endif #endif
#if !GLIB_CHECK_VERSION(2, 56, 0) #if !GLIB_CHECK_VERSION(2, 56, 0)
static inline void # define g_clear_handle_id(ptr, clear_func) \
g_clear_handle_id (guint *ptr, G_STMT_START { \
void (*clear_func) (guint handle_id)) guint __ptr = *(ptr); \
{ *(ptr) = 0; \
guint id = *ptr; if (__ptr != 0) \
*ptr = 0; clear_func (__ptr); \
if (id) } G_STMT_END
clear_func (handle_id);
}
#endif #endif