mirror of https://github.com/ARMmbed/mbed-os.git
mstd_cstddef: add C support and macros for C++11
parent
3d719f7e35
commit
a7b298f353
|
@ -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_
|
||||
|
|
Loading…
Reference in New Issue