From a0d75b1cce4b97e1d6b78ba2b7adf96988d55608 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 6 Jul 2021 12:26:44 +1200 Subject: [PATCH] lib/replace: For heimdal_build: Try to use the OS or compiler provided atomic operators This provides the defines that may be needed to use the compiler-provided atomics, rather than a fallback. Signed-off-by: Andrew Bartlett Reviewed-by: Joseph Sutton --- lib/replace/wscript | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/replace/wscript b/lib/replace/wscript index 53cb5d4fa76..a928b80f2f7 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -298,6 +298,13 @@ def configure(conf): 'HAVE___SYNC_FETCH_AND_ADD', msg='Checking for __sync_fetch_and_add compiler builtin') + conf.CHECK_CODE(''' + int i; + (void)__sync_add_and_fetch(&i, 1); + ''', + 'HAVE___SYNC_ADD_AND_FETCH', + msg='Checking for __sync_add_and_fetch compiler builtin') + conf.CHECK_CODE(''' int32_t i; atomic_add_32(&i, 1);