File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,18 @@ constexpr bool runtime_assertion = true;
3333#include < unistd.h>
3434#endif
3535
36+ // assert macro that avoids unused variable warnings
37+ #ifdef NDEBUG
38+ // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
39+ #define reactor_assert (x ) \
40+ do { \
41+ (void )sizeof (x); \
42+ } while (0 )
43+ #else
44+ // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
45+ #define reactor_assert (x ) assert (x)
46+ #endif
47+
3648namespace reactor {
3749using EnvPhase = Environment::Phase;
3850
@@ -67,18 +79,6 @@ constexpr inline void validate([[maybe_unused]] bool condition, [[maybe_unused]]
6779 }
6880}
6981
70- // assert macro that avoids unused variable warnings
71- #ifdef NDEBUG
72- // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
73- #define reactor_assert (x ) \
74- do { \
75- (void )sizeof (x); \
76- } while (0 )
77- #else
78- // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
79- #define reactor_assert (x ) assert (x)
80- #endif
81-
8282template <typename E> constexpr auto extract_value (E enum_value) -> typename std::underlying_type<E>::type {
8383 return static_cast <typename std::underlying_type<E>::type>(enum_value);
8484}
You can’t perform that action at this time.
0 commit comments