mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-13 19:19:18 +00:00
Fix CPP compilation with IAR
IAR defines __STDC_VERSION__ in cpp as well. Which causes TU_VERIFY_STATIC to be defined as _Static_assert instead of cpp's static_assert. This reorders __cplusplus__ to be first, then to fallback to __STDC_VERSION__ if not CPP.
This commit is contained in:
parent
fa895ed3dc
commit
81e33477ea
@ -51,10 +51,10 @@
|
||||
#endif
|
||||
|
||||
// Compile-time Assert
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#define TU_VERIFY_STATIC _Static_assert
|
||||
#elif defined (__cplusplus) && __cplusplus >= 201103L
|
||||
#if defined (__cplusplus) && __cplusplus >= 201103L
|
||||
#define TU_VERIFY_STATIC static_assert
|
||||
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#define TU_VERIFY_STATIC _Static_assert
|
||||
#elif defined(__CCRX__)
|
||||
#define TU_VERIFY_STATIC(const_expr, _mess) typedef char TU_XSTRCAT(Line, __LINE__)[(const_expr) ? 1 : 0];
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user