[PATCH] score: Support static_assert and _Static_assert
Ralf Corsepius
ralf.corsepius at rtems.org
Mon Nov 5 04:01:54 UTC 2012
On 11/04/2012 07:56 PM, Sebastian Huber wrote:
> ---
> cpukit/score/include/rtems/score/basedefs.h | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/cpukit/score/include/rtems/score/basedefs.h b/cpukit/score/include/rtems/score/basedefs.h
> index 1f8660c..8239994 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
>
This patch longs for an explanation - Which issue/bug are you trying to fix?
I do not see any sense in this patch,
Ralf
More information about the devel
mailing list