summaryrefslogtreecommitdiff
path: root/src/include/port/atomics/generic-sunpro.h
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2014-09-26 15:55:44 +0200
committerAndres Freund <andres@anarazel.de>2014-09-26 15:55:44 +0200
commitf9f07411a5b879b232ade66fece7071bd2eb5c26 (patch)
treecf7d7a9093dc59235ca9648afd75895242f18886 /src/include/port/atomics/generic-sunpro.h
parenta30199b01bd4b06bd13484baefb5f2f411ce14f4 (diff)
downloadpostgresql-f9f07411a5b879b232ade66fece7071bd2eb5c26.tar.gz
Further atomic ops portability improvements and bug fixes.
* Don't play tricks for a more efficient pg_atomic_clear_flag() in the generic gcc implementation. The old version was broken on gcc < 4.7 on !x86 platforms. Per buildfarm member chipmunk. * Make usage of __atomic() fences depend on HAVE_GCC__ATOMIC_INT32_CAS instead of HAVE_GCC__ATOMIC_INT64_CAS - there's platforms with 32bit support that don't support 64bit atomics. * Blindly fix two superflous #endif in generic-xlc.h * Check for --disable-atomics in platforms but x86.
Diffstat (limited to 'src/include/port/atomics/generic-sunpro.h')
-rw-r--r--src/include/port/atomics/generic-sunpro.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/port/atomics/generic-sunpro.h b/src/include/port/atomics/generic-sunpro.h
index b71b5230d3..77d3ebe003 100644
--- a/src/include/port/atomics/generic-sunpro.h
+++ b/src/include/port/atomics/generic-sunpro.h
@@ -17,6 +17,8 @@
* -------------------------------------------------------------------------
*/
+#if defined(HAVE_ATOMICS)
+
/* Older versions of the compiler don't have atomic.h... */
#ifdef HAVE_ATOMIC_H
@@ -36,9 +38,13 @@ typedef struct pg_atomic_uint64
#endif /* HAVE_ATOMIC_H */
+#endif /* defined(HAVE_ATOMICS) */
+
#if defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS)
+#if defined(HAVE_ATOMICS)
+
#ifdef HAVE_ATOMIC_H
#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32
@@ -71,4 +77,6 @@ pg_atomic_compare_exchange_u64_impl(volatile pg_atomic_uint64 *ptr,
#endif /* HAVE_ATOMIC_H */
+#endif /* defined(HAVE_ATOMICS) */
+
#endif /* defined(PG_USE_INLINE) || defined(ATOMICS_INCLUDE_DEFINITIONS) */