]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: fix detection of GNU atomic operations
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 8 Sep 2013 22:05:21 +0000 (16:05 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 8 Sep 2013 22:05:21 +0000 (16:05 -0600)
On MinGW the GNU atomic operations symbols are defined but do not work.
We require a run-time test to detect problems. Not just a compiler check.

configure.ac

index 53888095aa1d79f38d196c771898f6e28bf8888c..1746b1fb981b57544c316d5912f2dc028fc47b10 100644 (file)
@@ -391,8 +391,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
@@ -403,8 +403,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)