diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-10 06:43:39 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-02-19 07:07:04 +0100 |
commit | be60372136ac4f5acd8bc3286da6ed3fc50fa053 (patch) | |
tree | 512b7b112b73f231ed52833840137cfa9205bd5d /cpukit/include/rtems/score | |
parent | shell.c: Fix Dereference before null check (CID #1467420) (diff) | |
download | rtems-be60372136ac4f5acd8bc3286da6ed3fc50fa053.tar.bz2 |
basedefs: Add RTEMS_ALIGNOF()
Diffstat (limited to 'cpukit/include/rtems/score')
-rw-r--r-- | cpukit/include/rtems/score/basedefs.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/cpukit/include/rtems/score/basedefs.h b/cpukit/include/rtems/score/basedefs.h index c3a46f52b3..c423c530b2 100644 --- a/cpukit/include/rtems/score/basedefs.h +++ b/cpukit/include/rtems/score/basedefs.h @@ -10,7 +10,7 @@ /* * Copyright (C) 2014 Paval Pisa * Copyright (C) 2011, 2013 On-Line Applications Research Corporation (OAR) - * Copyright (C) 2009, 2020 embedded brains GmbH (http://www.embedded-brains.de) + * Copyright (C) 2009, 2021 embedded brains GmbH (http://www.embedded-brains.de) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -156,6 +156,25 @@ extern "C" { #define RTEMS_ALIGNED( _alignment ) #endif +/* Generated from spec:/rtems/basedefs/if/alignof */ + +/** + * @ingroup RTEMSAPIBaseDefs + * + * @brief Gets the alignment requirement of the type. + * + * @param _type_name is the type name to get the alignment requirement for. + * + * @return Returns the alignment requirement of the type. + */ +#if __cplusplus >= 201103L + #define RTEMS_ALIGNOF( _type_name ) alignof( _type_name ) +#elif __STDC_VERSION__ >= 201112L + #define RTEMS_ALIGNOF( _type_name ) _Alignof( _type_name ) +#else + #define RTEMS_ALIGNOF( _type_name ) sizeof( _type_name ) +#endif + /* Generated from spec:/rtems/basedefs/if/alloc-align */ /** |