[sysprof] capture: fix compilation on Clang 11



commit 254b9f8f6973dd97d777b5522c6d0ed455c3c532
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 16 12:41:09 2020 -0700

    capture: fix compilation on Clang 11
    
    Fixes #48

 src/libsysprof-capture/sysprof-macros.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/libsysprof-capture/sysprof-macros.h b/src/libsysprof-capture/sysprof-macros.h
index 7ffc7c3..9292f92 100644
--- a/src/libsysprof-capture/sysprof-macros.h
+++ b/src/libsysprof-capture/sysprof-macros.h
@@ -75,7 +75,9 @@
 #elif SYSPROF_GNUC_CHECK_VERSION(4, 6)
 # define SYSPROF_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
 #else
-# define SYSPROF_STATIC_ASSERT(expr, msg) char __static_assert_##__COUNTER__ [(expr) ? 0 : -1];
+# define _SYSPROF_STATIC_ASSERT2(expr, msg, id) typedef char __static_assert_##id[(expr) ? 0 : -1];
+# define _SYSPROF_STATIC_ASSERT(expr, msg, id) _SYSPROF_STATIC_ASSERT2(expr, msg, id)
+# define SYSPROF_STATIC_ASSERT(expr, msg) _SYSPROF_STATIC_ASSERT(expr, msg, __COUNTER__)
 #endif
 
 #if INT_MAX == LONG_MAX


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