We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7004100 commit 56a043cCopy full SHA for 56a043c
platform/mbed_assert.h
@@ -24,7 +24,6 @@
24
#ifndef MBED_ASSERT_H
25
#define MBED_ASSERT_H
26
27
-#include <stdbool.h>
28
#include "mbed_preprocessor.h"
29
#include "mbed_toolchain.h"
30
@@ -125,8 +124,14 @@ do { \
125
124
* };
126
* @endcode
127
*/
+#if defined(__cplusplus) && (__cplusplus >= 201103L || __cpp_static_assert >= 200410L)
128
+#define MBED_STRUCT_STATIC_ASSERT(expr, msg) static_assert(expr, msg)
129
+#elif !defined(__cplusplus) && __STDC_VERSION__ >= 201112L
130
+#define MBED_STRUCT_STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
131
+#else
132
+#include <stdbool.h>
133
#define MBED_STRUCT_STATIC_ASSERT(expr, msg) bool : (expr) ? 0 : -1
-
134
+#endif
135
136
#endif
137
0 commit comments