]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Move loading of atomic vs. cstdatomic in atomic_compat.h.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 29 Feb 2012 15:41:03 +0000 (16:41 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Wed, 29 Feb 2012 15:41:03 +0000 (16:41 +0100)
atomic_compat.h [new file with mode: 0644]
sync_queue.h

diff --git a/atomic_compat.h b/atomic_compat.h
new file mode 100644 (file)
index 0000000..1fec370
--- /dev/null
@@ -0,0 +1,20 @@
+#ifndef ATOMIC_COMPAT_H
+#define ATOMIC_COMPAT_H
+
+#if __GNUC__ == 4 && __GNUC_MINOR__ == 4
+#  include <cstdatomic>         // <atomic> is named <cstdatomic> in gcc 4.4
+
+template<typename _Tp>          // fix missing definition in gcc 4.4
+void
+atomic<_Tp*>::store(_Tp* __v, memory_order __m) volatile
+{ atomic_address::store(__v, __m); }
+
+#else
+#  include <atomic>
+#endif
+
+#endif // !ATOMIC_COMPAT_H
+
+// Local variables:
+// mode: c++
+// End:
index c3f29e566f0b849a32c21a92c4e140a6f6c46d44..fc35339af8c5e2007ab7203a692ab905c44f5d97 100644 (file)
@@ -1,17 +1,7 @@
 #ifndef SYNC_QUEUE_H
 #define SYNC_QUEUE_H
 
-#if __GNUC__ == 4 && __GNUC_MINOR__ == 4
-#  include <cstdatomic>         // <atomic> is named <cstdatomic> in gcc 4.4
-
-template<typename _Tp>          // fix missing definition in gcc 4.4
-void
-atomic<_Tp*>::store(_Tp* __v, memory_order __m) volatile
-{ atomic_address::store(__v, __m); }
-
-#else
-#  include <atomic>
-#endif
+#include "atomic_compat.h"
 
 #define SYNC_QUEUE_BUFSIZE 16