diff options
author | Lukáš Lalinský <lukas@oxygene.sk> | 2014-12-08 16:52:33 -0800 |
---|---|---|
committer | Lukáš Lalinský <lukas@oxygene.sk> | 2014-12-08 16:52:33 -0800 |
commit | 735e17f504d359913c8892b22004861f6c989d89 (patch) | |
tree | 8f1904f39e7d001ecf0cb29e2377fd8dcfc1052f /ConfigureChecks.cmake | |
parent | fb1c744dafc13495240e8eaa6975654c1894c18b (diff) | |
parent | 0731bc7b2e2b532b8dec588313aca73d83ed4955 (diff) |
Merge remote-tracking branch 'TsudaKageyu/64bit-atom'
Conflicts:
ConfigureChecks.cmake
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 97654f91..d436e358 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -66,65 +66,65 @@ endif() check_cxx_source_compiles(" #include <atomic> - int main() { + int main() { std::atomic<unsigned int> x; x.fetch_add(1); x.fetch_sub(1); - return 0; + return 0; } " HAVE_STD_ATOMIC) if(NOT HAVE_STD_ATOMIC) check_cxx_source_compiles(" #include <boost/atomic.hpp> - int main() { + int main() { boost::atomic<unsigned int> x(1); x.fetch_add(1); x.fetch_sub(1); - return 0; + return 0; } " HAVE_BOOST_ATOMIC) if(NOT HAVE_BOOST_ATOMIC) check_cxx_source_compiles(" - int main() { + int main() { volatile int x; __sync_add_and_fetch(&x, 1); int y = __sync_sub_and_fetch(&x, 1); - return 0; + return 0; } " HAVE_GCC_ATOMIC) if(NOT HAVE_GCC_ATOMIC) check_cxx_source_compiles(" #include <libkern/OSAtomic.h> - int main() { + int main() { volatile int32_t x; OSAtomicIncrement32Barrier(&x); int32_t y = OSAtomicDecrement32Barrier(&x); - return 0; + return 0; } " HAVE_MAC_ATOMIC) if(NOT HAVE_MAC_ATOMIC) check_cxx_source_compiles(" #include <windows.h> - int main() { + int main() { volatile LONG x; InterlockedIncrement(&x); LONG y = InterlockedDecrement(&x); - return 0; + return 0; } " HAVE_WIN_ATOMIC) if(NOT HAVE_WIN_ATOMIC) check_cxx_source_compiles(" #include <ia64intrin.h> - int main() { + int main() { volatile int x; __sync_add_and_fetch(&x, 1); int y = __sync_sub_and_fetch(&x, 1); - return 0; + return 0; } " HAVE_IA64_ATOMIC) endif() @@ -135,26 +135,26 @@ endif() # Determine which kind of byte swap functions your compiler supports. -# GCC's __builtin_bswap* should be checked individually +# GCC's __builtin_bswap* should be checked individually # because some of them can be missing depends on the GCC version. check_cxx_source_compiles(" int main() { __builtin_bswap16(0); - return 0; + return 0; } " HAVE_GCC_BYTESWAP_16) check_cxx_source_compiles(" int main() { __builtin_bswap32(0); - return 0; + return 0; } " HAVE_GCC_BYTESWAP_32) check_cxx_source_compiles(" int main() { __builtin_bswap64(0); - return 0; + return 0; } " HAVE_GCC_BYTESWAP_64) @@ -165,7 +165,7 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP __bswap_16(0); __bswap_32(0); __bswap_64(0); - return 0; + return 0; } " HAVE_GLIBC_BYTESWAP) @@ -176,7 +176,7 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP _byteswap_ushort(0); _byteswap_ulong(0); _byteswap_uint64(0); - return 0; + return 0; } " HAVE_MSC_BYTESWAP) @@ -187,7 +187,7 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP OSSwapInt16(0); OSSwapInt32(0); OSSwapInt64(0); - return 0; + return 0; } " HAVE_MAC_BYTESWAP) @@ -198,7 +198,7 @@ if(NOT HAVE_GCC_BYTESWAP_16 OR NOT HAVE_GCC_BYTESWAP_32 OR NOT HAVE_GCC_BYTESWAP swap16(0); swap32(0); swap64(0); - return 0; + return 0; } " HAVE_OPENBSD_BYTESWAP) endif() |