add_project_arguments('-Werror=shadow', language : 'c')
endif
+have = cc.compiles(
+ '__attribute__((__retain__)) int x;',
+ args : '-Werror=attributes',
+ name : '__attribute__((__retain__))')
+conf.set10('HAVE_ATTRIBUTE_RETAIN', have)
+
if cxx_cmd != ''
add_project_arguments(cxx.get_supported_arguments(basic_disabled_warnings), language : 'cpp')
endif
efi_conf = configuration_data()
# import several configs from userspace
-foreach name : ['HAVE_WARNING_ZERO_LENGTH_BOUNDS', 'HAVE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT']
- efi_conf.set10(name, conf.get(name) == 1)
+foreach name : ['HAVE_ATTRIBUTE_RETAIN',
+ 'HAVE_WARNING_ZERO_AS_NULL_POINTER_CONSTANT',
+ 'HAVE_WARNING_ZERO_LENGTH_BOUNDS',
+ ]
+ efi_conf.set(name, conf.get(name))
endforeach
efi_conf.set10('ENABLE_TPM', get_option('tpm'))
#define _printf_(a, b) __attribute__((__format__(printf, a, b)))
#define _public_ __attribute__((__visibility__("default")))
#define _pure_ __attribute__((__pure__))
-#define _retain_ __attribute__((__retain__))
#define _returns_nonnull_ __attribute__((__returns_nonnull__))
#define _section_(x) __attribute__((__section__(x)))
#define _sentinel_ __attribute__((__sentinel__))
#define _weak_ __attribute__((__weak__))
#define _weakref_(x) __attribute__((__weakref__(#x)))
+#if HAVE_ATTRIBUTE_RETAIN
+# define _retain_ __attribute__((__retain__))
+#else
+# define _retain_
+#endif
+
#ifdef __clang__
# define _alloc_(...)
#else