123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- sizeof(((type_name *)0)->member_name)
- /*! Assertion. */
- #define SASI_ASSERT_CONCAT_(a, b) a##b
- #define SASI_ASSERT_CONCAT(a, b) SASI_ASSERT_CONCAT_(a, b)
- #define SASI_PAL_COMPILER_ASSERT(cond, message) \
- enum { SASI_ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(cond)) }
- #elif defined(__ARM_DSM__) || defined(__CC_ARM)
- #define inline
- /*! Associate a symbol with a link section. */
- #define SASI_PAL_COMPILER_SECTION(sectionName) __attribute__((section(sectionName)))
- /*! Mark symbol as used, i.e., prevent garbage collector from dropping it. */
- #define SASI_PAL_COMPILER_KEEP_SYMBOL __attribute__((used))
- /*! Make given data item aligned (alignment in bytes). */
- #define SASI_PAL_COMPILER_ALIGN(alignement) __attribute__((aligned(alignement)))
- /*! Mark function that never returns. */
- #define SASI_PAL_COMPILER_FUNC_NEVER_RETURNS __attribute__((noreturn))
- /*! Prevent function from being inlined. */
- #define SASI_PAL_COMPILER_FUNC_DONT_INLINE __attribute__((noinline))
- /*! Given data type may cast (alias) another data type pointer. */
- /* (this is used for "superclass" struct casting) */
- #define SASI_PAL_COMPILER_TYPE_MAY_ALIAS __attribute__((__may_alias__))
- /*! Get sizeof for a structure type member. */
- #define SASI_PAL_COMPILER_SIZEOF_STRUCT_MEMBER(type_name, member_name) \
- sizeof(((type_name *)0)->member_name)
- /*! Assertion. */
- #define SASI_ASSERT_CONCAT_(a, b) a##b
- #define SASI_ASSERT_CONCAT(a, b) SASI_ASSERT_CONCAT_(a, b)
- #define SASI_PAL_COMPILER_ASSERT(cond, message) \
- enum { SASI_ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(cond)) }
- #elif defined(__ARM_DS__)
- #define inline
- /*! Associate a symbol with a link section. */
- #define SASI_PAL_COMPILER_SECTION(sectionName) __attribute__((section(sectionName)))
- /*! Mark symbol as used, i.e., prevent garbage collector from dropping it. */
- #define SASI_PAL_COMPILER_KEEP_SYMBOL __attribute__((used))
- /*! Make given data item aligned (alignment in bytes). */
- #define SASI_PAL_COMPILER_ALIGN(alignement) __attribute__((aligned(alignement)))
- /*! Mark function that never returns. */
- #define SASI_PAL_COMPILER_FUNC_NEVER_RETURNS __attribute__((noreturn))
- /*! Prevent function from being inlined. */
- #define SASI_PAL_COMPILER_FUNC_DONT_INLINE __attribute__((noinline))
- /*! Given data type may cast (alias) another data type pointer. */
- /* (this is used for "superclass" struct casting) */
- #define SASI_PAL_COMPILER_TYPE_MAY_ALIAS
- /*! Get sizeof for a structure type member. */
- #define SASI_PAL_COMPILER_SIZEOF_STRUCT_MEMBER(type_name, member_name) \
- sizeof(((type_name *)0)->member_name)
- /*! Assertion. */
- #define SASI_ASSERT_CONCAT_(a, b) a##b
- #define SASI_ASSERT_CONCAT(a, b) SASI_ASSERT_CONCAT_(a, b)
- #define SASI_PAL_COMPILER_ASSERT(cond, message) \
- enum { SASI_ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(cond)) }
- #elif defined(__ICCARM__)
- /************************ Defines ******************************/
- /*! Associate a symbol with a link section. */
- #define SASI_PAL_COMPILER_SECTION(sectionName) __attribute__((section(sectionName)))
- /*! Mark symbol as used, i.e., prevent garbage collector from dropping it. */
- #define SASI_PAL_COMPILER_KEEP_SYMBOL __attribute__((used))
- /*! Make given data item aligned (alignment in bytes). */
- #define STRING_PRAGMA(x) _Pragma(#x)
- //#define SASI_PAL_COMPILER_ALIGN(n) STRING_PRAGMA(data_alignment = n)
- #define SASI_PAL_COMPILER_ALIGN(n)
- /*! Mark function that never returns. Not implemented */
- #define SASI_PAL_COMPILER_FUNC_NEVER_RETURNS
- /* Prevent function from being inlined */
- #define SASI_PAL_COMPILER_FUNC_DONT_INLINE STRING_PRAGMA(optimize = no_inline)
- /*! Given data type may cast (alias) another data type pointer. */
- /* (this is used for "superclass" struct casting). Not implemented */
- #define SASI_PAL_COMPILER_TYPE_MAY_ALIAS
- /*! Get sizeof for a structure type member. */
- #define SASI_PAL_COMPILER_SIZEOF_STRUCT_MEMBER(type_name, member_name) \
- sizeof(((type_name *)0)->member_name)
- /*! Assertion. */
- #define SASI_ASSERT_CONCAT_(a, b) a##b
- #define SASI_ASSERT_CONCAT(a, b) SASI_ASSERT_CONCAT_(a, b)
- #define SASI_PAL_COMPILER_ASSERT(cond, message) \
- enum { SASI_ASSERT_CONCAT(assert_line_, __LINE__) = 1/(!!(cond)) }
- #else
- #error Unsupported compiler.
- #endif
- /**
- @}
- */
- #endif /*__SSI_PAL_COMPILER_H__*/
|