]> git.saurik.com Git - wxWidgets.git/blobdiff - build/aclocal/atomic_builtins.m4
Removed queuedResize code again as GTK+ does this internally already
[wxWidgets.git] / build / aclocal / atomic_builtins.m4
index bf2bcd17e3c8e850cee1cdc6500d1169351083b2..8366eb3ef4b2d6542c8b19cdfc34673bb567ce98 100644 (file)
@@ -6,14 +6,17 @@ AC_DEFUN([WX_ATOMIC_BUILTINS],
 [
   AC_REQUIRE([AC_PROG_CC])
   if test -n "$GCC"; then
 [
   AC_REQUIRE([AC_PROG_CC])
   if test -n "$GCC"; then
-    AC_MSG_CHECKING([for __sync_fetch_* builtins])
+    AC_MSG_CHECKING([for __sync_fetch_and_add and __sync_sub_and_fetch builtins])
     AC_CACHE_VAL(wx_cv_cc_gcc_atomic_builtins, [
       AC_TRY_LINK(
         [],
         [
           unsigned int value=0;
     AC_CACHE_VAL(wx_cv_cc_gcc_atomic_builtins, [
       AC_TRY_LINK(
         [],
         [
           unsigned int value=0;
-          __sync_fetch_and_add(&value, 1);
+          /* wxAtomicInc doesn't use return value here */
+          __sync_fetch_and_add(&value, 2);
           __sync_sub_and_fetch(&value, 1);
           __sync_sub_and_fetch(&value, 1);
+          /* but wxAtomicDec does, so mimic that: */
+          unsigned int r2 = __sync_sub_and_fetch(&value, 1);
         ],
         wx_cv_cc_gcc_atomic_builtins=yes,
         wx_cv_cc_gcc_atomic_builtins=no)
         ],
         wx_cv_cc_gcc_atomic_builtins=yes,
         wx_cv_cc_gcc_atomic_builtins=no)