File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 123123// --------------------------------------------------------------------+
124124
125125// TODO refactor since __attribute__ is supported across many compiler
126- #if defined(__GNUC__)
126+ #if defined(__GNUC__) || defined (__clang__)
127127 #define TU_ATTR_ALIGNED (Bytes ) __attribute__ ((aligned(Bytes)))
128128 #define TU_ATTR_SECTION (sec_name ) __attribute__ ((section(#sec_name)))
129129 #define TU_ATTR_PACKED __attribute__ ((packed))
130- #define TU_ATTR_WEAK __attribute__ ((weak))
130+ #if defined (__clang__)
131+ #define TU_ATTR_WEAK __attribute__ ((weak_import))
132+ #else
133+ #define TU_ATTR_WEAK __attribute__ ((weak))
134+ #endif
131135 #ifndef TU_ATTR_ALWAYS_INLINE // allow to override for debug
132136 #define TU_ATTR_ALWAYS_INLINE __attribute__ ((always_inline))
133137 #endif
You can’t perform that action at this time.
0 commit comments