Add __packed__ attribute on drop-in structs
[tinc] / src / meson.build
index b1796af..484b514 100644 (file)
@@ -11,8 +11,11 @@ cdata.set_quoted('SBINDIR', dir_sbin)
 
 cdata.set('HAVE_' + os_name.to_upper(), 1)
 
-foreach attr : ['malloc', 'nonnull', 'warn_unused_result']
-  cc.has_function_attribute(attr)
+foreach attr : ['malloc', 'nonnull', 'warn_unused_result', 'packed']
+  if cc.has_function_attribute(attr)
+    cdata.set('HAVE_ATTR_' + attr.to_upper(), 1,
+              description: '__attribute__(@0@)'.format(attr))
+  endif
 endforeach
 
 if cc.compiles('''