[sysprof: 43/63] libsysprof-capture: Avoid using G_STMT_{START, END} from GLib



commit d83adffd2db0b6683e6bf4cdf3d12ae8c5be954a
Author: Philip Withnall <withnall endlessm com>
Date:   Thu Jul 2 12:29:59 2020 +0100

    libsysprof-capture: Avoid using G_STMT_{START,END} from GLib
    
    Open-code them instead, as they’re relatively simple.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Helps: #40

 src/libsysprof-capture/sysprof-collector.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/libsysprof-capture/sysprof-collector.c b/src/libsysprof-capture/sysprof-collector.c
index d36b7f4..0175073 100644
--- a/src/libsysprof-capture/sysprof-collector.c
+++ b/src/libsysprof-capture/sysprof-collector.c
@@ -281,7 +281,7 @@ sysprof_collector_init (void)
 }
 
 #define COLLECTOR_BEGIN                                           \
-  G_STMT_START {                                                  \
+  do {                                                  \
     const SysprofCollector *collector = sysprof_collector_get (); \
     if SYSPROF_LIKELY (collector->buffer)                         \
       {                                                           \
@@ -296,7 +296,7 @@ sysprof_collector_init (void)
         if SYSPROF_UNLIKELY (collector->is_shared)                \
           G_UNLOCK (control_fd);                                  \
       }                                                           \
-  } G_STMT_END
+  } while (0)
 
 void
 sysprof_collector_allocate (SysprofCaptureAddress   alloc_addr,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]