]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
configure: Avoid exit() when checking for __sync_sub_and_fetch()
authorAlex Richardson <arichardson@FreeBSD.org>
Wed, 25 May 2022 22:05:03 +0000 (22:05 +0000)
committerSimon McVittie <smcv@collabora.com>
Thu, 26 May 2022 11:26:38 +0000 (11:26 +0000)
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.

configure.ac

index 60a4cbe119aeef3a048c594bdfb032d733bdc008..3b225a299632e4d10d0ad2fd1380c1adcb9d765c 100644 (file)
@@ -625,7 +625,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])
   ])