diff options
author | Bernard Normier <bernard@zeroc.com> | 2003-08-05 21:01:03 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2003-08-05 21:01:03 +0000 |
commit | a3b8e6df92d919f7f7aec4f1c54f55da28f9f242 (patch) | |
tree | 12458748e45e7234905a7db9fa305a7a75d12421 /cpp/include/IceUtil/Shared.h | |
parent | file IceAtomic.c was initially added on branch R1_1_branch. (diff) | |
download | ice-a3b8e6df92d919f7f7aec4f1c54f55da28f9f242.tar.bz2 ice-a3b8e6df92d919f7f7aec4f1c54f55da28f9f242.tar.xz ice-a3b8e6df92d919f7f7aec4f1c54f55da28f9f242.zip |
Merging from 1.1 branch
Diffstat (limited to 'cpp/include/IceUtil/Shared.h')
-rw-r--r-- | cpp/include/IceUtil/Shared.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/cpp/include/IceUtil/Shared.h b/cpp/include/IceUtil/Shared.h index 7666f999dbd..a6a7aff8895 100644 --- a/cpp/include/IceUtil/Shared.h +++ b/cpp/include/IceUtil/Shared.h @@ -17,7 +17,26 @@ #include <IceUtil/Config.h> -#if (defined(__linux) || defined(__FreeBSD__)) && defined(__i386) && !defined(__ICC) +// +// Here are the sparc64+linux atomic functions, if you wish them. +// +#if defined(__linux) && defined(__sparc__) && defined(USE_SPARC_ASM) && !defined(ICE_USE_MUTEX_SHARED) +# define ICE_HAS_ATOMIC_FUNCTIONS +extern "C" +{ +#include <asm-sparc64/atomic.h> +int __atomic_exchange_and_add(atomic_t *v, int i); +} +#define ice_atomic_t atomic_t +#define ice_atomic_set(v,i) atomic_set(v,i) +#define ice_atomic_inc(v) atomic_inc(v) +#define ice_atomic_dec_and_test(v) atomic_dec_and_test(v) +#define ice_atomic_exchange_add(i,v) (__atomic_exchange_and_add(v,i)) + +#elif defined(ICE_USE_MUTEX_SHARED) +# include <IceUtil/Mutex.h> + +#elif (defined(__linux) || defined(__FreeBSD__)) && defined(__i386) && !defined(__ICC) # define ICE_HAS_ATOMIC_FUNCTIONS // __ICC: The inline assembler causes problems with shared libraries. |