mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 08:20:12 +01:00
meson: Test for __atomic_add_fetch in atomic checks
Some platforms have 64-bit __atomic_load_n but not 64-bit __atomic_add_fetch, so test for both of them. Bug: https://bugs.gentoo.org/655616 Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
This commit is contained in:
parent
b29b5a82a1
commit
9d547a7617
1 changed files with 5 additions and 2 deletions
|
|
@ -835,7 +835,9 @@ if cc.compiles('''#include <stdint.h>
|
|||
struct {
|
||||
uint64_t *v;
|
||||
} x;
|
||||
return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE);
|
||||
return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) &
|
||||
(int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL);
|
||||
|
||||
}''',
|
||||
name : 'GCC atomic builtins')
|
||||
pre_args += '-DUSE_GCC_ATOMIC_BUILTINS'
|
||||
|
|
@ -851,7 +853,8 @@ if cc.compiles('''#include <stdint.h>
|
|||
struct {
|
||||
uint64_t *v;
|
||||
} x;
|
||||
return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE);
|
||||
return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) &
|
||||
(int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL);
|
||||
}''',
|
||||
name : 'GCC atomic builtins required -latomic')
|
||||
dep_atomic = cc.find_library('atomic')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue