summaryrefslogtreecommitdiff
path: root/lib/replace
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-12-13 17:40:52 +0100
committerJeremy Allison <jra@samba.org>2021-12-15 00:15:33 +0000
commit62dab3921b335d47a0c9c419714d0e2ea2320f74 (patch)
treeb991163bdafa8e3240aecc1966c59c31beab6a30 /lib/replace
parent1dc803048f8f0069079142245ec5ac4c11933bff (diff)
downloadsamba-62dab3921b335d47a0c9c419714d0e2ea2320f74.tar.gz
configure: Check for __atomic_add_fetch() and __atomic_load()
To be used in the tdb_seqnum code soon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/replace')
-rw-r--r--lib/replace/wscript16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/replace/wscript b/lib/replace/wscript
index a928b80f2f7..e60ff15f903 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -313,6 +313,22 @@ def configure(conf):
headers='stdint.h sys/atomic.h',
msg='Checking for atomic_add_32 compiler builtin')
+ conf.CHECK_CODE('''
+ uint32_t i,j;
+ j = __atomic_add_fetch(&i,1,__ATOMIC_SEQ_CST)
+ ''',
+ 'HAVE___ATOMIC_ADD_FETCH',
+ headers='stdint.h',
+ msg='Checking for __atomic_add_fetch compiler builtin')
+
+ conf.CHECK_CODE('''
+ uint32_t i,j;
+ __atomic_load(&i,&j,__ATOMIC_SEQ_CST)
+ ''',
+ 'HAVE___ATOMIC_ADD_LOAD',
+ headers='stdint.h',
+ msg='Checking for __atomic_load compiler builtin')
+
# Check for thread fence. */
tf = conf.CHECK_CODE('atomic_thread_fence(memory_order_seq_cst);',
'HAVE_ATOMIC_THREAD_FENCE',