From: Arnaud Giersch Date: Wed, 29 Feb 2012 15:41:03 +0000 (+0100) Subject: Move loading of atomic vs. cstdatomic in atomic_compat.h. X-Git-Tag: exp_20120229~6 X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/loba.git/commitdiff_plain/8f5e351ba6584886c256d88d2112bd1efab5f1bf Move loading of atomic vs. cstdatomic in 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