From 8f5e351ba6584886c256d88d2112bd1efab5f1bf Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 29 Feb 2012 16:41:03 +0100 Subject: [PATCH 1/1] Move loading of atomic vs. cstdatomic in atomic_compat.h. --- atomic_compat.h | 20 ++++++++++++++++++++ sync_queue.h | 12 +----------- 2 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 atomic_compat.h diff --git a/atomic_compat.h b/atomic_compat.h new file mode 100644 index 0000000..1fec370 --- /dev/null +++ b/atomic_compat.h @@ -0,0 +1,20 @@ +#ifndef ATOMIC_COMPAT_H +#define ATOMIC_COMPAT_H + +#if __GNUC__ == 4 && __GNUC_MINOR__ == 4 +# include // is named in gcc 4.4 + +template // fix missing definition in gcc 4.4 +void +atomic<_Tp*>::store(_Tp* __v, memory_order __m) volatile +{ atomic_address::store(__v, __m); } + +#else +# include +#endif + +#endif // !ATOMIC_COMPAT_H + +// Local variables: +// mode: c++ +// End: diff --git a/sync_queue.h b/sync_queue.h index c3f29e5..fc35339 100644 --- a/sync_queue.h +++ b/sync_queue.h @@ -1,17 +1,7 @@ #ifndef SYNC_QUEUE_H #define SYNC_QUEUE_H -#if __GNUC__ == 4 && __GNUC_MINOR__ == 4 -# include // is named in gcc 4.4 - -template // fix missing definition in gcc 4.4 -void -atomic<_Tp*>::store(_Tp* __v, memory_order __m) volatile -{ atomic_address::store(__v, __m); } - -#else -# include -#endif +#include "atomic_compat.h" #define SYNC_QUEUE_BUFSIZE 16 -- 2.39.5