mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-21 23:50:40 +01:00
meson: Replicate Autotools check for __sync_sub_and_fetch
The built-in atomic intrinsics are not exactly functions, so it's incorrect to use has_function to check for them. Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
parent
ec3edd80a6
commit
35eca11708
1 changed files with 13 additions and 2 deletions
15
meson.build
15
meson.build
|
|
@ -615,8 +615,19 @@ endif
|
|||
config.set('DBUS_VA_COPY', va_copy)
|
||||
|
||||
|
||||
#### Atomic integers
|
||||
config.set10('DBUS_USE_SYNC', cc.has_function('__sync_sub_and_fetch') ? 1 : false)
|
||||
# Can't use cc.has_function here because atomic operations are not
|
||||
# exactly functions
|
||||
config.set10(
|
||||
'DBUS_USE_SYNC',
|
||||
cc.links('''
|
||||
int main(void)
|
||||
{
|
||||
int a = 4;
|
||||
int b = __sync_sub_and_fetch (&a, 4);
|
||||
return b;
|
||||
}
|
||||
''')
|
||||
)
|
||||
|
||||
config.set10('HAVE_DECL_MSG_NOSIGNAL',
|
||||
cc.has_header_symbol('sys/socket.h', 'MSG_NOSIGNAL')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue