mstd_cstddef: add C support and macros for C++11

pull/11892/head
Przemyslaw Stekiel 2019-09-11 09:37:53 +02:00
parent 3d719f7e35
commit a7b298f353
1 changed files with 16 additions and 0 deletions

View File

@ -27,8 +27,12 @@
* - - MSTD_CONSTEXPR_XX_14 macros that can be used to mark
* things that are valid as constexpr only for C++14 or later,
* permitting constexpr use where ARM C 5 would reject it.
* - - MSTD_CONSTEXPR_XX_11 macros that can be used to permit
* constexpr alternatives for C.
*/
#if __cplusplus
#include <cstddef>
/* Macros that can be used to mark functions and objects that are
@ -42,6 +46,9 @@
#define MSTD_CONSTEXPR_OBJ_14 const
#endif
#define MSTD_CONSTEXPR_FN_11 constexpr
#define MSTD_CONSTEXPR_OBJ_11 constexpr
#ifdef __CC_ARM
// [expr.alignof]
@ -72,4 +79,13 @@ using std::max_align_t;
}
#else // __cplusplus
#define MSTD_CONSTEXPR_FN_14 inline
#define MSTD_CONSTEXPR_OBJ_14 const
#define MSTD_CONSTEXPR_FN_11 inline
#define MSTD_CONSTEXPR_OBJ_11 const
#endif // __cplusplus
#endif // MSTD_CSTDDEF_