mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-11 15:40:53 +00:00
libsysprof: use macro to preserve types
This commit is contained in:
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user