From: Amos Jeffries Date: Mon, 8 Oct 2012 04:33:15 +0000 (-0600) Subject: Windows: fix detection of GNU atomis operations X-Git-Tag: SQUID_3_4_0_1~606 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34e19edf63271de515ccb9a08d7cad1a82aee4c5;p=thirdparty%2Fsquid.git Windows: fix detection of GNU atomis operations 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. --- diff --git a/configure.ac b/configure.ac index 5c8771b4d8..4b915e107c 100644 --- a/configure.ac +++ b/configure.ac @@ -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)