diff options
| author | hathach <[email protected]> | 2013-03-04 15:01:33 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-03-04 15:01:33 +0700 |
| commit | 656da2992ded914c70da849f9f7a1571dd2b91f4 (patch) | |
| tree | 3e00db7c1c2cf57276fd61ae833e54ff1ea67364 /tinyusb/common/assertion.h | |
| parent | 5207875addf972f8323b51318975c6c6f3861dd4 (diff) | |
add alignof to compilier specific
add static_assert support for IAR (built-in support)
Diffstat (limited to 'tinyusb/common/assertion.h')
| -rw-r--r-- | tinyusb/common/assertion.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tinyusb/common/assertion.h b/tinyusb/common/assertion.h index dba812959..4082f4b59 100644 --- a/tinyusb/common/assertion.h +++ b/tinyusb/common/assertion.h @@ -61,13 +61,17 @@ extern "C" //--------------------------------------------------------------------+ // Compile-time Assert //--------------------------------------------------------------------+ -#if defined __COUNTER__ && __COUNTER__ != __COUNTER__ - #define _ASSERT_COUNTER __COUNTER__ +#ifdef __ICCARM__ + #define STATIC_ASSERT static_assert #else - #define _ASSERT_COUNTER __LINE__ -#endif + #if defined __COUNTER__ && __COUNTER__ != __COUNTER__ + #define _ASSERT_COUNTER __COUNTER__ + #else + #define _ASSERT_COUNTER __LINE__ + #endif -#define STATIC_ASSSERT(const_expr) enum { XSTRING_CONCAT(static_assert_, _ASSERT_COUNTER) = 1/(!!(const_expr)) } + #define STATIC_ASSERT(const_expr, message) enum { XSTRING_CONCAT_(static_assert_, _ASSERT_COUNTER) = 1/(!!(const_expr)) } +#endif //#if ( defined CFG_PRINTF_UART || defined CFG_PRINTF_USBCDC || defined CFG_PRINTF_DEBUG ) #if TUSB_CFG_DEBUG == 3 |
