[sysprof] macros: check for C++ 14 feature macros



commit 555ec04e322ec979c84a7a21d09a5afd9c02f672
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 6 16:09:03 2020 -0700

    macros: check for C++ 14 feature macros

 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 218414c..b16c3d9 100644
--- a/src/libsysprof-capture/sysprof-macros.h
+++ b/src/libsysprof-capture/sysprof-macros.h
@@ -70,7 +70,9 @@
 #define SYSPROF_GNUC_CHECK_VERSION(major, minor) 0
 #endif
 
-#if SYSPROF_GNUC_CHECK_VERSION(4, 6)
+#ifdef __cpp_static_assert
+# define SYSPROF_GNUC_CHECK_VERSION(expr, msg) static_assert(expr, msg)
+#elif SYSPROF_GNUC_CHECK_VERSION(4, 6)
 # define SYSPROF_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
 #else
 # define SYSPROF_STATIC_ASSERT(expr, msg) ((void) sizeof (char[(expr) ? 1 : -1]))


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