Commit ac8a11fd authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

fix the tokudb build on 32 bit linux closes[t:2273]

git-svn-id: file:///svn/toku/tokudb@16708 c7de825b-a66e-492c-adef-691d508d4ae1
parent 12734e91
......@@ -281,3 +281,14 @@ toku_os_get_processor_frequency(uint64_t *hzret) {
r = toku_get_processor_frequency_cpuinfo(hzret);
return r;
}
#if __GNUC__ && __i386__
// workaround for a gcc 4.1.2 bug on 32 bit platforms.
uint64_t toku_sync_fetch_and_add_uint64(volatile uint64_t *a, uint64_t b) __attribute__((noinline));
uint64_t toku_sync_fetch_and_add_uint64(volatile uint64_t *a, uint64_t b) {
return __sync_fetch_and_add(a, b);
}
#endif
......@@ -41,24 +41,26 @@ toku_sync_fetch_and_add_uint64(volatile ULONGLONG *a, uint64_t b) {
#endif
#else
//Linux
#define TOKU_INLINE32 inline
static TOKU_INLINE32 int32_t toku_sync_fetch_and_add_int32(volatile int32_t *a, int32_t b) {
static inline int32_t toku_sync_fetch_and_add_int32(volatile 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(volatile uint64_t *a, uint64_t b) __attribute__((noinline));
uint64_t toku_sync_fetch_and_add_uint64(volatile 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(volatile uint64_t *a, uint64_t b) {
static inline uint64_t toku_sync_fetch_and_add_uint64(volatile uint64_t *a, uint64_t b) {
return __sync_fetch_and_add(a, b);
}
#endif
#endif
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment