-foreach attr : ['malloc', 'nonnull', 'warn_unused_result']
- cc.has_function_attribute(attr)
+foreach attr : ['malloc', 'nonnull', 'warn_unused_result', 'packed', 'format']
+ if cc.has_function_attribute(attr)
+ cdata.set('HAVE_ATTR_' + attr.to_upper(), 1,
+ description: '__attribute__((__@0@__))'.format(attr))
+ endif