From 5d438b6aedbb074c06f6f9fa2f7972b422ccd1bd Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Thu, 19 May 2022 13:33:14 -0500 Subject: Add cc.has_function_attribute('section') --- mesonbuild/compilers/c_function_attributes.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mesonbuild/compilers/c_function_attributes.py') diff --git a/mesonbuild/compilers/c_function_attributes.py b/mesonbuild/compilers/c_function_attributes.py index ac145d8..faa6570 100644 --- a/mesonbuild/compilers/c_function_attributes.py +++ b/mesonbuild/compilers/c_function_attributes.py @@ -88,6 +88,12 @@ C_FUNC_ATTRIBUTES = { 'int foo(void) __attribute__((pure));', 'returns_nonnull': 'int *foo(void) __attribute__((returns_nonnull));', + 'section': ''' + #if defined(__APPLE__) && defined(__MACH__) + extern int foo __attribute__((section("__BAR,__bar"))); + #else + extern int foo __attribute__((section(".bar"))); + #endif''', 'unused': 'int foo(void) __attribute__((unused));', 'used': -- cgit v1.1