]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: fix detection of GNU atomis operations
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 8 Oct 2012 04:33:15 +0000 (22:33 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 8 Oct 2012 04:33:15 +0000 (22:33 -0600)
On MinGW the GNU atomis operatiosn symbols are defined but do not work.
We require a run-time test to detect problems. Not just a compiler check.

configure.ac

index 5c8771b4d80bb921cc920d8364176715c8b5aa30..4b915e107cc96f79abb4a08aa63912bfba94326c 100644 (file)
@@ -387,8 +387,8 @@ export enable_inline
 dnl
 dnl Check for atomic operations support in the compiler
 dnl
-AC_MSG_CHECKING([for atomic operations support])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+AC_MSG_CHECKING([for GNU atomic operations support])
+AC_RUN_IFELSE([AC_LANG_PROGRAM([[
     int n = 0;
 ]],[[
     __sync_add_and_fetch(&n, 10); // n becomes 10
@@ -399,8 +399,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
     return (n == 200) ? 0 : -1;
 ]])],
 [
-    AC_DEFINE(HAVE_ATOMIC_OPS,1,
-        [Define to 1 if you have __sync_add_and_fetch() and such])
+    AC_DEFINE(HAVE_ATOMIC_OPS,1,[Define to 1 if you have __sync_add_and_fetch() and such])
     AC_MSG_RESULT(yes)
 ],[
     AC_MSG_RESULT(no)