diff options
author | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-12-19 14:11:48 +0100 |
---|---|---|
committer | Vladislav Vaintroub <vvaintroub@mysql.com> | 2009-12-19 14:11:48 +0100 |
commit | 3de04825514e4dc3fd6f1a8f5eb18a280f817699 (patch) | |
tree | d5461ec6ad35812385dd5cfef327052838c471b4 /configure.cmake | |
parent | 4f233c43b11b6f4f159350a192fa3fb3e3ce6c9a (diff) | |
parent | 02b76970c5da2b836d322e4189cdde79a5c15f4c (diff) | |
download | mariadb-git-3de04825514e4dc3fd6f1a8f5eb18a280f817699.tar.gz |
merge
Diffstat (limited to 'configure.cmake')
-rw-r--r-- | configure.cmake | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/configure.cmake b/configure.cmake index 828c277c1dc..a0db5669471 100644 --- a/configure.cmake +++ b/configure.cmake @@ -486,6 +486,7 @@ SET(HAVE_ALLOCA 1) CHECK_FUNCTION_EXISTS_UNIX (backtrace HAVE_BACKTRACE) CHECK_FUNCTION_EXISTS_UNIX (backtrace_symbols HAVE_BACKTRACE_SYMBOLS) CHECK_FUNCTION_EXISTS_UNIX (backtrace_symbols_fd HAVE_BACKTRACE_SYMBOLS_FD) +CHECK_FUNCTION_EXISTS_UNIX (printstack HAVE_PRINTSTACK) CHECK_FUNCTION_EXISTS_UNIX (bcmp HAVE_BCMP) CHECK_FUNCTION_EXISTS_UNIX (bfill HAVE_BFILL) CHECK_FUNCTION_EXISTS_UNIX (bmove HAVE_BMOVE) @@ -1207,16 +1208,24 @@ ELSEIF(NOT WITH_ATOMIC_OPS) CHECK_CXX_SOURCE_COMPILES(" int main() { - int foo= -10; - int bar= 10; + int foo= -10; int bar= 10; + long long int foo64= -10; long long int bar64= 10; if (!__sync_fetch_and_add(&foo, bar) || foo) return -1; bar= __sync_lock_test_and_set(&foo, bar); if (bar || foo != 10) - return -1; + return -1; bar= __sync_val_compare_and_swap(&bar, foo, 15); if (bar) return -1; + if (!__sync_fetch_and_add(&foo64, bar64) || foo64) + return -1; + bar64= __sync_lock_test_and_set(&foo64, bar64); + if (bar64 || foo64 != 10) + return -1; + bar64= __sync_val_compare_and_swap(&bar64, foo, 15); + if (bar64) + return -1; return 0; }" HAVE_GCC_ATOMIC_BUILTINS) @@ -1238,17 +1247,27 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS") #include <atomic.h> int main() { - int foo = -10; int bar = 10; - if (atomic_add_int_nv((uint_t *)&foo, bar) || foo) - return -1; - bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar); - if (bar || foo != 10) - return -1; - bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15); - if (bar) - return -1; - return 0; - } + int foo = -10; int bar = 10; + int64_t foo64 = -10; int64_t bar64 = 10; + if (atomic_add_int_nv((uint_t *)&foo, bar) || foo) + return -1; + bar = atomic_swap_uint((uint_t *)&foo, (uint_t)bar); + if (bar || foo != 10) + return -1; + bar = atomic_cas_uint((uint_t *)&bar, (uint_t)foo, 15); + if (bar) + return -1; + if (atomic_add_64_nv((volatile uint64_t *)&foo64, bar64) || foo64) + return -1; + bar64 = atomic_swap_64((volatile uint64_t *)&foo64, (uint64_t)bar64); + if (bar64 || foo64 != 10) + return -1; + bar64 = atomic_cas_64((volatile uint64_t *)&bar64, (uint_t)foo64, 15); + if (bar64) + return -1; + atomic_or_64((volatile uint64_t *)&bar64, 0); + return 0; + } " HAVE_SOLARIS_ATOMIC) ENDIF() |