diff options
-rw-r--r-- | docs/markdown/Reference-tables.md | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/c_function_attributes.py | 6 | ||||
-rw-r--r-- | test cases/common/197 function attributes/meson.build | 1 |
3 files changed, 10 insertions, 0 deletions
diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md index 2a6868c..8b05d49 100644 --- a/docs/markdown/Reference-tables.md +++ b/docs/markdown/Reference-tables.md @@ -246,6 +246,7 @@ which are supported by GCC, Clang, and other compilers. | pure | | retainā“ | | returns_nonnull | +| sectionāµ | | unused | | used | | visibility* | @@ -268,6 +269,8 @@ which are supported by GCC, Clang, and other compilers. ā“ *New in 0.62.0* +āµ *New in 0.63.0* + ### MSVC __declspec These values are supported using the MSVC style `__declspec` annotation, 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': diff --git a/test cases/common/197 function attributes/meson.build b/test cases/common/197 function attributes/meson.build index 9ec6388..4b48cef 100644 --- a/test cases/common/197 function attributes/meson.build +++ b/test cases/common/197 function attributes/meson.build @@ -49,6 +49,7 @@ attributes = [ 'noreturn', 'nothrow', 'pure', + 'section', 'unused', 'used', 'warn_unused_result', |