[libdazzle] util: use upstreamed macros
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] util: use upstreamed macros
- Date: Mon, 18 Jun 2018 23:18:12 +0000 (UTC)
commit 08c04737b82366443adbbe7cf033e209d21b07b6
Author: Christian Hergert <chergert redhat com>
Date: Mon Jun 18 16:15:34 2018 -0700
util: use upstreamed macros
These are in GLib now, so we can just call those.
src/util/dzl-macros.h | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/src/util/dzl-macros.h b/src/util/dzl-macros.h
index 5151e39..d0d6d72 100644
--- a/src/util/dzl-macros.h
+++ b/src/util/dzl-macros.h
@@ -38,11 +38,9 @@ G_BEGIN_DECLS
# define DZL_ALIGNED_END(_N) __attribute__((aligned(_N)))
#endif
-#define dzl_clear_weak_pointer(ptr) \
- (*(ptr) ? (g_object_remove_weak_pointer((GObject*)*(ptr), (gpointer*)ptr),*(ptr)=NULL,1) : 0)
-
-#define dzl_set_weak_pointer(ptr,obj) \
-
((obj!=*(ptr))?(dzl_clear_weak_pointer(ptr),*(ptr)=obj,((obj)?g_object_add_weak_pointer((GObject*)obj,(gpointer*)ptr),NULL:NULL),1):0)
+/* These were upstreamed into GLib, just use them */
+#define dzl_clear_weak_pointer(ptr) g_clear_weak_pointer(ptr)
+#define dzl_set_weak_pointer(ptr,obj) g_set_weak_pointer(ptr,obj)
/* strlen() gets hoisted out automatically at -O0 for everything but MSVC */
#define DZL_LITERAL_LENGTH(s) (strlen(s))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]