diff options
| author | Yunhao Tian <[email protected]> | 2021-11-30 17:11:09 +0800 |
|---|---|---|
| committer | Yunhao Tian <[email protected]> | 2021-11-30 17:19:11 +0800 |
| commit | ac20605e3f098687ce40349bbecc9266333d951b (patch) | |
| tree | 8d707fc933b2b8cd6decd2bc46820c31c55fd294 /src | |
| parent | dba59217da489dc497cbe2b573e7e144d085c869 (diff) | |
Ignore certain compiler options on ARMCC
ARMCC also sets __GNU__ macro, but doesn't support
GCC diagnostic pragmas.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/tusb_compiler.h | 4 | ||||
| -rw-r--r-- | src/device/dcd.h | 4 | ||||
| -rw-r--r-- | src/osal/osal.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h index d3284c62a..38e6a16d0 100644 --- a/src/common/tusb_compiler.h +++ b/src/common/tusb_compiler.h @@ -137,9 +137,11 @@ #define TU_BSWAP16(u16) (__builtin_bswap16(u16)) #define TU_BSWAP32(u32) (__builtin_bswap32(u32)) + #ifndef __ARMCC_VERSION // List of obsolete callback function that is renamed and should not be defined. // Put it here since only gcc support this pragma - #pragma GCC poison tud_vendor_control_request_cb + #pragma GCC poison tud_vendor_control_request_cb + #endif #elif defined(__TI_COMPILER_VERSION__) #define TU_ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes))) diff --git a/src/device/dcd.h b/src/device/dcd.h index c042cc708..fbcef40d4 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -106,12 +106,12 @@ typedef struct TU_ATTR_ALIGNED(4) void dcd_init (uint8_t rhport); // Interrupt Handler -#if __GNUC__ +#if __GNUC__ && !defined(__ARMCC_VERSION) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #endif void dcd_int_handler(uint8_t rhport); -#if __GNUC__ +#if __GNUC__ && !defined(__ARMCC_VERSION) #pragma GCC diagnostic pop #endif diff --git a/src/osal/osal.h b/src/osal/osal.h index c8131d19d..9194f80d5 100644 --- a/src/osal/osal.h +++ b/src/osal/osal.h @@ -67,7 +67,7 @@ typedef void (*osal_task_func_t)( void * ); // OSAL Porting API //--------------------------------------------------------------------+ -#if __GNUC__ +#if __GNUC__ && !defined(__ARMCC_VERSION) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wredundant-decls" #endif @@ -88,7 +88,7 @@ static inline osal_queue_t osal_queue_create(osal_queue_def_t* qdef); static inline bool osal_queue_receive(osal_queue_t qhdl, void* data); static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr); static inline bool osal_queue_empty(osal_queue_t qhdl); -#if __GNUC__ +#if __GNUC__ && !defined(__ARMCC_VERSION) #pragma GCC diagnostic pop #endif |
