Disable function attributes on unsupported compilers
[tinc] / src / meson.build
index 484b514..af2410d 100644 (file)
@@ -11,10 +11,10 @@ cdata.set_quoted('SBINDIR', dir_sbin)
 
 cdata.set('HAVE_' + os_name.to_upper(), 1)
 
-foreach attr : ['malloc', 'nonnull', 'warn_unused_result', 'packed']
+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))
+              description: '__attribute__((__@0@__))'.format(attr))
   endif
 endforeach