mirror of
git://github.com/lxc/lxc
synced 2025-09-01 06:19:38 +00:00
Merge pull request #3983 from brauner/2021-09-29.fixes
build: compiler attribute improvements
This commit is contained in:
@@ -355,8 +355,13 @@ conf.set10('HAVE_STRCHRNUL', have)
|
|||||||
have = cc.has_function('openpty', prefix : '#include <pty.h>', args : '-D_GNU_SOURCE')
|
have = cc.has_function('openpty', prefix : '#include <pty.h>', args : '-D_GNU_SOURCE')
|
||||||
conf.set10('HAVE_OPENPTY', have)
|
conf.set10('HAVE_OPENPTY', have)
|
||||||
|
|
||||||
conf.set10('HAVE_COMPILER_ATTR_NONNULL', cc.has_function_attribute('nonnull'))
|
foreach ccattr : ['fallthrough',
|
||||||
conf.set10('HAVE_COMPILER_ATTR_RETURNS_NONNULL', cc.has_function_attribute('returns_nonnull'))
|
'nonnull',
|
||||||
|
'returns_nonnull',
|
||||||
|
]
|
||||||
|
|
||||||
|
conf.set10('HAVE_COMPILER_ATTR_' + ccattr.underscorify().to_upper(), cc.has_function_attribute(ccattr))
|
||||||
|
endforeach
|
||||||
|
|
||||||
config_h = configure_file(
|
config_h = configure_file(
|
||||||
output : 'config.h',
|
output : 'config.h',
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __GNUC__ >= 7
|
#if HAVE_COMPILER_ATTR_FALLTHROUGH || __GNUC__ >= 7
|
||||||
#define __fallthrough __attribute__((__fallthrough__))
|
#define __fallthrough __attribute__((__fallthrough__))
|
||||||
#else
|
#else
|
||||||
#define __fallthrough /* fall through */
|
#define __fallthrough /* fall through */
|
||||||
|
Reference in New Issue
Block a user