Fixed wxAtomicInc/Dec() to not use asm/atomic.h header on Linux - it's kernel internal, not available for userspace in newer kernel versions and broken for userspace on some platforms. Use GCC's builtins instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48640 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-09-10 22:27:15 +00:00
parent eb2d0d232c
commit 479647105b
7 changed files with 13864 additions and 13615 deletions

View File

@@ -0,0 +1,26 @@
dnl Checks for availability of GCC's atomic operations builtins.
dnl Defines HAVE_GCC_ATOMIC_BUILTINS if available.
AC_DEFUN([WX_ATOMIC_BUILTINS],
[
AC_REQUIRE([AC_PROG_CC])
if test -n "$GCC"; then
AC_MSG_CHECKING([for __sync_fetch_* builtins])
AC_CACHE_VAL(wx_cv_cc_gcc_atomic_builtins, [
AC_TRY_COMPILE(
[],
[
int value=0;
__sync_fetch_and_add(&value, 1);
__sync_sub_and_fetch(&value, 1);
],
wx_cv_cc_gcc_atomic_builtins=yes,
wx_cv_cc_gcc_atomic_builtins=no)
])
AC_MSG_RESULT([$wx_cv_cc_gcc_atomic_builtins])
if test $wx_cv_cc_gcc_atomic_builtins = yes; then
AC_DEFINE([HAVE_GCC_ATOMIC_BUILTINS])
fi
fi
])