File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
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))
175175 #pragma GCC poison tud_vendor_control_request_cb
176176 #endif
177177
178+ #if defined (__clang__)
179+ #undef TU_ATTR_WEAK
180+ #define TU_ATTR_WEAK __attribute__ ((weak_import))
181+ #endif
182+
178183#elif defined(__TI_COMPILER_VERSION__)
179184 #define TU_ATTR_ALIGNED (Bytes ) __attribute__ ((aligned(Bytes)))
180185 #define TU_ATTR_SECTION (sec_name ) __attribute__ ((section(#sec_name)))
You can’t perform that action at this time.
0 commit comments