summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score/basedefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/include/rtems/score/basedefs.h')
-rw-r--r--cpukit/score/include/rtems/score/basedefs.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
index 1f8660cb9b..8239994c03 100644
--- a/cpukit/score/include/rtems/score/basedefs.h
+++ b/cpukit/score/include/rtems/score/basedefs.h
@@ -163,8 +163,16 @@
#define RTEMS_COMPILER_DEPRECATED_ATTRIBUTE
#endif
-#define RTEMS_STATIC_ASSERT(cond, msg) \
- typedef int rtems_static_assert_ ## msg [(cond) ? 1 : -1]
+#if __cplusplus >= 201103L
+ #define RTEMS_STATIC_ASSERT(cond, msg) \
+ static_assert(cond, # msg)
+#elif __STDC_VERSION__ >= 201112L
+ #define RTEMS_STATIC_ASSERT(cond, msg) \
+ _Static_assert(cond, # msg)
+#else
+ #define RTEMS_STATIC_ASSERT(cond, msg) \
+ typedef int rtems_static_assert_ ## msg [(cond) ? 1 : -1]
+#endif
#ifndef ASM
#ifdef RTEMS_DEPRECATED_TYPES