From: Amos Jeffries Date: Sun, 8 Sep 2013 22:05:21 +0000 (-0600) Subject: Windows: fix detection of GNU atomic operations X-Git-Tag: SQUID_3_3_10~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75bece468f15d779d617fc9f00658986f78284c5;p=thirdparty%2Fsquid.git Windows: fix detection of GNU atomic operations 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. --- diff --git a/configure.ac b/configure.ac index 53888095aa..1746b1fb98 100644 --- a/configure.ac +++ b/configure.ac @@ -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)