mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
macros: simplify static assert fallback to use __COUNTER__
It is rather annoying that the other sizeof form doesn't work with Clang. This at least gets things working (assuming you have __COUNTER__ support) which most things we care about do at this point (including MSVC).
This commit is contained in:
@ -75,7 +75,7 @@
|
|||||||
#elif SYSPROF_GNUC_CHECK_VERSION(4, 6)
|
#elif SYSPROF_GNUC_CHECK_VERSION(4, 6)
|
||||||
# define SYSPROF_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
|
# define SYSPROF_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
|
||||||
#else
|
#else
|
||||||
# define SYSPROF_STATIC_ASSERT(expr, msg) ((void) sizeof (char[(expr) ? 1 : -1]))
|
# define SYSPROF_STATIC_ASSERT(expr, msg) char __static_assert_##__COUNTER__ [(expr) ? 0 : -1];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if INT_MAX == LONG_MAX
|
#if INT_MAX == LONG_MAX
|
||||||
|
|||||||
Reference in New Issue
Block a user