mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
7ac59d04df
git-svn-id: file:///svn/toku/tokudb@15815 c7de825b-a66e-492c-adef-691d508d4ae1
22 lines
588 B
C
22 lines
588 B
C
#if !defined(TOKU_ATOMIC_H)
|
|
#define TOKU_ATOMIC_H
|
|
|
|
#define TOKU_INLINE32 inline
|
|
|
|
static TOKU_INLINE32 int32_t toku_sync_fetch_and_add_int32(int32_t *a, int32_t b) {
|
|
return __sync_fetch_and_add(a, b);
|
|
}
|
|
|
|
#if __GNUC__ && __i386__
|
|
#define TOKU_INLINE64
|
|
// workaround for a gcc 4.1.2 bug on 32 bit platforms.
|
|
static uint64_t toku_sync_fetch_and_add_uint64(uint64_t *a, uint64_t b) __attribute__((noinline));
|
|
#else
|
|
#define TOKU_INLINE64 inline
|
|
#endif
|
|
|
|
static TOKU_INLINE64 uint64_t toku_sync_fetch_and_add_uint64(uint64_t *a, uint64_t b) {
|
|
return __sync_fetch_and_add(a, b);
|
|
}
|
|
|
|
#endif
|