From 6d7ec5fc6d62f9749e1d2634625f85104f64b41b Mon Sep 17 00:00:00 2001 From: Alex Richardson Date: Wed, 25 May 2022 22:05:03 +0000 Subject: [PATCH] configure: Avoid exit() when checking for __sync_sub_and_fetch() Use of exit() requires a stdlib.h include. This check was failing for me since the compiler defaulted to -Werror=implicit-function-declaration, so __sync_sub_and_fetch() support was not dectected. (cherry picked from commit 56e52a4212cb78e55d1bdee9c1f2a85a205c1ee9) Backported-from: dbus!320 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index e33df00b..61f22dc2 100644 --- a/configure.ac +++ b/configure.ac @@ -613,7 +613,7 @@ AS_IF([test -n "$dbus_va_copy_func"], AC_CACHE_CHECK([whether $CC knows __sync_sub_and_fetch()], dbus_cv_sync_sub_and_fetch, [AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[]], [[int a = 4; int b = __sync_sub_and_fetch(&a, 4); exit(b); ]])], + AC_LANG_PROGRAM([[]], [[int a = 4; int b = __sync_sub_and_fetch(&a, 4); return b; ]])], [dbus_cv_sync_sub_and_fetch=yes], [dbus_cv_sync_sub_and_fetch=no]) ])