2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / libstdc++-v3 / include / c_global / cstdatomic
blob22fde89603b5d7d7d9b77390482719df7aff1b2d
1 // -*- C++ -*- header.
3 // Copyright (C) 2008
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library.  This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
10 // any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this library; see the file COPYING.  If not, write to
19 // the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 // Boston, MA 02110-1301, USA.
22 // As a special exception, you may use this file as part of a free software
23 // library without restriction.  Specifically, if other files instantiate
24 // templates or use macros or inline functions from this file, or you compile
25 // this file and link it with other files to produce an executable, this
26 // file does not by itself cause the resulting executable to be covered by
27 // the GNU General Public License.  This exception does not however
28 // invalidate any other reasons why the executable file might be covered by
29 // the GNU General Public License.
31 /** @file cstdatomic
32  *  This is a Standard C++ Library file.  You should @c #include this file
33  *  in your programs, rather than any of the "*.h" implementation files.
34  *
35  *  This is the C++ version of the Standard C Library header @c stdatomic.h,
36  *  and its contents are (mostly) the same as that header, but are all
37  *  contained in the namespace @c std (except for names which are defined
38  *  as macros in C).
39  */
41 // Based on "C++ Atomic Types and Operations" by Hans Boehm and Lawrence Crowl.
42 // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html
44 #ifndef _GLIBCXX_STDATOMIC
45 #define _GLIBCXX_STDATOMIC 1
47 #pragma GCC system_header
49 #ifndef __GXX_EXPERIMENTAL_CXX0X__
50 # include <c++0x_warning.h>
51 #endif
53 #include <stdatomic.h>
54 #include <cstddef>
56 _GLIBCXX_BEGIN_NAMESPACE(std)
58   // Can either subclass or encapsulate "C" functionality, and here
59   // encapsulating works with C++2003's version of POD and so is
60   // portable across C++2003/200x. 
61   // Both end up being sub-optimal in terms of a constructor
62   // initialization list, but oh well.
64   /// atomic_flag
65   struct atomic_flag 
66   {
67     __atomic_flag_base _M_base;
69     bool 
70     test_and_set(memory_order __x = memory_order_seq_cst) volatile
71     { return atomic_flag_test_and_set_explicit(this, __x); }
73     void 
74     clear(memory_order __x = memory_order_seq_cst) volatile
75     { atomic_flag_clear_explicit(this, __x); }
77     void 
78     fence(memory_order __x) const volatile
79     { atomic_flag_fence(this, __x); }
81 #if _GLIBCXX_USE_STANDARD_LAYOUT
82     // Add in non-trivial default constructor that correctly
83     // initializes member "as if" by ATOMIC_FLAG_INIT.
84     atomic_flag() { _M_base._M_b = false; }
86   private:
87     atomic_flag(const atomic_flag&);
88     atomic_flag& operator=(const atomic_flag&);
89 #endif
90   };
92   /// 29.4.2, address types
93   typedef struct atomic_address
94   {
95     __atomic_address_base _M_base;
97     bool 
98     is_lock_free() const volatile;
100     void 
101     store(void*, memory_order = memory_order_seq_cst) volatile;
103     void* 
104     load(memory_order = memory_order_seq_cst) volatile;
106     void* 
107     swap(void*, memory_order = memory_order_seq_cst) volatile;
109     bool 
110     compare_swap(void*&, void*, memory_order, memory_order) volatile;
112     bool 
113     compare_swap(void*&, void*, memory_order = memory_order_seq_cst) volatile;
115     void 
116     fence(memory_order) const volatile;
118     void* 
119     fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
121     void* 
122     fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
124     void* 
125     operator=(void* __v) volatile
126     { store(__v); return __v; }
128     void* 
129     operator+=(ptrdiff_t __v) volatile
130     { return fetch_add(__v); }
132     void* 
133     operator-=(ptrdiff_t __v) volatile
134     { return fetch_sub(__v); }
136     friend void 
137     atomic_store_explicit(volatile atomic_address*, void*, memory_order);
139     friend void* 
140     atomic_load_explicit(volatile atomic_address*, memory_order);
142     friend void* 
143     atomic_swap_explicit(volatile atomic_address*, void*, memory_order);
145     friend bool 
146     atomic_compare_swap_explicit(volatile atomic_address*, void**, void*, 
147                                  memory_order, memory_order);
149     friend void 
150     atomic_fence(const volatile atomic_address*, memory_order);
152     friend void* 
153     atomic_fetch_add_explicit(volatile atomic_address*, ptrdiff_t, 
154                               memory_order);
156     friend void* 
157     atomic_fetch_sub_explicit(volatile atomic_address*, ptrdiff_t, 
158                               memory_order);
160     atomic_address() { }
162     explicit atomic_address(void* __v)
163     { _M_base._M_i = __v; }
165   private:
166     atomic_address(const atomic_address&);
167     atomic_address& operator=(const atomic_address &);
168   };
171   // 29.4.1 atomic integral types
172   // For each of the integral types, define atomic_[integral type] struct
173   // 
174   // atomic_bool     bool
175   // atomic_char     char
176   // atomic_schar    signed char
177   // atomic_uchar    unsigned char
178   // atomic_short    short
179   // atomic_ushort   unsigned short
180   // atomic_int      int
181   // atomic_uint     unsigned int
182   // atomic_long     long
183   // atomic_ulong    unsigned long
184   // atomic_llong    long long
185   // atomic_ullong   unsigned long long
186   // atomic_char16_t char16_t
187   // atomic_char32_t char32_t
188   // atomic_wchar_t  wchar_t
190   /// atomic_bool
191   struct atomic_bool
192   {
193     __atomic_bool_base _M_base;
195     bool 
196     is_lock_free() const volatile;
198     void 
199     store(bool, memory_order = memory_order_seq_cst) volatile;
201     bool 
202     load(memory_order = memory_order_seq_cst) volatile;
204     bool 
205     swap(bool, memory_order = memory_order_seq_cst) volatile;
207     bool 
208     compare_swap(bool&, bool, memory_order, memory_order) volatile;
210     bool 
211     compare_swap(bool&, bool, memory_order = memory_order_seq_cst) volatile;
213     void 
214     fence(memory_order) const volatile;
216     bool
217     operator=(bool __v) volatile { store(__v); return __v; }
219     friend void 
220     atomic_store_explicit(volatile atomic_bool*, bool, memory_order);
222     friend bool 
223     atomic_load_explicit(volatile atomic_bool*, memory_order);
225     friend bool 
226     atomic_swap_explicit(volatile atomic_bool*, bool, memory_order);
228     friend bool 
229     atomic_compare_swap_explicit(volatile atomic_bool*, bool*, bool,
230                                  memory_order, memory_order);
231     friend void 
232     atomic_fence(const volatile atomic_bool*, memory_order);
234     atomic_bool() { }
236     explicit atomic_bool(bool __v) { _M_base._M_i = __v; }
238   private:
239     atomic_bool(const atomic_bool&);
240     atomic_bool& operator=(const atomic_bool&);
241   };
243   /// atomic_char
244   struct atomic_char
245   {
246     __atomic_char_base _M_base;
248     bool 
249     is_lock_free() const volatile;
251     void 
252     store(char, memory_order = memory_order_seq_cst) volatile;
254     char 
255     load(memory_order = memory_order_seq_cst) volatile;
257     char 
258     swap(char, memory_order = memory_order_seq_cst) volatile;
260     bool 
261     compare_swap(char&, char, memory_order, memory_order) volatile;
263     bool 
264     compare_swap(char&, char, memory_order = memory_order_seq_cst) volatile;
266     void 
267     fence(memory_order) const volatile;
269     char 
270     fetch_add(char, memory_order = memory_order_seq_cst) volatile;
272     char 
273     fetch_sub(char, memory_order = memory_order_seq_cst) volatile;
275     char 
276     fetch_and(char, memory_order = memory_order_seq_cst) volatile;
278     char 
279     fetch_or(char, memory_order = memory_order_seq_cst) volatile;
281     char 
282     fetch_xor(char, memory_order = memory_order_seq_cst) volatile;
284     char 
285     operator=(char __v) volatile { store(__v); return __v; }
287     char 
288     operator++(int) volatile { return fetch_add(1); }
290     char 
291     operator--(int) volatile { return fetch_sub(1); }
293     char 
294     operator++() volatile { return fetch_add(1) + 1; }
296     char 
297     operator--() volatile { return fetch_sub(1) - 1; }
299     char 
300     operator+=(char __v) volatile { return fetch_add(__v) + __v; }
302     char 
303     operator-=(char __v) volatile { return fetch_sub(__v) - __v; }
305     char 
306     operator&=(char __v) volatile { return fetch_and(__v) & __v; }
308     char 
309     operator|=(char __v) volatile { return fetch_or(__v) | __v; }
311     char 
312     operator^=(char __v) volatile { return fetch_xor(__v) ^ __v; }
314     friend void 
315     atomic_store_explicit(volatile atomic_char*, char, memory_order);
317     friend char 
318     atomic_load_explicit(volatile atomic_char*, memory_order);
320     friend char 
321     atomic_swap_explicit(volatile atomic_char*, char, memory_order);
323     friend bool 
324     atomic_compare_swap_explicit(volatile atomic_char*, char*, char, 
325                                  memory_order, memory_order);
327     friend void 
328     atomic_fence(const volatile atomic_char*, memory_order);
330     friend char 
331     atomic_fetch_add_explicit(volatile atomic_char*, char, memory_order);
333     friend char 
334     atomic_fetch_sub_explicit(volatile atomic_char*, char, memory_order);
336     friend char 
337     atomic_fetch_and_explicit(volatile atomic_char*, char, memory_order);
339     friend char 
340     atomic_fetch_or_explicit( volatile atomic_char*, char, memory_order);
342     friend char 
343     atomic_fetch_xor_explicit(volatile atomic_char*, char, memory_order);
345     atomic_char() { }
347     atomic_char(char __v) { _M_base._M_i = __v; }
349   private:
350     atomic_char(const atomic_char&);
351     atomic_char& operator=(const atomic_char&);
352   };
354   /// atomic_schar
355   struct atomic_schar
356   {
357     __atomic_schar_base _M_base;
359     bool 
360     is_lock_free() const volatile;
362     void 
363     store(signed char, memory_order = memory_order_seq_cst) volatile;
365     signed char 
366     load(memory_order = memory_order_seq_cst) volatile;
368     signed char 
369     swap(signed char, memory_order = memory_order_seq_cst) volatile;
371     bool 
372     compare_swap(signed char&, signed char, memory_order, 
373                  memory_order) volatile;
375     bool 
376     compare_swap(signed char&, signed char, 
377                  memory_order = memory_order_seq_cst) volatile;
379     void 
380     fence(memory_order) const volatile;
382     signed char 
383     fetch_add(signed char, memory_order = memory_order_seq_cst) volatile;
385     signed char 
386     fetch_sub(signed char, memory_order = memory_order_seq_cst) volatile;
388     signed char 
389     fetch_and(signed char, memory_order = memory_order_seq_cst) volatile;
391     signed char 
392     fetch_or(signed char, memory_order = memory_order_seq_cst) volatile;
394     signed char 
395     fetch_xor(signed char, memory_order = memory_order_seq_cst) volatile;
397     signed char 
398     operator=(signed char __v) volatile { store(__v); return __v; }
400     signed char 
401     operator++(int) volatile { return fetch_add(1); }
403     signed char 
404     operator--(int) volatile { return fetch_sub(1); }
406     signed char 
407     operator++() volatile { return fetch_add(1) + 1; }
409     signed char 
410     operator--() volatile { return fetch_sub(1) - 1; }
412     signed char 
413     operator+=(signed char __v) volatile { return fetch_add(__v) + __v; }
415     signed char 
416     operator-=(signed char __v) volatile { return fetch_sub(__v) - __v; }
418     signed char 
419     operator&=(signed char __v) volatile { return fetch_and(__v) & __v; }
421     signed char 
422     operator|=(signed char __v) volatile { return fetch_or(__v) | __v; }
424     signed char 
425     operator^=(signed char __v) volatile { return fetch_xor(__v) ^ __v; }
427     friend void 
428     atomic_store_explicit(volatile atomic_schar*, signed char, memory_order);
430     friend signed char 
431     atomic_load_explicit(volatile atomic_schar*, memory_order);
433     friend signed char 
434     atomic_swap_explicit(volatile atomic_schar*, signed char, memory_order);
436     friend bool 
437     atomic_compare_swap_explicit(volatile atomic_schar*, signed char*, 
438                                  signed char, memory_order, memory_order);
440     friend void 
441     atomic_fence(const volatile atomic_schar*, memory_order);
443     friend signed char 
444     atomic_fetch_add_explicit(volatile atomic_schar*, 
445                               signed char, memory_order);
447     friend signed char 
448     atomic_fetch_sub_explicit(volatile atomic_schar*, signed char, 
449                               memory_order);
451     friend signed char 
452     atomic_fetch_and_explicit(volatile atomic_schar*, signed char, 
453                               memory_order);
455     friend signed char 
456     atomic_fetch_or_explicit(volatile atomic_schar*, signed char, 
457                               memory_order);
459     friend signed char 
460     atomic_fetch_xor_explicit(volatile atomic_schar*, signed char, 
461                               memory_order);
463     atomic_schar() { }
465     atomic_schar(signed char __v) { _M_base._M_i = __v; }
467   private:
468     atomic_schar(const atomic_schar&);
469     atomic_schar& operator=(const atomic_schar&);
470   };
472   /// atomic_uchar
473   struct atomic_uchar
474   {
475     __atomic_uchar_base _M_base;
477     bool 
478     is_lock_free() const volatile;
480     void 
481     store(unsigned char, memory_order = memory_order_seq_cst) volatile;
483     unsigned char 
484     load(memory_order = memory_order_seq_cst) volatile;
486     unsigned char 
487     swap(unsigned char, memory_order = memory_order_seq_cst) volatile;
489     bool 
490     compare_swap(unsigned char&, unsigned char, memory_order, 
491                  memory_order) volatile;
493     bool 
494     compare_swap(unsigned char&, unsigned char, 
495                  memory_order = memory_order_seq_cst) volatile;
497     void 
498     fence(memory_order) const volatile;
500     unsigned char 
501     fetch_add(unsigned char, memory_order = memory_order_seq_cst) volatile;
503     unsigned char 
504     fetch_sub(unsigned char, memory_order = memory_order_seq_cst) volatile;
506     unsigned char 
507     fetch_and(unsigned char, memory_order = memory_order_seq_cst) volatile;
509     unsigned char 
510     fetch_or(unsigned char, memory_order = memory_order_seq_cst) volatile;
512     unsigned char 
513     fetch_xor(unsigned char, memory_order = memory_order_seq_cst) volatile;
515     unsigned char 
516     operator=(unsigned char __v) volatile { store(__v); return __v; }
518     unsigned char 
519     operator++(int) volatile { return fetch_add(1); }
521     unsigned char 
522     operator--(int) volatile { return fetch_sub(1); }
524     unsigned char 
525     operator++() volatile { return fetch_add(1) + 1; }
527     unsigned char 
528     operator--() volatile { return fetch_sub(1) - 1; }
530     unsigned char 
531     operator+=(unsigned char __v) volatile { return fetch_add(__v) + __v; }
533     unsigned char 
534     operator-=(unsigned char __v) volatile { return fetch_sub(__v) - __v; }
536     unsigned char 
537     operator&=(unsigned char __v) volatile { return fetch_and(__v) & __v; }
539     unsigned char 
540     operator|=(unsigned char __v) volatile { return fetch_or(__v) | __v; }
542     unsigned char 
543     operator^=(unsigned char __v) volatile { return fetch_xor(__v) ^ __v; }
545     friend void 
546     atomic_store_explicit(volatile atomic_uchar*, unsigned char, memory_order);
548     friend unsigned char 
549     atomic_load_explicit(volatile atomic_uchar*, memory_order);
551     friend unsigned char 
552     atomic_swap_explicit(volatile atomic_uchar*, unsigned char, memory_order);
554     friend bool 
555     atomic_compare_swap_explicit(volatile atomic_uchar*, unsigned char*, 
556                                  unsigned char, memory_order, memory_order);
558     friend void 
559     atomic_fence(const volatile atomic_uchar*, memory_order);
561     friend unsigned char 
562     atomic_fetch_add_explicit(volatile atomic_uchar*, unsigned char, 
563                               memory_order);
565     friend unsigned char 
566     atomic_fetch_sub_explicit(volatile atomic_uchar*, unsigned char, 
567                               memory_order);
569     friend unsigned char 
570     atomic_fetch_and_explicit(volatile atomic_uchar*, 
571                               unsigned char, memory_order);
573     friend unsigned char 
574     atomic_fetch_or_explicit( volatile atomic_uchar*, unsigned char, 
575                               memory_order);
577     friend unsigned char 
578     atomic_fetch_xor_explicit(volatile atomic_uchar*, unsigned char, 
579                               memory_order);
581     atomic_uchar() { }
583     atomic_uchar(unsigned char __v) { _M_base._M_i = __v; }
585   private:
586     atomic_uchar(const atomic_uchar&);
587     atomic_uchar& operator=(const atomic_uchar&);
588   };
591   /// atomic_short
592   struct atomic_short
593   {
594     __atomic_short_base _M_base;
596     bool 
597     is_lock_free() const volatile;
599     void 
600     store(short, memory_order = memory_order_seq_cst) volatile;
602     short 
603     load(memory_order = memory_order_seq_cst) volatile;
605     short 
606     swap(short, memory_order = memory_order_seq_cst) volatile;
608     bool 
609     compare_swap(short&, short, memory_order, memory_order) volatile;
611     bool 
612     compare_swap(short&, short, memory_order = memory_order_seq_cst) volatile;
614     void 
615     fence(memory_order) const volatile;
616     
617     short 
618     fetch_add(short, memory_order = memory_order_seq_cst) volatile;
620     short 
621     fetch_sub(short, memory_order = memory_order_seq_cst) volatile;
623     short 
624     fetch_and(short, memory_order = memory_order_seq_cst) volatile;
626     short 
627     fetch_or(short, memory_order = memory_order_seq_cst) volatile;
629     short 
630     fetch_xor(short, memory_order = memory_order_seq_cst) volatile;
632     short 
633     operator=(short __v) volatile { store(__v); return __v; }
635     short 
636     operator++(int) volatile { return fetch_add(1); }
638     short 
639     operator--(int) volatile { return fetch_sub(1); }
641     short 
642     operator++() volatile { return fetch_add(1) + 1; }
644     short 
645     operator--() volatile { return fetch_sub(1) - 1; }
647     short 
648     operator+=(short __v) volatile { return fetch_add(__v) + __v; }
650     short 
651     operator-=(short __v) volatile { return fetch_sub(__v) - __v; }
653     short 
654     operator&=(short __v) volatile { return fetch_and(__v) & __v; }
656     short 
657     operator|=(short __v) volatile { return fetch_or(__v) | __v; }
659     short 
660     operator^=(short __v) volatile { return fetch_xor(__v) ^ __v; }
662     friend void 
663     atomic_store_explicit(volatile atomic_short*, short, memory_order);
665     friend short 
666     atomic_load_explicit(volatile atomic_short*, memory_order);
668     friend short 
669     atomic_swap_explicit(volatile atomic_short*, short, memory_order);
671     friend bool 
672     atomic_compare_swap_explicit(volatile atomic_short*, short*, short, 
673                                  memory_order, memory_order);
675     friend void 
676     atomic_fence(const volatile atomic_short*, memory_order);
678     friend short 
679     atomic_fetch_add_explicit(volatile atomic_short*, short, memory_order);
681     friend short 
682     atomic_fetch_sub_explicit(volatile atomic_short*, short, memory_order);
684     friend short 
685     atomic_fetch_and_explicit(volatile atomic_short*, short, memory_order);
687     friend short 
688     atomic_fetch_or_explicit( volatile atomic_short*, short, memory_order);
690     friend short 
691     atomic_fetch_xor_explicit(volatile atomic_short*, short, memory_order);
693     atomic_short() { }
695     atomic_short(short __v) { _M_base._M_i = __v; }
697   private:
698     atomic_short(const atomic_short&);
699     atomic_short& operator=(const atomic_short&);
700   };
702   /// atomic_ushort
703   struct atomic_ushort
704   {
705     __atomic_ushort_base _M_base;
707     bool 
708     is_lock_free() const volatile;
710     void 
711     store(unsigned short, memory_order = memory_order_seq_cst) volatile;
713     unsigned short 
714     load(memory_order = memory_order_seq_cst) volatile;
716     unsigned short 
717     swap(unsigned short, memory_order = memory_order_seq_cst) volatile;
719     bool 
720     compare_swap(unsigned short&, unsigned short, memory_order, 
721                  memory_order) volatile;
723     bool 
724     compare_swap(unsigned short&, unsigned short, 
725                  memory_order = memory_order_seq_cst) volatile;
727     void 
728     fence(memory_order) const volatile;
730     unsigned short 
731     fetch_add(unsigned short, memory_order = memory_order_seq_cst) volatile;
733     unsigned short 
734     fetch_sub(unsigned short, memory_order = memory_order_seq_cst) volatile;
736     unsigned short 
737     fetch_and(unsigned short, memory_order = memory_order_seq_cst) volatile;
739     unsigned short 
740     fetch_or(unsigned short, memory_order = memory_order_seq_cst) volatile;
742     unsigned short 
743     fetch_xor(unsigned short, memory_order = memory_order_seq_cst) volatile;
745     unsigned short 
746     operator=(unsigned short __v) volatile { store(__v); return __v; }
748     unsigned short 
749     operator++(int) volatile { return fetch_add(1); }
751     unsigned short 
752     operator--(int) volatile { return fetch_sub(1); }
754     unsigned short 
755     operator++() volatile { return fetch_add(1) + 1; }
757     unsigned short 
758     operator--() volatile { return fetch_sub(1) - 1; }
760     unsigned short 
761     operator+=(unsigned short __v) volatile { return fetch_add(__v) + __v; }
763     unsigned short 
764     operator-=(unsigned short __v) volatile { return fetch_sub(__v) - __v; }
766     unsigned short 
767     operator&=(unsigned short __v) volatile { return fetch_and(__v) & __v; }
769     unsigned short 
770     operator|=(unsigned short __v) volatile { return fetch_or(__v) | __v; }
772     unsigned short 
773     operator^=(unsigned short __v) volatile { return fetch_xor(__v) ^ __v; }
775     friend void 
776     atomic_store_explicit(volatile atomic_ushort*, unsigned short, 
777                           memory_order);
779     friend unsigned short 
780     atomic_load_explicit(volatile atomic_ushort*, memory_order);
782     friend unsigned short 
783     atomic_swap_explicit(volatile atomic_ushort*, unsigned short, memory_order);
785     friend bool 
786     atomic_compare_swap_explicit(volatile atomic_ushort*, unsigned short*, 
787                                  unsigned short, memory_order, memory_order);
789     friend void 
790     atomic_fence(const volatile atomic_ushort*, memory_order);
792     friend unsigned short 
793     atomic_fetch_add_explicit(volatile atomic_ushort*, unsigned short, 
794                               memory_order);
796     friend unsigned short 
797     atomic_fetch_sub_explicit(volatile atomic_ushort*, unsigned short, 
798                               memory_order);
800     friend unsigned short 
801     atomic_fetch_and_explicit(volatile atomic_ushort*, unsigned short, 
802                               memory_order);
804     friend unsigned short 
805     atomic_fetch_or_explicit( volatile atomic_ushort*, unsigned short, 
806                               memory_order);
808     friend unsigned short 
809     atomic_fetch_xor_explicit(volatile atomic_ushort*, unsigned short, 
810                               memory_order);
812     atomic_ushort() { }
814     atomic_ushort(unsigned short __v) { _M_base._M_i = __v; }
816   private:
817     atomic_ushort(const atomic_ushort&);
818     atomic_ushort& operator=(const atomic_ushort&);
819   };
821   /// atomic_int
822   struct atomic_int
823   {
824     __atomic_int_base _M_base;
826     bool 
827     is_lock_free() const volatile;
829     void 
830     store(int, memory_order = memory_order_seq_cst) volatile;
832     int 
833     load(memory_order = memory_order_seq_cst) volatile;
835     int 
836     swap(int, memory_order = memory_order_seq_cst) volatile;
838     bool 
839     compare_swap(int&, int, memory_order, memory_order) volatile;
841     bool 
842     compare_swap(int&, int, memory_order = memory_order_seq_cst) volatile;
844     void 
845     fence(memory_order) const volatile;
847     int 
848     fetch_add(int, memory_order = memory_order_seq_cst) volatile;
850     int 
851     fetch_sub(int, memory_order = memory_order_seq_cst) volatile;
853     int 
854     fetch_and(int, memory_order = memory_order_seq_cst) volatile;
856     int 
857     fetch_or(int, memory_order = memory_order_seq_cst) volatile;
859     int 
860     fetch_xor(int, memory_order = memory_order_seq_cst) volatile;
862     int 
863     operator=(int __v) volatile { store(__v); return __v; }
865     int 
866     operator++(int) volatile { return fetch_add(1); }
868     int 
869     operator--(int) volatile { return fetch_sub(1); }
871     int 
872     operator++() volatile { return fetch_add(1) + 1; }
874     int 
875     operator--() volatile { return fetch_sub(1) - 1; }
877     int 
878     operator+=(int __v) volatile { return fetch_add(__v) + __v; }
880     int 
881     operator-=(int __v) volatile { return fetch_sub(__v) - __v; }
883     int 
884     operator&=(int __v) volatile { return fetch_and(__v) & __v; }
886     int 
887     operator|=(int __v) volatile { return fetch_or(__v) | __v; }
889     int 
890     operator^=(int __v) volatile { return fetch_xor(__v) ^ __v; }
892     friend void 
893     atomic_store_explicit(volatile atomic_int*, int, memory_order);
895     friend int 
896     atomic_load_explicit(volatile atomic_int*, memory_order);
898     friend int 
899     atomic_swap_explicit(volatile atomic_int*, int, memory_order);
901     friend bool 
902     atomic_compare_swap_explicit(volatile atomic_int*, int*, int, 
903                                  memory_order, memory_order);
905     friend void 
906     atomic_fence(const volatile atomic_int*, memory_order);
908     friend int 
909     atomic_fetch_add_explicit(volatile atomic_int*, int, memory_order);
911     friend int 
912     atomic_fetch_sub_explicit(volatile atomic_int*, int, memory_order);
914     friend int 
915     atomic_fetch_and_explicit(volatile atomic_int*, int, memory_order);
917     friend int 
918     atomic_fetch_or_explicit( volatile atomic_int*, int, memory_order);
920     friend int 
921     atomic_fetch_xor_explicit(volatile atomic_int*, int, memory_order);
923     atomic_int() { }
925     atomic_int(int __v) { _M_base._M_i = __v; }
926     
927   private:
928     atomic_int(const atomic_int&);
929     atomic_int& operator=(const atomic_int&);
930   };
932   /// atomic_uint
933   struct atomic_uint
934   {
935     __atomic_uint_base _M_base;
937     bool 
938     is_lock_free() const volatile;
940     void 
941     store(unsigned int, memory_order = memory_order_seq_cst) volatile;
943     unsigned int 
944     load(memory_order = memory_order_seq_cst) volatile;
946     unsigned int 
947     swap(unsigned int, memory_order = memory_order_seq_cst) volatile;
949     bool 
950     compare_swap(unsigned int&, unsigned int, memory_order, 
951                  memory_order) volatile;
953     bool 
954     compare_swap(unsigned int&, unsigned int, 
955                  memory_order = memory_order_seq_cst) volatile;
957     void 
958     fence(memory_order) const volatile;
960     unsigned int 
961     fetch_add(unsigned int, memory_order = memory_order_seq_cst) volatile;
963     unsigned int 
964     fetch_sub(unsigned int, memory_order = memory_order_seq_cst) volatile;
966     unsigned int 
967     fetch_and(unsigned int, memory_order = memory_order_seq_cst) volatile;
969     unsigned int 
970     fetch_or(unsigned int, memory_order = memory_order_seq_cst) volatile;
972     unsigned int 
973     fetch_xor(unsigned int, memory_order = memory_order_seq_cst) volatile;
975     unsigned int 
976     operator=(unsigned int __v) volatile { store(__v); return __v; }
978     unsigned int 
979     operator++(int) volatile { return fetch_add(1); }
981     unsigned int 
982     operator--(int) volatile { return fetch_sub(1); }
984     unsigned int 
985     operator++() volatile { return fetch_add(1) + 1; }
987     unsigned int 
988     operator--() volatile { return fetch_sub(1) - 1; }
990     unsigned int 
991     operator+=(unsigned int __v) volatile { return fetch_add(__v) + __v; }
993     unsigned int 
994     operator-=(unsigned int __v) volatile { return fetch_sub(__v) - __v; }
996     unsigned int 
997     operator&=(unsigned int __v) volatile { return fetch_and(__v) & __v; }
999     unsigned int 
1000     operator|=(unsigned int __v) volatile { return fetch_or(__v) | __v; }
1002     unsigned int 
1003     operator^=(unsigned int __v) volatile { return fetch_xor(__v) ^ __v; }
1005     friend void 
1006     atomic_store_explicit(volatile atomic_uint*, unsigned int, memory_order);
1008     friend unsigned int 
1009     atomic_load_explicit(volatile atomic_uint*, memory_order);
1011     friend unsigned int 
1012     atomic_swap_explicit(volatile atomic_uint*, unsigned int, memory_order);
1014     friend bool 
1015     atomic_compare_swap_explicit(volatile atomic_uint*, unsigned int*, 
1016                                  unsigned int, memory_order, memory_order);
1018     friend void 
1019     atomic_fence(const volatile atomic_uint*, memory_order);
1021     friend unsigned int 
1022     atomic_fetch_add_explicit(volatile atomic_uint*, unsigned int, 
1023                               memory_order);
1025     friend unsigned int 
1026     atomic_fetch_sub_explicit(volatile atomic_uint*, unsigned int, 
1027                               memory_order);
1029     friend unsigned int 
1030     atomic_fetch_and_explicit(volatile atomic_uint*, unsigned int, 
1031                               memory_order);
1033     friend unsigned int 
1034     atomic_fetch_or_explicit( volatile atomic_uint*, unsigned int, 
1035                               memory_order);
1037     friend unsigned int 
1038     atomic_fetch_xor_explicit(volatile atomic_uint*, unsigned int, 
1039                               memory_order);
1041     atomic_uint() { }
1043     atomic_uint(unsigned int __v) { _M_base._M_i = __v; }
1045   private:
1046     atomic_uint(const atomic_uint&);
1047     atomic_uint& operator=(const atomic_uint&);
1048   };
1050   /// atomic_long
1051   struct atomic_long
1052   {
1053     __atomic_long_base _M_base;
1055     bool 
1056     is_lock_free() const volatile;
1058     void 
1059     store(long, memory_order = memory_order_seq_cst) volatile;
1061     long 
1062     load(memory_order = memory_order_seq_cst) volatile;
1063     
1064     long 
1065     swap(long, memory_order = memory_order_seq_cst) volatile;
1067     bool 
1068     compare_swap(long&, long, memory_order, memory_order) volatile;
1070     bool 
1071     compare_swap(long&, long, memory_order = memory_order_seq_cst) volatile;
1073     void 
1074     fence(memory_order) const volatile;
1076     long 
1077     fetch_add(long, memory_order = memory_order_seq_cst) volatile;
1079     long 
1080     fetch_sub(long, memory_order = memory_order_seq_cst) volatile;
1082     long 
1083     fetch_and(long, memory_order = memory_order_seq_cst) volatile;
1085     long 
1086     fetch_or(long, memory_order = memory_order_seq_cst) volatile;
1088     long 
1089     fetch_xor(long, memory_order = memory_order_seq_cst) volatile;
1091     long 
1092     operator=(long __v) volatile { store(__v); return __v; }
1094     long 
1095     operator++(int) volatile { return fetch_add(1); }
1097     long 
1098     operator--(int) volatile { return fetch_sub(1); }
1100     long 
1101     operator++() volatile { return fetch_add(1) + 1; }
1103     long 
1104     operator--() volatile { return fetch_sub(1) - 1; }
1106     long 
1107     operator+=(long __v) volatile { return fetch_add(__v) + __v; }
1109     long 
1110     operator-=(long __v) volatile { return fetch_sub(__v) - __v; }
1112     long 
1113     operator&=(long __v) volatile { return fetch_and(__v) & __v; }
1115     long 
1116     operator|=(long __v) volatile { return fetch_or(__v) | __v; }
1118     long 
1119     operator^=(long __v) volatile { return fetch_xor(__v) ^ __v; }
1121     friend void 
1122     atomic_store_explicit(volatile atomic_long*, long, memory_order);
1124     friend long 
1125     atomic_load_explicit(volatile atomic_long*, memory_order);
1127     friend long 
1128     atomic_swap_explicit(volatile atomic_long*, long, memory_order);
1130     friend bool 
1131     atomic_compare_swap_explicit(volatile atomic_long*, long*, long, 
1132                                  memory_order, memory_order);
1134     friend void 
1135     atomic_fence(const volatile atomic_long*, memory_order);
1137     friend long 
1138     atomic_fetch_add_explicit(volatile atomic_long*, long, memory_order);
1140     friend long 
1141     atomic_fetch_sub_explicit(volatile atomic_long*, long, memory_order);
1143     friend long 
1144     atomic_fetch_and_explicit(volatile atomic_long*, long, memory_order);
1146     friend long 
1147     atomic_fetch_or_explicit( volatile atomic_long*, long, memory_order);
1149     friend long 
1150     atomic_fetch_xor_explicit(volatile atomic_long*, long, memory_order);
1152     atomic_long() { }
1154     atomic_long(long __v) { _M_base._M_i = __v; }
1156   private:
1157     atomic_long(const atomic_long&);
1158     atomic_long& operator=(const atomic_long&);
1159   };
1161   /// atomic_ulong
1162   struct atomic_ulong
1163   {
1164     __atomic_ulong_base _M_base;
1166     bool 
1167     is_lock_free() const volatile;
1169     void 
1170     store(unsigned long, memory_order = memory_order_seq_cst) volatile;
1172     unsigned long 
1173     load(memory_order = memory_order_seq_cst) volatile;
1175     unsigned long 
1176     swap(unsigned long, memory_order = memory_order_seq_cst) volatile;
1178     bool 
1179     compare_swap(unsigned long&, unsigned long, memory_order, 
1180                  memory_order) volatile;
1182     bool 
1183     compare_swap(unsigned long&, unsigned long, 
1184                  memory_order = memory_order_seq_cst) volatile;
1186     void 
1187     fence(memory_order) const volatile;
1189     unsigned long 
1190     fetch_add(unsigned long, memory_order = memory_order_seq_cst) volatile;
1192     unsigned long 
1193     fetch_sub(unsigned long, memory_order = memory_order_seq_cst) volatile;
1195     unsigned long 
1196     fetch_and(unsigned long, memory_order = memory_order_seq_cst) volatile;
1198     unsigned long 
1199     fetch_or(unsigned long, memory_order = memory_order_seq_cst) volatile;
1201     unsigned long 
1202     fetch_xor(unsigned long, memory_order = memory_order_seq_cst) volatile;
1204     unsigned long 
1205     operator=(unsigned long __v) volatile { store(__v); return __v; }
1207     unsigned long 
1208     operator++(int) volatile { return fetch_add(1); }
1210     unsigned long 
1211     operator--(int) volatile { return fetch_sub(1); }
1213     unsigned long 
1214     operator++() volatile { return fetch_add(1) + 1; }
1216     unsigned long 
1217     operator--() volatile { return fetch_sub(1) - 1; }
1219     unsigned long 
1220     operator+=(unsigned long __v) volatile { return fetch_add(__v) + __v; }
1222     unsigned long 
1223     operator-=(unsigned long __v) volatile { return fetch_sub(__v) - __v; }
1225     unsigned long 
1226     operator&=(unsigned long __v) volatile { return fetch_and(__v) & __v; }
1228     unsigned long 
1229     operator|=(unsigned long __v) volatile { return fetch_or(__v) | __v; }
1231     unsigned long 
1232     operator^=(unsigned long __v) volatile { return fetch_xor(__v) ^ __v; }
1234     friend void 
1235     atomic_store_explicit(volatile atomic_ulong*, unsigned long, memory_order);
1237     friend unsigned long 
1238     atomic_load_explicit(volatile atomic_ulong*, memory_order);
1240     friend unsigned long 
1241     atomic_swap_explicit(volatile atomic_ulong*, unsigned long, memory_order);
1243     friend bool 
1244     atomic_compare_swap_explicit(volatile atomic_ulong*, unsigned long*, 
1245                                  unsigned long, memory_order, memory_order);
1247     friend void 
1248     atomic_fence(const volatile atomic_ulong*, memory_order);
1250     friend unsigned long 
1251     atomic_fetch_add_explicit(volatile atomic_ulong*, unsigned long, 
1252                               memory_order);
1254     friend unsigned long 
1255     atomic_fetch_sub_explicit(volatile atomic_ulong*, unsigned long, 
1256                               memory_order);
1258     friend unsigned long 
1259     atomic_fetch_and_explicit(volatile atomic_ulong*, unsigned long, 
1260                               memory_order);
1261     friend unsigned long 
1262     atomic_fetch_or_explicit(volatile atomic_ulong*, unsigned long, 
1263                              memory_order);
1265     friend unsigned long 
1266     atomic_fetch_xor_explicit(volatile atomic_ulong*, unsigned long, 
1267                               memory_order);
1269     atomic_ulong() { }
1271     atomic_ulong(unsigned long __v) { _M_base._M_i = __v; }
1273   private:
1274     atomic_ulong(const atomic_ulong&);
1275     atomic_ulong& operator=(const atomic_ulong&);
1276   };
1278   /// atomic_llong
1279   struct atomic_llong
1280   {
1281     __atomic_llong_base _M_base;
1283     bool 
1284     is_lock_free() const volatile;
1286     void 
1287     store(long long, memory_order = memory_order_seq_cst) volatile;
1289     long long 
1290     load(memory_order = memory_order_seq_cst) volatile;
1292     long long 
1293     swap(long long, memory_order = memory_order_seq_cst) volatile;
1295     bool 
1296     compare_swap(long long&, long long, memory_order, memory_order) volatile;
1298     bool 
1299     compare_swap(long long&, long long, 
1300                  memory_order = memory_order_seq_cst) volatile;
1302     void 
1303     fence(memory_order) const volatile;
1305     long long 
1306     fetch_add(long long, memory_order = memory_order_seq_cst) volatile;
1308     long long 
1309     fetch_sub(long long, memory_order = memory_order_seq_cst) volatile;
1311     long long 
1312     fetch_and(long long, memory_order = memory_order_seq_cst) volatile;
1314     long long 
1315     fetch_or(long long, memory_order = memory_order_seq_cst) volatile;
1317     long long 
1318     fetch_xor(long long, memory_order = memory_order_seq_cst) volatile;
1320     long long 
1321     operator=(long long __v) volatile { store(__v); return __v; }
1323     long long 
1324     operator++(int) volatile { return fetch_add(1); }
1326     long long 
1327     operator--(int) volatile { return fetch_sub(1); }
1329     long long 
1330     operator++() volatile { return fetch_add(1) + 1; }
1332     long long 
1333     operator--() volatile { return fetch_sub(1) - 1; }
1335     long long 
1336     operator+=(long long __v) volatile { return fetch_add(__v) + __v; }
1338     long long 
1339     operator-=(long long __v) volatile { return fetch_sub(__v) - __v; }
1341     long long 
1342     operator&=(long long __v) volatile { return fetch_and(__v) & __v; }
1344     long long 
1345     operator|=(long long __v) volatile { return fetch_or(__v) | __v; }
1347     long long 
1348     operator^=(long long __v) volatile { return fetch_xor(__v) ^ __v; }
1350     friend void 
1351     atomic_store_explicit(volatile atomic_llong*, long long, memory_order);
1353     friend long long 
1354     atomic_load_explicit(volatile atomic_llong*, memory_order);
1356     friend long long 
1357     atomic_swap_explicit(volatile atomic_llong*, long long, memory_order);
1359     friend bool 
1360     atomic_compare_swap_explicit(volatile atomic_llong*, long long*, 
1361                                  long long, memory_order, memory_order);
1363     friend void 
1364     atomic_fence(const volatile atomic_llong*, memory_order);
1366     friend long long 
1367     atomic_fetch_add_explicit(volatile atomic_llong*, long long, memory_order);
1369     friend long long 
1370     atomic_fetch_sub_explicit(volatile atomic_llong*, long long, memory_order);
1372     friend long long 
1373     atomic_fetch_and_explicit(volatile atomic_llong*, long long, memory_order);
1375     friend long long 
1376     atomic_fetch_or_explicit(volatile atomic_llong*, long long, memory_order);
1378     friend long long 
1379     atomic_fetch_xor_explicit(volatile atomic_llong*, long long, memory_order);
1381     atomic_llong() { }
1383     atomic_llong(long long __v) { _M_base._M_i = __v; }
1385   private:    
1386     atomic_llong(const atomic_llong&);
1387     atomic_llong& operator=(const atomic_llong&);
1388   };
1390   /// atomic_ullong
1391   struct atomic_ullong
1392   {
1393     __atomic_ullong_base _M_base;
1395     bool 
1396     is_lock_free() const volatile;
1398     void 
1399     store(unsigned long long, memory_order = memory_order_seq_cst) volatile;
1401     unsigned long long 
1402     load(memory_order = memory_order_seq_cst) volatile;
1404     unsigned long long 
1405     swap(unsigned long long, memory_order = memory_order_seq_cst) volatile;
1407     bool 
1408     compare_swap(unsigned long long&, unsigned long long, memory_order, 
1409                  memory_order) volatile;
1411     bool 
1412     compare_swap(unsigned long long&, unsigned long long, 
1413                  memory_order = memory_order_seq_cst) volatile;
1415     void 
1416     fence(memory_order) const volatile;
1418     unsigned long long 
1419     fetch_add(unsigned long long, memory_order = memory_order_seq_cst) volatile;
1421     unsigned long long 
1422     fetch_sub(unsigned long long, memory_order = memory_order_seq_cst) volatile;
1424     unsigned long long 
1425     fetch_and(unsigned long long, memory_order = memory_order_seq_cst) volatile;
1427     unsigned long long 
1428     fetch_or(unsigned long long, memory_order = memory_order_seq_cst) volatile;
1430     unsigned long long 
1431     fetch_xor(unsigned long long, memory_order = memory_order_seq_cst) volatile;
1433     unsigned long long 
1434     operator=(unsigned long long __v) volatile
1435     { store(__v); return __v; }
1437     unsigned long long 
1438     operator++(int) volatile
1439     { return fetch_add(1); }
1441     unsigned long long 
1442     operator--(int) volatile
1443     { return fetch_sub(1); }
1445     unsigned long long 
1446     operator++() volatile
1447     { return fetch_add(1) + 1; }
1449     unsigned long long 
1450     operator--() volatile
1451     { return fetch_sub(1) - 1; }
1453     unsigned long long 
1454     operator+=(unsigned long long __v) volatile
1455     { return fetch_add(__v) + __v; }
1457     unsigned long long 
1458     operator-=(unsigned long long __v) volatile
1459     { return fetch_sub(__v) - __v; }
1461     unsigned long long 
1462     operator&=(unsigned long long __v) volatile
1463     { return fetch_and(__v) & __v; }
1465     unsigned long long 
1466     operator|=(unsigned long long __v) volatile
1467     { return fetch_or(__v) | __v; }
1469     unsigned long long 
1470     operator^=(unsigned long long __v) volatile
1471     { return fetch_xor(__v) ^ __v; }
1473     friend void 
1474     atomic_store_explicit(volatile atomic_ullong*, unsigned long long,
1475                                        memory_order);
1476     friend unsigned long long 
1477     atomic_load_explicit(volatile atomic_ullong*, memory_order);
1479     friend unsigned long long 
1480     atomic_swap_explicit(volatile atomic_ullong*, unsigned long long, 
1481                          memory_order);
1483     friend bool 
1484     atomic_compare_swap_explicit(volatile atomic_ullong*, unsigned long long*, 
1485                                  unsigned long long, memory_order, 
1486                                  memory_order);
1488     friend void 
1489     atomic_fence(const volatile atomic_ullong*, memory_order);
1491     friend unsigned long long 
1492     atomic_fetch_add_explicit(volatile atomic_ullong*, unsigned long long, 
1493                               memory_order);
1495     friend unsigned long long 
1496     atomic_fetch_sub_explicit(volatile atomic_ullong*, unsigned long long, 
1497                               memory_order);
1499     friend unsigned long long 
1500     atomic_fetch_and_explicit(volatile atomic_ullong*, unsigned long long, 
1501                               memory_order);
1503     friend unsigned long long 
1504     atomic_fetch_or_explicit(volatile atomic_ullong*, unsigned long long, 
1505                              memory_order);
1507     friend unsigned long long 
1508     atomic_fetch_xor_explicit(volatile atomic_ullong*, unsigned long long, 
1509                               memory_order);
1511     atomic_ullong() { }
1513     atomic_ullong(unsigned long long __v) { _M_base._M_i = __v; }
1515   private:
1516     atomic_ullong(const atomic_ullong&);
1517     atomic_ullong& operator=(const atomic_ullong&);
1518   };
1520   /// atomic_wchar_t
1521   struct atomic_wchar_t
1522   {
1523     __atomic_wchar_t_base _M_base;
1525     bool 
1526     is_lock_free() const volatile;
1528     void 
1529     store(wchar_t, memory_order = memory_order_seq_cst) volatile;
1531     wchar_t 
1532     load(memory_order = memory_order_seq_cst) volatile;
1534     wchar_t 
1535     swap(wchar_t, memory_order = memory_order_seq_cst) volatile;
1537     bool 
1538     compare_swap(wchar_t&, wchar_t, memory_order, memory_order) volatile;
1540     bool 
1541     compare_swap(wchar_t&, wchar_t, 
1542                  memory_order = memory_order_seq_cst) volatile;
1544     void 
1545     fence(memory_order) const volatile;
1547     wchar_t 
1548     fetch_add(wchar_t, memory_order = memory_order_seq_cst) volatile;
1550     wchar_t 
1551     fetch_sub(wchar_t, memory_order = memory_order_seq_cst) volatile;
1553     wchar_t 
1554     fetch_and(wchar_t, memory_order = memory_order_seq_cst) volatile;
1556     wchar_t 
1557     fetch_or(wchar_t, memory_order = memory_order_seq_cst) volatile;
1559     wchar_t 
1560     fetch_xor(wchar_t, memory_order = memory_order_seq_cst) volatile;
1562     wchar_t 
1563     operator=(wchar_t __v) volatile
1564     { store(__v); return __v; }
1566     wchar_t 
1567     operator++(int) volatile
1568     { return fetch_add(1); }
1570     wchar_t 
1571     operator--(int) volatile
1572     { return fetch_sub(1); }
1574     wchar_t 
1575     operator++() volatile
1576     { return fetch_add(1) + 1; }
1578     wchar_t 
1579     operator--() volatile
1580     { return fetch_sub(1) - 1; }
1582     wchar_t 
1583     operator+=(wchar_t __v) volatile
1584     { return fetch_add(__v) + __v; }
1586     wchar_t 
1587     operator-=(wchar_t __v) volatile
1588     { return fetch_sub(__v) - __v; }
1590     wchar_t 
1591     operator&=(wchar_t __v) volatile
1592     { return fetch_and(__v) & __v; }
1594     wchar_t 
1595     operator|=(wchar_t __v) volatile
1596     { return fetch_or(__v) | __v; }
1598     wchar_t 
1599     operator^=(wchar_t __v) volatile
1600     { return fetch_xor(__v) ^ __v; }
1602     friend void 
1603     atomic_store_explicit(volatile atomic_wchar_t*, wchar_t, memory_order);
1605     friend wchar_t 
1606     atomic_load_explicit(volatile atomic_wchar_t*, memory_order);
1608     friend wchar_t 
1609     atomic_swap_explicit(volatile atomic_wchar_t*, wchar_t, memory_order);
1611     friend bool 
1612     atomic_compare_swap_explicit(volatile atomic_wchar_t*,
1613                                  wchar_t*, wchar_t, memory_order, memory_order);
1615     friend void 
1616     atomic_fence(const volatile atomic_wchar_t*, memory_order);
1618     friend wchar_t 
1619     atomic_fetch_add_explicit(volatile atomic_wchar_t*, wchar_t, memory_order);
1621     friend wchar_t 
1622     atomic_fetch_sub_explicit(volatile atomic_wchar_t*, wchar_t, memory_order);
1624     friend wchar_t 
1625     atomic_fetch_and_explicit(volatile atomic_wchar_t*, wchar_t, memory_order);
1627     friend wchar_t 
1628     atomic_fetch_or_explicit(volatile atomic_wchar_t*, wchar_t, memory_order);
1630     friend wchar_t 
1631     atomic_fetch_xor_explicit(volatile atomic_wchar_t*, wchar_t, memory_order);
1633     atomic_wchar_t() { }
1635     atomic_wchar_t(wchar_t __v) { _M_base._M_i = __v; }
1637   private:
1638     atomic_wchar_t(const atomic_wchar_t&);
1639     atomic_wchar_t& operator=(const atomic_wchar_t&);
1640   };
1643   /// atomic
1644   /// 29.4.3, Generic atomic type, primary class template.
1645   template<typename _Tp>
1646     struct atomic
1647     {
1648       bool 
1649       is_lock_free() const volatile;
1651       void 
1652       store(_Tp, memory_order = memory_order_seq_cst) volatile;
1654       _Tp 
1655       load(memory_order = memory_order_seq_cst) volatile;
1657       _Tp 
1658       swap(_Tp __v, memory_order = memory_order_seq_cst) volatile;
1660       bool 
1661       compare_swap(_Tp&, _Tp, memory_order, memory_order) volatile;
1663       bool 
1664       compare_swap(_Tp&, _Tp, memory_order = memory_order_seq_cst) volatile;
1666       void 
1667       fence(memory_order) const volatile;
1669       _Tp 
1670       operator=(_Tp __v) volatile { store(__v); return __v; }
1672       atomic() { }
1674       explicit atomic(_Tp __v) : __f(__v) { }
1676     private:
1677       atomic(const atomic&);
1678       atomic& operator=(const atomic&);
1680       _Tp __f;
1681     };
1683   /// Partial specialization for pointer types.
1684   template<typename _Tp> 
1685     struct atomic<_Tp*> : atomic_address
1686     {
1687       _Tp* 
1688       load(memory_order = memory_order_seq_cst) volatile;
1690       _Tp* 
1691       swap(_Tp*, memory_order = memory_order_seq_cst) volatile;
1693       bool 
1694       compare_swap(_Tp*&, _Tp*, memory_order, memory_order) volatile;
1696       bool 
1697       compare_swap(_Tp*&, _Tp*, memory_order = memory_order_seq_cst) volatile;
1699       _Tp* 
1700       fetch_add(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
1702       _Tp* 
1703       fetch_sub(ptrdiff_t, memory_order = memory_order_seq_cst) volatile;
1705       _Tp* 
1706       operator=(_Tp* __v) volatile { store(__v); return __v; }
1708       _Tp* 
1709       operator++(int) volatile { return fetch_add(1); }
1711       _Tp* 
1712       operator--(int) volatile { return fetch_sub(1); }
1714       _Tp* 
1715       operator++() volatile { return fetch_add(1) + 1; }
1717       _Tp* 
1718       operator--() volatile { return fetch_sub(1) - 1; }
1720       _Tp* 
1721       operator+=(ptrdiff_t __v) volatile 
1722       { return fetch_add(__v) + __v; }
1724       _Tp* 
1725       operator-=(ptrdiff_t __v) volatile 
1726       { return fetch_sub(__v) - __v; }
1728       atomic() { }
1730       explicit atomic(_Tp* __v) : atomic_address(__v) { }
1732     private:
1733       atomic(const atomic&);
1734       atomic& operator=(const atomic&);
1735     };
1737   /// Explicit specialization for bool.
1738   template<> 
1739     struct atomic<bool> : atomic_bool
1740     {
1741       atomic() { }
1743       explicit atomic(bool __v) : atomic_bool(__v) { }
1744       
1745       bool 
1746       operator=(bool __v) volatile { store(__v); return __v; }
1747       
1748     private:
1749       atomic(const atomic&);
1750       atomic& operator=(const atomic&);
1751     };
1753   /// Explicit specialization for void*
1754   template<> 
1755     struct atomic<void*> : atomic_address
1756     {
1757       atomic() { }
1759       explicit atomic(void* __v) : atomic_address(__v) { }
1760       
1761       void* 
1762       operator=(void* __v) volatile { store(__v); return __v; }
1763       
1764     private:
1765       atomic(const atomic&);      
1766       atomic& operator=(const atomic&);
1767     };
1769   /// Explicit specialization for char.
1770   template<> 
1771     struct atomic<char> : atomic_char
1772     {
1773       atomic() { }
1775       explicit atomic(char __v) : atomic_char(__v) { }
1776       
1777       char 
1778       operator=(char __v) volatile { store(__v); return __v; }
1779       
1780     private:
1781       atomic(const atomic&);
1782       atomic& operator=(const atomic&);
1783     };
1786   /// Explicit specialization for signed char.
1787   template<> 
1788     struct atomic<signed char> : atomic_schar
1789     { 
1790       atomic() { }
1792       explicit atomic(signed char __v) : atomic_schar(__v) { }
1793       
1794       signed char 
1795       operator=(signed char __v) volatile { store(__v); return __v; }
1796       
1797     private:
1798       atomic(const atomic&);      
1799       atomic& operator=(const atomic&);
1800   };
1802   /// Explicit specialization for unsigned char.
1803   template<> 
1804     struct atomic<unsigned char> : atomic_uchar
1805     {
1806       atomic() { }
1808       explicit atomic(unsigned char __v) : atomic_uchar(__v) { }
1809       
1810       unsigned char 
1811       operator=(unsigned char __v) volatile { store(__v); return __v; }
1812       
1813     private:
1814       atomic(const atomic&);
1815       atomic& 
1816       operator=(const atomic&);
1817     };
1819   /// Explicit specialization for short.
1820   template<> 
1821     struct atomic<short> : atomic_short
1822     {
1823       atomic() { }
1825       explicit atomic(short __v) : atomic_short(__v) { }
1826       
1827       short 
1828       operator=(short __v) volatile { store(__v); return __v; }
1829       
1830     private:
1831       atomic(const atomic&);
1832       atomic& operator=(const atomic&);
1833   };
1835   /// Explicit specialization for unsigned short.
1836   template<> 
1837     struct atomic<unsigned short> : atomic_ushort
1838     {
1839       atomic() { }
1841       explicit atomic(unsigned short __v) : atomic_ushort(__v) { }
1842       
1843       unsigned short 
1844       operator=(unsigned short __v) volatile { store(__v); return __v; }
1845       
1846     private:
1847       atomic(const atomic&);      
1848       atomic& operator=(const atomic&);
1849     };
1851   /// Explicit specialization for int.
1852   template<> 
1853     struct atomic<int> : atomic_int
1854     {
1855       atomic() { }
1857       explicit atomic(int __v) : atomic_int(__v) { }
1858       
1859       int 
1860       operator=(int __v) volatile { store(__v); return __v; }
1861       
1862     private:
1863       atomic(const atomic&);
1864       atomic& operator=(const atomic&);
1865     };
1867   /// Explicit specialization for unsigned int.
1868   template<> 
1869     struct atomic<unsigned int> : atomic_uint
1870     {
1871       atomic() { }
1873       explicit atomic(unsigned int __v) : atomic_uint(__v) { }
1874       
1875       unsigned int 
1876       operator=(unsigned int __v) volatile { store(__v); return __v; }
1877       
1878     private:
1879       atomic(const atomic&);      
1880       atomic& operator=(const atomic&);
1881     };
1883   /// Explicit specialization for long.
1884   template<> 
1885     struct atomic<long> : atomic_long
1886     {
1887       atomic() { }
1889       explicit atomic(long __v) : atomic_long(__v) { }
1890       
1891       long 
1892       operator=(long __v) volatile { store(__v); return __v; }
1893       
1894     private:
1895       atomic(const atomic&);      
1896       atomic& operator=(const atomic&);
1897     };
1899   /// Explicit specialization for unsigned long.
1900   template<> 
1901     struct atomic<unsigned long> : atomic_ulong
1902     {
1903       atomic() { }
1905       explicit atomic(unsigned long __v) : atomic_ulong(__v) { }
1906       
1907       unsigned long 
1908       operator=(unsigned long __v) volatile
1909       { store(__v); return __v; }
1910       
1911     private:
1912       atomic(const atomic&);
1913       atomic& operator=(const atomic&);
1914     };
1916   /// Explicit specialization for long long.
1917   template<> 
1918     struct atomic<long long> : atomic_llong
1919     {
1920       atomic() { }
1922       explicit atomic(long long __v) : atomic_llong(__v) { }
1923       
1924       long long 
1925       operator=(long long __v) volatile { store(__v); return __v; }
1926       
1927     private:
1928       atomic(const atomic&);      
1929       atomic& operator=(const atomic&);
1930     };
1932   /// Explicit specialization for unsigned long long.
1933   template<> 
1934     struct atomic<unsigned long long> : atomic_ullong
1935     {
1936       atomic() { }
1938       explicit atomic(unsigned long long __v) : atomic_ullong(__v) { }
1939       
1940       unsigned long long 
1941       operator=(unsigned long long __v) volatile { store(__v); return __v; }
1942       
1943     private:
1944       atomic(const atomic&);
1945       atomic& operator=(const atomic&);
1946     };
1948   /// Explicit specialization for wchar_t.
1949   template<> 
1950     struct atomic<wchar_t> : atomic_wchar_t
1951     {
1952       atomic() { }
1954       explicit atomic(wchar_t __v) : atomic_wchar_t(__v) { }
1955       
1956       wchar_t 
1957       operator=(wchar_t __v) volatile { store(__v); return __v; }
1958       
1959     private:
1960       atomic(const atomic&);
1961       atomic& operator=(const atomic&);
1962     };
1964   inline bool 
1965   atomic_is_lock_free(const volatile atomic_bool* __a)
1966   { return false; }
1968   inline bool 
1969   atomic_load_explicit(volatile atomic_bool* __a, memory_order __x)
1970   { return _ATOMIC_LOAD_(__a, __x); }
1972   inline bool 
1973   atomic_load(volatile atomic_bool* __a)
1974   { return atomic_load_explicit(__a, memory_order_seq_cst); }
1976   inline void 
1977   atomic_store_explicit(volatile atomic_bool* __a, bool __m, memory_order __x)
1978   { _ATOMIC_STORE_(__a, __m, __x); }
1980   inline void 
1981   atomic_store(volatile atomic_bool* __a, bool __m)
1982   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
1984   inline bool 
1985   atomic_swap_explicit(volatile atomic_bool* __a, bool __m, memory_order __x)
1986   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
1988   inline bool 
1989   atomic_swap(volatile atomic_bool* __a, bool __m)
1990   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
1992   inline bool 
1993   atomic_compare_swap_explicit(volatile atomic_bool* __a, bool* __e, bool __m,
1994                                memory_order __x, memory_order __y)
1995   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
1997   inline bool 
1998   atomic_compare_swap(volatile atomic_bool* __a, bool* __e, bool __m)
1999   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2000                                         memory_order_seq_cst); }
2002   inline void 
2003   atomic_fence(const volatile atomic_bool* __a, memory_order __x)
2004   { _ATOMIC_FENCE_(__a, __x); }
2006   inline bool 
2007   atomic_is_lock_free(const volatile atomic_address* __a)
2008   { return false; }
2010   inline void* 
2011   atomic_load_explicit(volatile atomic_address* __a, memory_order __x)
2012   { return _ATOMIC_LOAD_(__a, __x); }
2014   inline void* 
2015   atomic_load(volatile atomic_address* __a)
2016   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2018   inline void 
2019   atomic_store_explicit(volatile atomic_address* __a, void* __m, 
2020                         memory_order __x)
2021   { _ATOMIC_STORE_(__a, __m, __x); }
2023   inline void 
2024   atomic_store(volatile atomic_address* __a, void* __m)
2025   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2027   inline void* 
2028   atomic_swap_explicit(volatile atomic_address* __a, void* __m, 
2029                        memory_order __x)
2030   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2032   inline void* 
2033   atomic_swap(volatile atomic_address* __a, void* __m)
2034   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2036   inline bool 
2037   atomic_compare_swap_explicit(volatile atomic_address* __a, void** __e, 
2038                                void* __m, memory_order __x, memory_order __y)
2039   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2041   inline bool 
2042   atomic_compare_swap(volatile atomic_address* __a, void** __e, void* __m)
2043   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2044                                         memory_order_seq_cst); }
2046   inline void 
2047   atomic_fence(const volatile atomic_address* __a, memory_order __x)
2048   { _ATOMIC_FENCE_(__a, __x); }
2051   inline bool 
2052   atomic_is_lock_free(const volatile atomic_char* __a)
2053   { return false; }
2055   inline char 
2056   atomic_load_explicit(volatile atomic_char* __a, memory_order __x)
2057   { return _ATOMIC_LOAD_(__a, __x); }
2059   inline char 
2060   atomic_load(volatile atomic_char* __a)
2061   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2063   inline void 
2064   atomic_store_explicit(volatile atomic_char* __a, char __m, memory_order __x)
2065   { _ATOMIC_STORE_(__a, __m, __x); }
2067   inline void 
2068   atomic_store(volatile atomic_char* __a, char __m)
2069   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2071   inline char 
2072   atomic_swap_explicit(volatile atomic_char* __a, char __m, memory_order __x)
2073   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2075   inline char 
2076   atomic_swap(volatile atomic_char* __a, char __m)
2077   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2079   inline bool 
2080   atomic_compare_swap_explicit(volatile atomic_char* __a, char* __e, char __m,
2081                                memory_order __x, memory_order __y)
2082   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2084   inline bool 
2085   atomic_compare_swap(volatile atomic_char* __a, char* __e, char __m)
2086   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2087                                         memory_order_seq_cst); }
2089   inline void 
2090   atomic_fence(const volatile atomic_char* __a, memory_order __x)
2091   { _ATOMIC_FENCE_(__a, __x); }
2094   inline bool 
2095   atomic_is_lock_free(const volatile atomic_schar* __a)
2096   { return false; }
2098   inline signed char 
2099   atomic_load_explicit(volatile atomic_schar* __a, memory_order __x)
2100   { return _ATOMIC_LOAD_(__a, __x); }
2102   inline signed char 
2103   atomic_load(volatile atomic_schar* __a)
2104   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2106   inline void 
2107   atomic_store_explicit(volatile atomic_schar* __a, signed char __m, 
2108                         memory_order __x)
2109   { _ATOMIC_STORE_(__a, __m, __x); }
2111   inline void 
2112   atomic_store(volatile atomic_schar* __a, signed char __m)
2113   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2115   inline signed char 
2116   atomic_swap_explicit(volatile atomic_schar* __a, signed char __m, 
2117                        memory_order __x)
2118   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2120   inline signed char 
2121   atomic_swap(volatile atomic_schar* __a, signed char __m)
2122   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2124   inline bool 
2125   atomic_compare_swap_explicit(volatile atomic_schar* __a, signed char* __e, 
2126                                signed char __m, memory_order __x, 
2127                                memory_order __y)
2128   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2130   inline bool 
2131   atomic_compare_swap(volatile atomic_schar* __a, signed char* __e, 
2132                       signed char __m)
2133   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2134                                         memory_order_seq_cst); }
2136   inline void 
2137   atomic_fence(const volatile atomic_schar* __a, memory_order __x)
2138   { _ATOMIC_FENCE_(__a, __x); }
2141   inline bool 
2142   atomic_is_lock_free(const volatile atomic_uchar* __a)
2143   { return false; }
2145   inline unsigned char 
2146   atomic_load_explicit(volatile atomic_uchar* __a, memory_order __x)
2147   { return _ATOMIC_LOAD_(__a, __x); }
2149   inline unsigned char 
2150   atomic_load(volatile atomic_uchar* __a)
2151   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2153   inline void 
2154   atomic_store_explicit(volatile atomic_uchar* __a, unsigned char __m, 
2155                         memory_order __x)
2156   { _ATOMIC_STORE_(__a, __m, __x); }
2158   inline void 
2159   atomic_store(volatile atomic_uchar* __a, unsigned char __m)
2160   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2162   inline unsigned char 
2163   atomic_swap_explicit(volatile atomic_uchar* __a, unsigned char __m, 
2164                        memory_order __x)
2165   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2167   inline unsigned char 
2168   atomic_swap(volatile atomic_uchar* __a, unsigned char __m)
2169   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2171   inline bool 
2172   atomic_compare_swap_explicit(volatile atomic_uchar* __a, unsigned char* __e,
2173                                unsigned char __m, memory_order __x, 
2174                                memory_order __y)
2175   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2177   inline bool 
2178   atomic_compare_swap(volatile atomic_uchar* __a, unsigned char* __e, 
2179                       unsigned char __m)
2180   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2181                                         memory_order_seq_cst); }
2183   inline void 
2184   atomic_fence(const volatile atomic_uchar* __a, memory_order __x)
2185   { _ATOMIC_FENCE_(__a, __x); }
2188   inline bool 
2189   atomic_is_lock_free(const volatile atomic_short* __a)
2190   { return false; }
2192   inline short 
2193   atomic_load_explicit(volatile atomic_short* __a, memory_order __x)
2194   { return _ATOMIC_LOAD_(__a, __x); }
2196   inline short 
2197   atomic_load(volatile atomic_short* __a)
2198   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2200   inline void 
2201   atomic_store_explicit(volatile atomic_short* __a, short __m, 
2202                         memory_order __x)
2203   { _ATOMIC_STORE_(__a, __m, __x); }
2205   inline void 
2206   atomic_store(volatile atomic_short* __a, short __m)
2207   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2209   inline short 
2210   atomic_swap_explicit(volatile atomic_short* __a, short __m, memory_order __x)
2211   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2213   inline short 
2214   atomic_swap(volatile atomic_short* __a, short __m)
2215   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2217   inline bool 
2218   atomic_compare_swap_explicit(volatile atomic_short* __a, short* __e, 
2219                                short __m, memory_order __x, memory_order __y)
2220   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2222   inline bool 
2223   atomic_compare_swap(volatile atomic_short* __a, short* __e, short __m)
2224   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2225                                         memory_order_seq_cst); }
2227   inline void 
2228   atomic_fence(const volatile atomic_short* __a, memory_order __x)
2229   { _ATOMIC_FENCE_(__a, __x); }
2232   inline bool 
2233   atomic_is_lock_free(const volatile atomic_ushort* __a)
2234   { return false; }
2236   inline unsigned short 
2237   atomic_load_explicit(volatile atomic_ushort* __a, memory_order __x)
2238   { return _ATOMIC_LOAD_(__a, __x); }
2240   inline unsigned short 
2241   atomic_load(volatile atomic_ushort* __a)
2242   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2244   inline void 
2245   atomic_store_explicit(volatile atomic_ushort* __a, unsigned short __m, 
2246                         memory_order __x)
2247   { _ATOMIC_STORE_(__a, __m, __x); }
2249   inline void 
2250   atomic_store(volatile atomic_ushort* __a, unsigned short __m)
2251   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2253   inline unsigned short 
2254   atomic_swap_explicit(volatile atomic_ushort* __a, unsigned short __m, 
2255                        memory_order __x)
2256   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2258   inline unsigned short 
2259   atomic_swap(volatile atomic_ushort* __a, unsigned short __m)
2260   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2262   inline bool 
2263   atomic_compare_swap_explicit(volatile atomic_ushort* __a, 
2264                                unsigned short* __e, unsigned short __m,
2265                                memory_order __x, memory_order __y)
2266   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2268   inline bool 
2269   atomic_compare_swap(volatile atomic_ushort* __a, unsigned short* __e, 
2270                       unsigned short __m)
2271   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2272                                         memory_order_seq_cst); }
2274   inline void 
2275   atomic_fence(const volatile atomic_ushort* __a, memory_order __x)
2276   { _ATOMIC_FENCE_(__a, __x); }
2279   inline bool 
2280   atomic_is_lock_free(const volatile atomic_int* __a)
2281   { return false; }
2283   inline int 
2284   atomic_load_explicit(volatile atomic_int* __a, memory_order __x)
2285   { return _ATOMIC_LOAD_(__a, __x); }
2287   inline int 
2288   atomic_load(volatile atomic_int* __a)
2289   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2291   inline void 
2292   atomic_store_explicit(volatile atomic_int* __a, int __m, memory_order __x)
2293   { _ATOMIC_STORE_(__a, __m, __x); }
2295   inline void 
2296   atomic_store(volatile atomic_int* __a, int __m)
2297   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2299   inline int 
2300   atomic_swap_explicit(volatile atomic_int* __a, int __m, memory_order __x)
2301   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2303   inline int 
2304   atomic_swap(volatile atomic_int* __a, int __m)
2305   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2307   inline bool 
2308   atomic_compare_swap_explicit(volatile atomic_int* __a, int* __e, int __m,
2309                                memory_order __x, memory_order __y)
2310   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2312   inline bool 
2313   atomic_compare_swap(volatile atomic_int* __a, int* __e, int __m)
2314   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2315                                         memory_order_seq_cst); }
2317   inline void 
2318   atomic_fence(const volatile atomic_int* __a, memory_order __x)
2319   { _ATOMIC_FENCE_(__a, __x); }
2322   inline bool 
2323   atomic_is_lock_free(const volatile atomic_uint* __a)
2324   { return false; }
2326   inline unsigned int 
2327   atomic_load_explicit(volatile atomic_uint* __a, memory_order __x)
2328   { return _ATOMIC_LOAD_(__a, __x); }
2330   inline unsigned int 
2331   atomic_load(volatile atomic_uint* __a)
2332   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2334   inline void 
2335   atomic_store_explicit(volatile atomic_uint* __a, unsigned int __m, 
2336                         memory_order __x)
2337   { _ATOMIC_STORE_(__a, __m, __x); }
2339   inline void 
2340   atomic_store(volatile atomic_uint* __a, unsigned int __m)
2341   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2343   inline unsigned int 
2344   atomic_swap_explicit(volatile atomic_uint* __a, unsigned int __m, 
2345                        memory_order __x)
2346   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2348   inline unsigned int 
2349   atomic_swap(volatile atomic_uint* __a, unsigned int __m)
2350   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2352   inline bool 
2353   atomic_compare_swap_explicit(volatile atomic_uint* __a, unsigned int* __e, 
2354                                unsigned int __m, memory_order __x, 
2355                                memory_order __y)
2356   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2358   inline bool 
2359   atomic_compare_swap(volatile atomic_uint* __a, unsigned int* __e, 
2360                       unsigned int __m)
2361   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2362                                         memory_order_seq_cst); }
2364   inline void 
2365   atomic_fence(const volatile atomic_uint* __a, memory_order __x)
2366   { _ATOMIC_FENCE_(__a, __x); }
2369   inline bool 
2370   atomic_is_lock_free(const volatile atomic_long* __a)
2371   { return false; }
2373   inline long 
2374   atomic_load_explicit(volatile atomic_long* __a, memory_order __x)
2375   { return _ATOMIC_LOAD_(__a, __x); }
2377   inline long 
2378   atomic_load(volatile atomic_long* __a)
2379   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2381   inline void 
2382   atomic_store_explicit(volatile atomic_long* __a, long __m, memory_order __x)
2383   { _ATOMIC_STORE_(__a, __m, __x); }
2385   inline void 
2386   atomic_store(volatile atomic_long* __a, long __m)
2387   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2389   inline long 
2390   atomic_swap_explicit(volatile atomic_long* __a, long __m, memory_order __x)
2391   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2393   inline long 
2394   atomic_swap(volatile atomic_long* __a, long __m)
2395   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2397   inline bool 
2398   atomic_compare_swap_explicit(volatile atomic_long* __a, long* __e, long __m,
2399                                memory_order __x, memory_order __y)
2400   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2402   inline bool 
2403   atomic_compare_swap(volatile atomic_long* __a, long* __e, long __m)
2404   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2405                                         memory_order_seq_cst); }
2407   inline void 
2408   atomic_fence(const volatile atomic_long* __a, memory_order __x)
2409   { _ATOMIC_FENCE_(__a, __x); }
2412   inline bool 
2413   atomic_is_lock_free(const volatile atomic_ulong* __a)
2414   { return false; }
2416   inline unsigned long 
2417   atomic_load_explicit(volatile atomic_ulong* __a, memory_order __x)
2418   { return _ATOMIC_LOAD_(__a, __x); }
2420   inline unsigned long 
2421   atomic_load(volatile atomic_ulong* __a)
2422   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2424   inline void 
2425   atomic_store_explicit(volatile atomic_ulong* __a, unsigned long __m, 
2426                         memory_order __x)
2427   { _ATOMIC_STORE_(__a, __m, __x); }
2429   inline void 
2430   atomic_store(volatile atomic_ulong* __a, unsigned long __m)
2431   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2433   inline unsigned long 
2434   atomic_swap_explicit(volatile atomic_ulong* __a, unsigned long __m, 
2435                        memory_order __x)
2436   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2438   inline unsigned long 
2439   atomic_swap(volatile atomic_ulong* __a, unsigned long __m)
2440   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2442   inline bool 
2443   atomic_compare_swap_explicit(volatile atomic_ulong* __a, unsigned long* __e,
2444                                unsigned long __m, memory_order __x, 
2445                                memory_order __y)
2446   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2448   inline bool 
2449   atomic_compare_swap(volatile atomic_ulong* __a, unsigned long* __e, 
2450                       unsigned long __m)
2451   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2452                                         memory_order_seq_cst); }
2454   inline void 
2455   atomic_fence(const volatile atomic_ulong* __a, memory_order __x)
2456   { _ATOMIC_FENCE_(__a, __x); }
2459   inline bool 
2460   atomic_is_lock_free(const volatile atomic_llong* __a)
2461   { return false; }
2463   inline long long 
2464   atomic_load_explicit(volatile atomic_llong* __a, memory_order __x)
2465   { return _ATOMIC_LOAD_(__a, __x); }
2467   inline long long 
2468   atomic_load(volatile atomic_llong* __a)
2469   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2471   inline void 
2472   atomic_store_explicit(volatile atomic_llong* __a, long long __m, 
2473                         memory_order __x)
2474   { _ATOMIC_STORE_(__a, __m, __x); }
2476   inline void 
2477   atomic_store(volatile atomic_llong* __a, long long __m)
2478   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2480   inline long long 
2481   atomic_swap_explicit(volatile atomic_llong* __a, long long __m, 
2482                        memory_order __x)
2483   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2485   inline long long 
2486   atomic_swap(volatile atomic_llong* __a, long long __m)
2487   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2489   inline bool 
2490   atomic_compare_swap_explicit(volatile atomic_llong* __a, long long* __e, 
2491                                long long __m, memory_order __x, 
2492                                memory_order __y)
2493   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2495   inline bool 
2496   atomic_compare_swap(volatile atomic_llong* __a, long long* __e, 
2497                       long long __m)
2498   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2499                                         memory_order_seq_cst); }
2501   inline void 
2502   atomic_fence(const volatile atomic_llong* __a, memory_order __x)
2503   { _ATOMIC_FENCE_(__a, __x); }
2506   inline bool 
2507   atomic_is_lock_free(const volatile atomic_ullong* __a)
2508   { return false; }
2510   inline unsigned long long 
2511   atomic_load_explicit(volatile atomic_ullong* __a, memory_order __x)
2512   { return _ATOMIC_LOAD_(__a, __x); }
2514   inline unsigned long long 
2515   atomic_load(volatile atomic_ullong* __a)
2516   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2518   inline void 
2519   atomic_store_explicit(volatile atomic_ullong* __a, unsigned long long __m, 
2520                         memory_order __x)
2521   { _ATOMIC_STORE_(__a, __m, __x); }
2523   inline void 
2524   atomic_store(volatile atomic_ullong* __a, unsigned long long __m)
2525   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2527   inline unsigned long long 
2528   atomic_swap_explicit(volatile atomic_ullong* __a, unsigned long long __m, 
2529                        memory_order __x)
2530   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2532   inline unsigned long long 
2533   atomic_swap(volatile atomic_ullong* __a, unsigned long long __m)
2534   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2536   inline bool 
2537   atomic_compare_swap_explicit(volatile atomic_ullong* __a, 
2538                                unsigned long long* __e, unsigned long long __m,
2539                                memory_order __x, memory_order __y)
2540   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2542   inline bool 
2543   atomic_compare_swap(volatile atomic_ullong* __a, unsigned long long* __e, 
2544                       unsigned long long __m)
2545   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2546                                         memory_order_seq_cst); }
2548   inline void 
2549   atomic_fence(const volatile atomic_ullong* __a, memory_order __x)
2550   { _ATOMIC_FENCE_(__a, __x); }
2552   inline bool 
2553   atomic_is_lock_free(const volatile atomic_wchar_t* __a)
2554   { return false; }
2556   inline wchar_t 
2557   atomic_load_explicit(volatile atomic_wchar_t* __a, memory_order __x)
2558   { return _ATOMIC_LOAD_(__a, __x); }
2560   inline wchar_t 
2561   atomic_load(volatile atomic_wchar_t* __a)
2562   { return atomic_load_explicit(__a, memory_order_seq_cst); }
2565   inline void 
2566   atomic_store_explicit(volatile atomic_wchar_t* __a, wchar_t __m, 
2567                         memory_order __x)
2568   { _ATOMIC_STORE_(__a, __m, __x); }
2570   inline void 
2571   atomic_store(volatile atomic_wchar_t* __a, wchar_t __m)
2572   { atomic_store_explicit(__a, __m, memory_order_seq_cst); }
2574   inline wchar_t 
2575   atomic_swap_explicit(volatile atomic_wchar_t* __a, wchar_t __m, 
2576                        memory_order __x)
2577   { return _ATOMIC_MODIFY_(__a, =, __m, __x); }
2579   inline wchar_t 
2580   atomic_swap(volatile atomic_wchar_t* __a, wchar_t __m)
2581   { return atomic_swap_explicit(__a, __m, memory_order_seq_cst); }
2583   inline bool 
2584   atomic_compare_swap_explicit(volatile atomic_wchar_t* __a, wchar_t* __e, 
2585                                wchar_t __m, memory_order __x, memory_order __y)
2586   { return _ATOMIC_CMPSWP_(__a, __e, __m, __x); }
2588   inline bool 
2589   atomic_compare_swap(volatile atomic_wchar_t* __a, wchar_t* __e, wchar_t __m)
2590   { return atomic_compare_swap_explicit(__a, __e, __m, memory_order_seq_cst, 
2591                                         memory_order_seq_cst); }
2593   inline void 
2594   atomic_fence(const volatile atomic_wchar_t* __a, memory_order __x)
2595   { _ATOMIC_FENCE_(__a, __x); }
2597   inline void* 
2598   atomic_fetch_add_explicit(volatile atomic_address* __a, ptrdiff_t __m, 
2599                             memory_order __x)
2600   { 
2601     void* volatile* __p = &((__a)->_M_base._M_i);
2602     volatile atomic_flag* __g = __atomic_flag_for_address(__p);
2603     __atomic_flag_wait_explicit(__g, __x);
2604     void* __r = *__p;
2605     *__p = (void*)((char*)(*__p) + __m);
2606     atomic_flag_clear_explicit(__g, __x);
2607     return __r; 
2608   }
2610   inline void* 
2611   atomic_fetch_add(volatile atomic_address* __a, ptrdiff_t __m)
2612   { return atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2615   inline void* 
2616   atomic_fetch_sub_explicit(volatile atomic_address* __a, ptrdiff_t __m, 
2617                             memory_order __x)
2618   { 
2619     void* volatile* __p = &((__a)->_M_base._M_i);
2620     volatile atomic_flag* __g = __atomic_flag_for_address(__p);
2621     __atomic_flag_wait_explicit(__g, __x);
2622     void* __r = *__p;
2623     *__p = (void*)((char*)(*__p) - __m);
2624     atomic_flag_clear_explicit(__g, __x);
2625     return __r; 
2626   }
2628   inline void* 
2629   atomic_fetch_sub(volatile atomic_address* __a, ptrdiff_t __m)
2630   { return atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2633   inline char 
2634   atomic_fetch_add_explicit(volatile atomic_char* __a, char __m, 
2635                             memory_order __x)
2636   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2638   inline char 
2639   atomic_fetch_add(volatile atomic_char* __a, char __m)
2640   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2642   inline char 
2643   atomic_fetch_sub_explicit(volatile atomic_char* __a, char __m, 
2644                             memory_order __x)
2645   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2647   inline char 
2648   atomic_fetch_sub(volatile atomic_char* __a, char __m)
2649   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2651   inline char 
2652   atomic_fetch_and_explicit(volatile atomic_char* __a, char __m, 
2653                             memory_order __x)
2654   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2656   inline char 
2657   atomic_fetch_and(volatile atomic_char* __a, char __m)
2658   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2660   inline char 
2661   atomic_fetch_or_explicit(volatile atomic_char* __a, char __m, 
2662                            memory_order __x)
2663   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2665   inline char 
2666   atomic_fetch_or(volatile atomic_char* __a, char __m)
2667   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2669   inline char 
2670   atomic_fetch_xor_explicit(volatile atomic_char* __a, char __m, 
2671                             memory_order __x)
2672   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2674   inline char 
2675   atomic_fetch_xor(volatile atomic_char* __a, char __m)
2676   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
2679   inline signed char 
2680   atomic_fetch_add_explicit(volatile atomic_schar* __a, signed char __m, 
2681                             memory_order __x)
2682   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2684   inline signed char 
2685   atomic_fetch_add(volatile atomic_schar* __a, signed char __m)
2686   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2688   inline signed char 
2689   atomic_fetch_sub_explicit(volatile atomic_schar* __a, signed char __m, 
2690                             memory_order __x)
2691   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2693   inline signed char 
2694   atomic_fetch_sub(volatile atomic_schar* __a, signed char __m)
2695   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2697   inline signed char 
2698   atomic_fetch_and_explicit(volatile atomic_schar* __a, signed char __m, 
2699                             memory_order __x)
2700   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2702   inline signed char 
2703   atomic_fetch_and(volatile atomic_schar* __a, signed char __m)
2704   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2706   inline signed char 
2707   atomic_fetch_or_explicit(volatile atomic_schar* __a, signed char __m, 
2708                            memory_order __x)
2709   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2711   inline signed char 
2712   atomic_fetch_or(volatile atomic_schar* __a, signed char __m)
2713   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2716   inline signed char 
2717   atomic_fetch_xor_explicit(volatile atomic_schar* __a, signed char __m, 
2718                             memory_order __x)
2719   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2721   inline signed char 
2722   atomic_fetch_xor(volatile atomic_schar* __a, signed char __m)
2723   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
2726   inline unsigned char 
2727   atomic_fetch_add_explicit(volatile atomic_uchar* __a, unsigned char __m, 
2728                             memory_order __x)
2729   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2731   inline unsigned char 
2732   atomic_fetch_add(volatile atomic_uchar* __a, unsigned char __m)
2733   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2735   inline unsigned char 
2736   atomic_fetch_sub_explicit(volatile atomic_uchar* __a, unsigned char __m, 
2737                             memory_order __x)
2738   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2740   inline unsigned char 
2741   atomic_fetch_sub(volatile atomic_uchar* __a, unsigned char __m)
2742   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2745   inline unsigned char 
2746   atomic_fetch_and_explicit(volatile atomic_uchar* __a, unsigned char __m, 
2747                             memory_order __x)
2748   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2750   inline unsigned char 
2751   atomic_fetch_and(volatile atomic_uchar* __a, unsigned char __m)
2752   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2754   inline unsigned char 
2755   atomic_fetch_or_explicit(volatile atomic_uchar* __a, unsigned char __m, 
2756                            memory_order __x)
2757   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2759   inline unsigned char 
2760   atomic_fetch_or(volatile atomic_uchar* __a, unsigned char __m)
2761   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2763   inline unsigned char 
2764   atomic_fetch_xor_explicit(volatile atomic_uchar* __a, 
2765                             unsigned char __m, memory_order __x)
2766   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2768   inline unsigned char 
2769   atomic_fetch_xor(volatile atomic_uchar* __a, unsigned char __m)
2770   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
2773   inline short 
2774   atomic_fetch_add_explicit(volatile atomic_short* __a, short __m, 
2775                             memory_order __x)
2776   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2778   inline short 
2779   atomic_fetch_add(volatile atomic_short* __a, short __m)
2780   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2782   inline short 
2783   atomic_fetch_sub_explicit(volatile atomic_short* __a, short __m, 
2784                             memory_order __x)
2785   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2787   inline short 
2788   atomic_fetch_sub(volatile atomic_short* __a, short __m)
2789   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2791   inline short 
2792   atomic_fetch_and_explicit(volatile atomic_short* __a, short __m, 
2793                             memory_order __x)
2794   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2796   inline short 
2797   atomic_fetch_and(volatile atomic_short* __a, short __m)
2798   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2800   inline short 
2801   atomic_fetch_or_explicit(volatile atomic_short* __a, short __m, 
2802                            memory_order __x)
2803   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2805   inline short 
2806   atomic_fetch_or(volatile atomic_short* __a, short __m)
2807   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2809   inline short 
2810   atomic_fetch_xor_explicit(volatile atomic_short* __a, short __m, 
2811                             memory_order __x)
2812   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2814   inline short 
2815   atomic_fetch_xor(volatile atomic_short* __a, short __m)
2816   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
2819   inline unsigned short 
2820   atomic_fetch_add_explicit(volatile atomic_ushort* __a, unsigned short __m, 
2821                             memory_order __x)
2822   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2824   inline unsigned short 
2825   atomic_fetch_add(volatile atomic_ushort* __a, unsigned short __m)
2826   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2828   inline unsigned short 
2829   atomic_fetch_sub_explicit(volatile atomic_ushort* __a, unsigned short __m, 
2830                             memory_order __x)
2831   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2833   inline unsigned short 
2834   atomic_fetch_sub(volatile atomic_ushort* __a, unsigned short __m)
2835   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2837   inline unsigned short 
2838   atomic_fetch_and_explicit(volatile atomic_ushort* __a, unsigned short __m, 
2839                             memory_order __x)
2840   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2842   inline unsigned short 
2843   atomic_fetch_and(volatile atomic_ushort* __a, unsigned short __m)
2844   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2846   inline unsigned short 
2847   atomic_fetch_or_explicit(volatile atomic_ushort* __a, unsigned short __m, 
2848                            memory_order __x)
2849   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2851   inline unsigned short 
2852   atomic_fetch_or(volatile atomic_ushort* __a, unsigned short __m)
2853   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2855   inline unsigned short 
2856   atomic_fetch_xor_explicit(volatile atomic_ushort* __a, unsigned short __m, 
2857                             memory_order __x)
2858   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2860   inline unsigned short 
2861   atomic_fetch_xor(volatile atomic_ushort* __a, unsigned short __m)
2862   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
2865   inline int 
2866   atomic_fetch_add_explicit(volatile atomic_int* __a, int __m, 
2867                             memory_order __x)
2868   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2870   inline int 
2871   atomic_fetch_add(volatile atomic_int* __a, int __m)
2872   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2874   inline int 
2875   atomic_fetch_sub_explicit(volatile atomic_int* __a, int __m, 
2876                             memory_order __x)
2877   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2879   inline int 
2880   atomic_fetch_sub(volatile atomic_int* __a, int __m)
2881   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2883   inline int 
2884   atomic_fetch_and_explicit(volatile atomic_int* __a, int __m, 
2885                             memory_order __x)
2886   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2888   inline int 
2889   atomic_fetch_and(volatile atomic_int* __a, int __m)
2890   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2892   inline int 
2893   atomic_fetch_or_explicit(volatile atomic_int* __a, int __m, 
2894                            memory_order __x)
2895   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2897   inline int 
2898   atomic_fetch_or(volatile atomic_int* __a, int __m)
2899   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2901   inline int 
2902   atomic_fetch_xor_explicit(volatile atomic_int* __a, int __m, 
2903                             memory_order __x)
2904   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2906   inline int 
2907   atomic_fetch_xor(volatile atomic_int* __a, int __m)
2908   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
2911   inline unsigned int 
2912   atomic_fetch_add_explicit(volatile atomic_uint* __a, unsigned int __m, 
2913                             memory_order __x)
2914   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2916   inline unsigned int 
2917   atomic_fetch_add(volatile atomic_uint* __a, unsigned int __m)
2918   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2920   inline unsigned int 
2921   atomic_fetch_sub_explicit(volatile atomic_uint* __a, unsigned int __m, 
2922                             memory_order __x)
2923   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2925   inline unsigned int 
2926   atomic_fetch_sub(volatile atomic_uint* __a, unsigned int __m)
2927   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2929   inline unsigned int 
2930   atomic_fetch_and_explicit(volatile atomic_uint* __a, unsigned int __m, 
2931                             memory_order __x)
2932   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2934   inline unsigned int 
2935   atomic_fetch_and(volatile atomic_uint* __a, unsigned int __m)
2936   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2938   inline unsigned int 
2939   atomic_fetch_or_explicit(volatile atomic_uint* __a, unsigned int __m, 
2940                            memory_order __x)
2941   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2943   inline unsigned int 
2944   atomic_fetch_or(volatile atomic_uint* __a, unsigned int __m)
2945   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2947   inline unsigned int 
2948   atomic_fetch_xor_explicit(volatile atomic_uint* __a, unsigned int __m, 
2949                             memory_order __x)
2950   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2952   inline unsigned int 
2953   atomic_fetch_xor(volatile atomic_uint* __a, unsigned int __m)
2954   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
2957   inline long 
2958   atomic_fetch_add_explicit(volatile atomic_long* __a, long __m, 
2959                             memory_order __x)
2960   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
2962   inline long 
2963   atomic_fetch_add(volatile atomic_long* __a, long __m)
2964   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
2966   inline long 
2967   atomic_fetch_sub_explicit(volatile atomic_long* __a, long __m, 
2968                             memory_order __x)
2969   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
2971   inline long 
2972   atomic_fetch_sub(volatile atomic_long* __a, long __m)
2973   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
2975   inline long 
2976   atomic_fetch_and_explicit(volatile atomic_long* __a, long __m, 
2977                             memory_order __x)
2978   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
2980   inline long 
2981   atomic_fetch_and(volatile atomic_long* __a, long __m)
2982   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
2984   inline long 
2985   atomic_fetch_or_explicit(volatile atomic_long* __a, long __m, 
2986                            memory_order __x)
2987   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
2989   inline long 
2990   atomic_fetch_or(volatile atomic_long* __a, long __m)
2991   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
2993   inline long 
2994   atomic_fetch_xor_explicit(volatile atomic_long* __a, long __m, 
2995                             memory_order __x)
2996   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
2998   inline long 
2999   atomic_fetch_xor(volatile atomic_long* __a, long __m)
3000   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
3003   inline unsigned long 
3004   atomic_fetch_add_explicit(volatile atomic_ulong* __a, unsigned long __m, 
3005                             memory_order __x)
3006   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
3008   inline unsigned long 
3009   atomic_fetch_add(volatile atomic_ulong* __a, unsigned long __m)
3010   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
3012   inline unsigned long 
3013   atomic_fetch_sub_explicit(volatile atomic_ulong* __a, unsigned long __m, 
3014                             memory_order __x)
3015   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
3017   inline unsigned long 
3018   atomic_fetch_sub(volatile atomic_ulong* __a, unsigned long __m)
3019   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
3021   inline unsigned long 
3022   atomic_fetch_and_explicit(volatile atomic_ulong* __a, unsigned long __m, 
3023                             memory_order __x)
3024   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
3026   inline unsigned long 
3027   atomic_fetch_and(volatile atomic_ulong* __a, unsigned long __m)
3028   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
3030   inline unsigned long 
3031   atomic_fetch_or_explicit(volatile atomic_ulong* __a, unsigned long __m, 
3032                            memory_order __x)
3033   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
3035   inline unsigned long 
3036   atomic_fetch_or(volatile atomic_ulong* __a, unsigned long __m)
3037   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
3039   inline unsigned long 
3040   atomic_fetch_xor_explicit(volatile atomic_ulong* __a, unsigned long __m, 
3041                             memory_order __x)
3042   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
3044   inline unsigned long 
3045   atomic_fetch_xor(volatile atomic_ulong* __a, unsigned long __m)
3046   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
3049   inline long long 
3050   atomic_fetch_add_explicit(volatile atomic_llong* __a, long long __m, 
3051                             memory_order __x)
3052   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
3054   inline long long 
3055   atomic_fetch_add(volatile atomic_llong* __a, long long __m)
3056   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
3058   inline long long 
3059   atomic_fetch_sub_explicit(volatile atomic_llong* __a, long long __m, 
3060                             memory_order __x)
3061   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
3063   inline long long 
3064   atomic_fetch_sub(volatile atomic_llong* __a, long long __m)
3065   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
3067   inline long long 
3068   atomic_fetch_and_explicit(volatile atomic_llong* __a, 
3069                             long long __m, memory_order __x)
3070   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
3072   inline long long 
3073   atomic_fetch_and(volatile atomic_llong* __a, long long __m)
3074   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
3076   inline long long 
3077   atomic_fetch_or_explicit(volatile atomic_llong* __a, 
3078                            long long __m, memory_order __x)
3079   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
3081   inline long long 
3082   atomic_fetch_or(volatile atomic_llong* __a, long long __m)
3083   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
3085   inline long long 
3086   atomic_fetch_xor_explicit(volatile atomic_llong* __a, 
3087                             long long __m, memory_order __x)
3088   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
3090   inline long long 
3091   atomic_fetch_xor(volatile atomic_llong* __a, long long __m)
3092   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
3095   inline unsigned long long 
3096   atomic_fetch_add_explicit(volatile atomic_ullong* __a, 
3097                             unsigned long long __m, memory_order __x)
3098   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
3100   inline unsigned long long 
3101   atomic_fetch_add(volatile atomic_ullong* __a, unsigned long long __m)
3102   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
3104   inline unsigned long long 
3105   atomic_fetch_sub_explicit(volatile atomic_ullong* __a, 
3106                             unsigned long long __m, memory_order __x)
3107   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
3109   inline unsigned long long 
3110   atomic_fetch_sub(volatile atomic_ullong* __a, unsigned long long __m)
3111   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
3113   inline unsigned long long 
3114   atomic_fetch_and_explicit(volatile atomic_ullong* __a, 
3115                             unsigned long long __m, memory_order __x)
3116   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
3118   inline unsigned long long 
3119   atomic_fetch_and(volatile atomic_ullong* __a, unsigned long long __m)
3120   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
3122   inline unsigned long long 
3123   atomic_fetch_or_explicit(volatile atomic_ullong* __a, 
3124                            unsigned long long __m, memory_order __x)
3125   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
3127   inline unsigned long long 
3128   atomic_fetch_or(volatile atomic_ullong* __a, unsigned long long __m)
3129   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
3131   inline unsigned long long 
3132   atomic_fetch_xor_explicit(volatile atomic_ullong* __a, 
3133                             unsigned long long __m, memory_order __x)
3134   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
3136   inline unsigned long long 
3137   atomic_fetch_xor(volatile atomic_ullong* __a, unsigned long long __m)
3138   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
3141   inline wchar_t 
3142   atomic_fetch_add_explicit(volatile atomic_wchar_t* __a, wchar_t __m, 
3143                             memory_order __x)
3144   { return _ATOMIC_MODIFY_(__a, +=, __m, __x); }
3146   inline wchar_t 
3147   atomic_fetch_add(volatile atomic_wchar_t* __a, wchar_t __m)
3148   { atomic_fetch_add_explicit(__a, __m, memory_order_seq_cst); }
3150   inline wchar_t 
3151   atomic_fetch_sub_explicit(volatile atomic_wchar_t* __a, wchar_t __m, 
3152                             memory_order __x)
3153   { return _ATOMIC_MODIFY_(__a, -=, __m, __x); }
3155   inline wchar_t 
3156   atomic_fetch_sub(volatile atomic_wchar_t* __a, wchar_t __m)
3157   { atomic_fetch_sub_explicit(__a, __m, memory_order_seq_cst); }
3159   inline wchar_t 
3160   atomic_fetch_and_explicit(volatile atomic_wchar_t* __a, wchar_t __m, 
3161                             memory_order __x)
3162   { return _ATOMIC_MODIFY_(__a, &=, __m, __x); }
3164   inline wchar_t 
3165   atomic_fetch_and(volatile atomic_wchar_t* __a, wchar_t __m)
3166   { atomic_fetch_and_explicit(__a, __m, memory_order_seq_cst); }
3168   inline wchar_t 
3169   atomic_fetch_or_explicit(volatile atomic_wchar_t* __a, wchar_t __m, 
3170                            memory_order __x)
3171   { return _ATOMIC_MODIFY_(__a, |=, __m, __x); }
3173   inline wchar_t 
3174   atomic_fetch_or(volatile atomic_wchar_t* __a, wchar_t __m)
3175   { atomic_fetch_or_explicit(__a, __m, memory_order_seq_cst); }
3177   inline wchar_t 
3178   atomic_fetch_xor_explicit(volatile atomic_wchar_t* __a, wchar_t __m, 
3179                             memory_order __x)
3180   { return _ATOMIC_MODIFY_(__a, ^=, __m, __x); }
3182   inline wchar_t 
3183   atomic_fetch_xor(volatile atomic_wchar_t* __a, wchar_t __m)
3184   { atomic_fetch_xor_explicit(__a, __m, memory_order_seq_cst); }
3186   inline bool 
3187   atomic_bool::is_lock_free() const volatile
3188   { return false; }
3190   inline void 
3191   atomic_bool::store(bool __m, memory_order __x) volatile
3192   { atomic_store_explicit(this, __m, __x); }
3194   inline bool 
3195   atomic_bool::load(memory_order __x) volatile
3196   { return atomic_load_explicit(this, __x); }
3198   inline bool 
3199   atomic_bool::swap(bool __m, memory_order __x) volatile
3200   { return atomic_swap_explicit(this, __m, __x); }
3202   inline bool 
3203   atomic_bool::compare_swap(bool& __e, bool __m, memory_order __x, 
3204                             memory_order __y) volatile
3205   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3207   inline bool 
3208   atomic_bool::compare_swap(bool& __e, bool __m, memory_order __x) volatile
3209   {
3210     const bool __cond1 = __x == memory_order_release;
3211     const bool __cond2 = __x == memory_order_acq_rel;
3212     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3213     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3214     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3215   }
3217   inline void 
3218   atomic_bool::fence(memory_order __x) const volatile
3219   { return atomic_fence(this, __x); }
3222   inline bool 
3223   atomic_char::is_lock_free() const volatile
3224   { return false; }
3226   inline void 
3227   atomic_char::store(char __m, memory_order __x) volatile
3228   { atomic_store_explicit(this, __m, __x); }
3230   inline char 
3231   atomic_char::load(memory_order __x) volatile
3232   { return atomic_load_explicit(this, __x); }
3234   inline char 
3235   atomic_char::swap(char __m, memory_order __x) volatile
3236   { return atomic_swap_explicit(this, __m, __x); }
3238   inline bool 
3239   atomic_char::compare_swap(char& __e, char __m,
3240                             memory_order __x, memory_order __y) volatile
3241   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3243   inline bool 
3244   atomic_char::compare_swap(char& __e, char __m, memory_order __x) volatile
3245   {
3246     const bool __cond1 = __x == memory_order_release;
3247     const bool __cond2 = __x == memory_order_acq_rel;
3248     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3249     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3250     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3251   }
3253   inline void 
3254   atomic_char::fence(memory_order __x) const volatile
3255   { return atomic_fence(this, __x); }
3258   inline bool 
3259   atomic_schar::is_lock_free() const volatile
3260   { return false; }
3262   inline void 
3263   atomic_schar::store(signed char __m, memory_order __x) volatile
3264   { atomic_store_explicit(this, __m, __x); }
3266   inline signed char 
3267   atomic_schar::load(memory_order __x) volatile
3268   { return atomic_load_explicit(this, __x); }
3270   inline signed char 
3271   atomic_schar::swap(signed char __m, memory_order __x) volatile
3272   { return atomic_swap_explicit(this, __m, __x); }
3274   inline bool 
3275   atomic_schar::compare_swap(signed char& __e, signed char __m,
3276                              memory_order __x, memory_order __y) volatile
3277   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3279   inline bool 
3280   atomic_schar::compare_swap(signed char& __e, signed char __m, 
3281                              memory_order __x) volatile
3282   {
3283     const bool __cond1 = __x == memory_order_release;
3284     const bool __cond2 = __x == memory_order_acq_rel;
3285     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3286     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3287     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3288   }
3290   inline void 
3291   atomic_schar::fence(memory_order __x) const volatile
3292   { return atomic_fence(this, __x); }
3294   inline bool 
3295   atomic_uchar::is_lock_free() const volatile
3296   { return false; }
3298   inline void 
3299   atomic_uchar::store(unsigned char __m, memory_order __x) volatile
3300   { atomic_store_explicit(this, __m, __x); }
3302   inline unsigned char 
3303   atomic_uchar::load(memory_order __x) volatile
3304   { return atomic_load_explicit(this, __x); }
3306   inline unsigned char 
3307   atomic_uchar::swap(unsigned char __m, memory_order __x) volatile
3308   { return atomic_swap_explicit(this, __m, __x); }
3310   inline bool 
3311   atomic_uchar::compare_swap(unsigned char& __e, unsigned char __m,
3312                              memory_order __x, memory_order __y) volatile
3313   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3315   inline bool 
3316   atomic_uchar::compare_swap(unsigned char& __e, unsigned char __m, 
3317                              memory_order __x) volatile
3318   {
3319     const bool __cond1 = __x == memory_order_release;
3320     const bool __cond2 = __x == memory_order_acq_rel;
3321     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3322     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3323     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3324   }
3326   inline void 
3327   atomic_uchar::fence(memory_order __x) const volatile
3328   { return atomic_fence(this, __x); }
3331   inline bool 
3332   atomic_short::is_lock_free() const volatile
3333   { return false; }
3335   inline void 
3336   atomic_short::store(short __m, memory_order __x) volatile
3337   { atomic_store_explicit(this, __m, __x); }
3339   inline short 
3340   atomic_short::load(memory_order __x) volatile
3341   { return atomic_load_explicit(this, __x); }
3343   inline short 
3344   atomic_short::swap(short __m, memory_order __x) volatile
3345   { return atomic_swap_explicit(this, __m, __x); }
3347   inline bool 
3348   atomic_short::compare_swap(short& __e, short __m,
3349                              memory_order __x, memory_order __y) volatile
3350   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3352   inline bool 
3353   atomic_short::compare_swap(short& __e, short __m, memory_order __x) volatile
3354   {
3355     const bool __cond1 = __x == memory_order_release;
3356     const bool __cond2 = __x == memory_order_acq_rel;
3357     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3358     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3359     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3360   }
3362   inline void 
3363   atomic_short::fence(memory_order __x) const volatile
3364   { return atomic_fence(this, __x); }
3367   inline bool 
3368   atomic_ushort::is_lock_free() const volatile
3369   { return false; }
3371   inline void 
3372   atomic_ushort::store(unsigned short __m, memory_order __x) volatile
3373   { atomic_store_explicit(this, __m, __x); }
3375   inline unsigned short 
3376   atomic_ushort::load(memory_order __x) volatile
3377   { return atomic_load_explicit(this, __x); }
3379   inline unsigned short 
3380   atomic_ushort::swap(unsigned short __m, memory_order __x) volatile
3381   { return atomic_swap_explicit(this, __m, __x); }
3383   inline bool 
3384   atomic_ushort::compare_swap(unsigned short& __e, unsigned short __m,
3385                               memory_order __x, memory_order __y) volatile
3386   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3388   inline bool 
3389   atomic_ushort::compare_swap(unsigned short& __e, unsigned short __m, 
3390                               memory_order __x) volatile
3391   {
3392     const bool __cond1 = __x == memory_order_release;
3393     const bool __cond2 = __x == memory_order_acq_rel;
3394     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3395     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3396     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3397   }
3399   inline void 
3400   atomic_ushort::fence(memory_order __x) const volatile
3401   { return atomic_fence(this, __x); }
3404   inline bool 
3405   atomic_int::is_lock_free() const volatile
3406   { return false; }
3408   inline void 
3409   atomic_int::store(int __m, memory_order __x) volatile
3410   { atomic_store_explicit(this, __m, __x); }
3412   inline int 
3413   atomic_int::load(memory_order __x) volatile
3414   { return atomic_load_explicit(this, __x); }
3416   inline int 
3417   atomic_int::swap(int __m, memory_order __x) volatile
3418   { return atomic_swap_explicit(this, __m, __x); }
3420   inline bool 
3421   atomic_int::compare_swap(int& __e, int __m, memory_order __x, 
3422                            memory_order __y) volatile
3423   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3425   inline bool 
3426   atomic_int::compare_swap(int& __e, int __m, memory_order __x) volatile
3427   {
3428     const bool __cond1 = __x == memory_order_release;
3429     const bool __cond2 = __x == memory_order_acq_rel;
3430     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3431     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3432     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3433   }
3435   inline void 
3436   atomic_int::fence(memory_order __x) const volatile
3437   { return atomic_fence(this, __x); }
3440   inline bool 
3441   atomic_uint::is_lock_free() const volatile
3442   { return false; }
3444   inline void 
3445   atomic_uint::store(unsigned int __m, memory_order __x) volatile
3446   { atomic_store_explicit(this, __m, __x); }
3448   inline unsigned int 
3449   atomic_uint::load(memory_order __x) volatile
3450   { return atomic_load_explicit(this, __x); }
3452   inline unsigned int 
3453   atomic_uint::swap(unsigned int __m, memory_order __x) volatile
3454   { return atomic_swap_explicit(this, __m, __x); }
3456   inline bool 
3457   atomic_uint::compare_swap(unsigned int& __e, unsigned int __m,
3458                             memory_order __x, memory_order __y) volatile
3459   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3461   inline bool 
3462   atomic_uint::compare_swap(unsigned int& __e, unsigned int __m, 
3463                             memory_order __x) volatile
3464   {
3465     const bool __cond1 = __x == memory_order_release;
3466     const bool __cond2 = __x == memory_order_acq_rel;
3467     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3468     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3469     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3470   }
3472   inline void 
3473   atomic_uint::fence(memory_order __x) const volatile
3474   { return atomic_fence(this, __x); }
3477   inline bool 
3478   atomic_long::is_lock_free() const volatile
3479   { return false; }
3481   inline void 
3482   atomic_long::store(long __m, memory_order __x) volatile
3483   { atomic_store_explicit(this, __m, __x); }
3485   inline long 
3486   atomic_long::load(memory_order __x) volatile
3487   { return atomic_load_explicit(this, __x); }
3489   inline long 
3490   atomic_long::swap(long __m, memory_order __x) volatile
3491   { return atomic_swap_explicit(this, __m, __x); }
3493   inline bool 
3494   atomic_long::compare_swap(long& __e, long __m,
3495                             memory_order __x, memory_order __y) volatile
3496   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3498   inline bool 
3499   atomic_long::compare_swap(long& __e, long __m, memory_order __x) volatile
3500   {
3501     const bool __cond1 = __x == memory_order_release;
3502     const bool __cond2 = __x == memory_order_acq_rel;
3503     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3504     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3505     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3506   }
3508   inline void 
3509   atomic_long::fence(memory_order __x) const volatile
3510   { return atomic_fence(this, __x); }
3513   inline bool 
3514   atomic_ulong::is_lock_free() const volatile
3515   { return false; }
3517   inline void 
3518   atomic_ulong::store(unsigned long __m, memory_order __x) volatile
3519   { atomic_store_explicit(this, __m, __x); }
3521   inline unsigned long 
3522   atomic_ulong::load(memory_order __x) volatile
3523   { return atomic_load_explicit(this, __x); }
3525   inline unsigned long 
3526   atomic_ulong::swap(unsigned long __m, memory_order __x) volatile
3527   { return atomic_swap_explicit(this, __m, __x); }
3529   inline bool 
3530   atomic_ulong::compare_swap(unsigned long& __e, unsigned long __m,
3531                              memory_order __x, memory_order __y) volatile
3532   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3534   inline bool 
3535   atomic_ulong::compare_swap(unsigned long& __e, unsigned long __m, 
3536                              memory_order __x) volatile
3537   {
3538     const bool __cond1 = __x == memory_order_release;
3539     const bool __cond2 = __x == memory_order_acq_rel;
3540     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3541     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3542     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3543   }
3545   inline void 
3546   atomic_ulong::fence(memory_order __x) const volatile
3547   { return atomic_fence(this, __x); }
3550   inline bool 
3551   atomic_llong::is_lock_free() const volatile
3552   { return false; }
3554   inline void 
3555   atomic_llong::store(long long __m, memory_order __x) volatile
3556   { atomic_store_explicit(this, __m, __x); }
3558   inline long long 
3559   atomic_llong::load(memory_order __x) volatile
3560   { return atomic_load_explicit(this, __x); }
3562   inline long long 
3563   atomic_llong::swap(long long __m, memory_order __x) volatile
3564   { return atomic_swap_explicit(this, __m, __x); }
3566   inline bool 
3567   atomic_llong::compare_swap(long long& __e, long long __m,
3568                              memory_order __x, memory_order __y) volatile
3569   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3571   inline bool 
3572   atomic_llong::compare_swap(long long& __e, long long __m, 
3573                              memory_order __x) volatile
3574   {
3575     const bool __cond1 = __x == memory_order_release;
3576     const bool __cond2 = __x == memory_order_acq_rel;
3577     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3578     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3579     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3580   }
3582   inline void 
3583   atomic_llong::fence(memory_order __x) const volatile
3584   { return atomic_fence(this, __x); }
3587   inline bool 
3588   atomic_ullong::is_lock_free() const volatile
3589   { return false; }
3591   inline void 
3592   atomic_ullong::store(unsigned long long __m, memory_order __x) volatile
3593   { atomic_store_explicit(this, __m, __x); }
3595   inline unsigned long long 
3596   atomic_ullong::load(memory_order __x) volatile
3597   { return atomic_load_explicit(this, __x); }
3599   inline unsigned long long 
3600   atomic_ullong::swap(unsigned long long __m, memory_order __x) volatile
3601   { return atomic_swap_explicit(this, __m, __x); }
3603   inline bool 
3604   atomic_ullong::compare_swap(unsigned long long& __e, unsigned long long __m,
3605                               memory_order __x, memory_order __y) volatile
3606   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3608   inline bool 
3609   atomic_ullong::compare_swap(unsigned long long& __e, unsigned long long __m, 
3610                               memory_order __x) volatile
3611   {
3612     const bool __cond1 = __x == memory_order_release;
3613     const bool __cond2 = __x == memory_order_acq_rel;
3614     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3615     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3616     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3617   }
3619   inline void 
3620   atomic_ullong::fence(memory_order __x) const volatile
3621   { return atomic_fence(this, __x); }
3624   inline bool 
3625   atomic_wchar_t::is_lock_free() const volatile
3626   { return false; }
3628   inline void 
3629   atomic_wchar_t::store(wchar_t __m, memory_order __x) volatile
3630   { atomic_store_explicit(this, __m, __x); }
3632   inline wchar_t 
3633   atomic_wchar_t::load(memory_order __x) volatile
3634   { return atomic_load_explicit(this, __x); }
3636   inline wchar_t 
3637   atomic_wchar_t::swap(wchar_t __m, memory_order __x) volatile
3638   { return atomic_swap_explicit(this, __m, __x); }
3640   inline bool 
3641   atomic_wchar_t::compare_swap(wchar_t& __e, wchar_t __m,
3642                                memory_order __x, memory_order __y) volatile
3643   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3645   inline bool 
3646   atomic_wchar_t::compare_swap(wchar_t& __e, wchar_t __m, 
3647                                memory_order __x) volatile
3648   {
3649     const bool __cond1 = __x == memory_order_release;
3650     const bool __cond2 = __x == memory_order_acq_rel;
3651     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3652     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3653     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
3654   }
3656   inline void 
3657   atomic_wchar_t::fence(memory_order __x) const volatile
3658   { return atomic_fence(this, __x); }
3661   inline void* 
3662   atomic_address::fetch_add(ptrdiff_t __m, memory_order __x) volatile
3663   { return atomic_fetch_add_explicit(this, __m, __x); }
3665   inline void* 
3666   atomic_address::fetch_sub(ptrdiff_t __m, memory_order __x) volatile
3667   { return atomic_fetch_sub_explicit(this, __m, __x); }
3670   inline char 
3671   atomic_char::fetch_add(char __m, memory_order __x) volatile
3672   { return atomic_fetch_add_explicit(this, __m, __x); }
3675   inline char 
3676   atomic_char::fetch_sub(char __m, memory_order __x) volatile
3677   { return atomic_fetch_sub_explicit(this, __m, __x); }
3680   inline char 
3681   atomic_char::fetch_and(char __m, memory_order __x) volatile
3682   { return atomic_fetch_and_explicit(this, __m, __x); }
3685   inline char 
3686   atomic_char::fetch_or(char __m, memory_order __x) volatile
3687   { return atomic_fetch_or_explicit(this, __m, __x); }
3690   inline char 
3691   atomic_char::fetch_xor(char __m, memory_order __x) volatile
3692   { return atomic_fetch_xor_explicit(this, __m, __x); }
3695   inline signed char 
3696   atomic_schar::fetch_add(signed char __m, memory_order __x) volatile
3697   { return atomic_fetch_add_explicit(this, __m, __x); }
3700   inline signed char 
3701   atomic_schar::fetch_sub(signed char __m, memory_order __x) volatile
3702   { return atomic_fetch_sub_explicit(this, __m, __x); }
3705   inline signed char 
3706   atomic_schar::fetch_and(signed char __m, memory_order __x) volatile
3707   { return atomic_fetch_and_explicit(this, __m, __x); }
3710   inline signed char 
3711   atomic_schar::fetch_or(signed char __m, memory_order __x) volatile
3712   { return atomic_fetch_or_explicit(this, __m, __x); }
3715   inline signed char 
3716   atomic_schar::fetch_xor(signed char __m, memory_order __x) volatile
3717   { return atomic_fetch_xor_explicit(this, __m, __x); }
3720   inline unsigned char 
3721   atomic_uchar::fetch_add(unsigned char __m, memory_order __x) volatile
3722   { return atomic_fetch_add_explicit(this, __m, __x); }
3725   inline unsigned char 
3726   atomic_uchar::fetch_sub(unsigned char __m, memory_order __x) volatile
3727   { return atomic_fetch_sub_explicit(this, __m, __x); }
3730   inline unsigned char 
3731   atomic_uchar::fetch_and(unsigned char __m, memory_order __x) volatile
3732   { return atomic_fetch_and_explicit(this, __m, __x); }
3735   inline unsigned char 
3736   atomic_uchar::fetch_or(unsigned char __m, memory_order __x) volatile
3737   { return atomic_fetch_or_explicit(this, __m, __x); }
3740   inline unsigned char 
3741   atomic_uchar::fetch_xor(unsigned char __m, memory_order __x) volatile
3742   { return atomic_fetch_xor_explicit(this, __m, __x); }
3745   inline short 
3746   atomic_short::fetch_add(short __m, memory_order __x) volatile
3747   { return atomic_fetch_add_explicit(this, __m, __x); }
3750   inline short 
3751   atomic_short::fetch_sub(short __m, memory_order __x) volatile
3752   { return atomic_fetch_sub_explicit(this, __m, __x); }
3755   inline short 
3756   atomic_short::fetch_and(short __m, memory_order __x) volatile
3757   { return atomic_fetch_and_explicit(this, __m, __x); }
3760   inline short 
3761   atomic_short::fetch_or(short __m, memory_order __x) volatile
3762   { return atomic_fetch_or_explicit(this, __m, __x); }
3765   inline short 
3766   atomic_short::fetch_xor(short __m, memory_order __x) volatile
3767   { return atomic_fetch_xor_explicit(this, __m, __x); }
3770   inline unsigned short 
3771   atomic_ushort::fetch_add(unsigned short __m, memory_order __x) volatile
3772   { return atomic_fetch_add_explicit(this, __m, __x); }
3775   inline unsigned short 
3776   atomic_ushort::fetch_sub(unsigned short __m, memory_order __x) volatile
3777   { return atomic_fetch_sub_explicit(this, __m, __x); }
3780   inline unsigned short 
3781   atomic_ushort::fetch_and(unsigned short __m, memory_order __x) volatile
3782   { return atomic_fetch_and_explicit(this, __m, __x); }
3785   inline unsigned short 
3786   atomic_ushort::fetch_or(unsigned short __m, memory_order __x) volatile
3787   { return atomic_fetch_or_explicit(this, __m, __x); }
3790   inline unsigned short 
3791   atomic_ushort::fetch_xor(unsigned short __m, memory_order __x) volatile
3792   { return atomic_fetch_xor_explicit(this, __m, __x); }
3795   inline int 
3796   atomic_int::fetch_add(int __m, memory_order __x) volatile
3797   { return atomic_fetch_add_explicit(this, __m, __x); }
3800   inline int 
3801   atomic_int::fetch_sub(int __m, memory_order __x) volatile
3802   { return atomic_fetch_sub_explicit(this, __m, __x); }
3805   inline int 
3806   atomic_int::fetch_and(int __m, memory_order __x) volatile
3807   { return atomic_fetch_and_explicit(this, __m, __x); }
3810   inline int 
3811   atomic_int::fetch_or(int __m, memory_order __x) volatile
3812   { return atomic_fetch_or_explicit(this, __m, __x); }
3815   inline int 
3816   atomic_int::fetch_xor(int __m, memory_order __x) volatile
3817   { return atomic_fetch_xor_explicit(this, __m, __x); }
3820   inline unsigned int 
3821   atomic_uint::fetch_add(unsigned int __m, memory_order __x) volatile
3822   { return atomic_fetch_add_explicit(this, __m, __x); }
3825   inline unsigned int 
3826   atomic_uint::fetch_sub(unsigned int __m, memory_order __x) volatile
3827   { return atomic_fetch_sub_explicit(this, __m, __x); }
3830   inline unsigned int 
3831   atomic_uint::fetch_and(unsigned int __m, memory_order __x) volatile
3832   { return atomic_fetch_and_explicit(this, __m, __x); }
3835   inline unsigned int 
3836   atomic_uint::fetch_or(unsigned int __m, memory_order __x) volatile
3837   { return atomic_fetch_or_explicit(this, __m, __x); }
3840   inline unsigned int 
3841   atomic_uint::fetch_xor(unsigned int __m, memory_order __x) volatile
3842   { return atomic_fetch_xor_explicit(this, __m, __x); }
3845   inline long 
3846   atomic_long::fetch_add(long __m, memory_order __x) volatile
3847   { return atomic_fetch_add_explicit(this, __m, __x); }
3850   inline long 
3851   atomic_long::fetch_sub(long __m, memory_order __x) volatile
3852   { return atomic_fetch_sub_explicit(this, __m, __x); }
3855   inline long 
3856   atomic_long::fetch_and(long __m, memory_order __x) volatile
3857   { return atomic_fetch_and_explicit(this, __m, __x); }
3860   inline long 
3861   atomic_long::fetch_or(long __m, memory_order __x) volatile
3862   { return atomic_fetch_or_explicit(this, __m, __x); }
3865   inline long 
3866   atomic_long::fetch_xor(long __m, memory_order __x) volatile
3867   { return atomic_fetch_xor_explicit(this, __m, __x); }
3870   inline unsigned long 
3871   atomic_ulong::fetch_add(unsigned long __m, memory_order __x) volatile
3872   { return atomic_fetch_add_explicit(this, __m, __x); }
3875   inline unsigned long 
3876   atomic_ulong::fetch_sub(unsigned long __m, memory_order __x) volatile
3877   { return atomic_fetch_sub_explicit(this, __m, __x); }
3880   inline unsigned long 
3881   atomic_ulong::fetch_and(unsigned long __m, memory_order __x) volatile
3882   { return atomic_fetch_and_explicit(this, __m, __x); }
3885   inline unsigned long 
3886   atomic_ulong::fetch_or(unsigned long __m, memory_order __x) volatile
3887   { return atomic_fetch_or_explicit(this, __m, __x); }
3890   inline unsigned long 
3891   atomic_ulong::fetch_xor(unsigned long __m, memory_order __x) volatile
3892   { return atomic_fetch_xor_explicit(this, __m, __x); }
3895   inline long long 
3896   atomic_llong::fetch_add(long long __m, memory_order __x) volatile
3897   { return atomic_fetch_add_explicit(this, __m, __x); }
3900   inline long long 
3901   atomic_llong::fetch_sub(long long __m, memory_order __x) volatile
3902   { return atomic_fetch_sub_explicit(this, __m, __x); }
3905   inline long long 
3906   atomic_llong::fetch_and(long long __m, memory_order __x) volatile
3907   { return atomic_fetch_and_explicit(this, __m, __x); }
3910   inline long long 
3911   atomic_llong::fetch_or(long long __m, memory_order __x) volatile
3912   { return atomic_fetch_or_explicit(this, __m, __x); }
3915   inline long long 
3916   atomic_llong::fetch_xor(long long __m, memory_order __x) volatile
3917   { return atomic_fetch_xor_explicit(this, __m, __x); }
3920   inline unsigned long long 
3921   atomic_ullong::fetch_add(unsigned long long __m, memory_order __x) volatile
3922   { return atomic_fetch_add_explicit(this, __m, __x); }
3925   inline unsigned long long 
3926   atomic_ullong::fetch_sub(unsigned long long __m, memory_order __x) volatile
3927   { return atomic_fetch_sub_explicit(this, __m, __x); }
3930   inline unsigned long long 
3931   atomic_ullong::fetch_and(unsigned long long __m, memory_order __x) volatile
3932   { return atomic_fetch_and_explicit(this, __m, __x); }
3935   inline unsigned long long 
3936   atomic_ullong::fetch_or(unsigned long long __m, memory_order __x) volatile
3937   { return atomic_fetch_or_explicit(this, __m, __x); }
3940   inline unsigned long long
3941   atomic_ullong::fetch_xor(unsigned long long __m, memory_order __x) volatile
3942   { return atomic_fetch_xor_explicit(this, __m, __x); }
3945   inline wchar_t 
3946   atomic_wchar_t::fetch_add(wchar_t __m, memory_order __x) volatile
3947   { return atomic_fetch_add_explicit(this, __m, __x); }
3950   inline wchar_t 
3951   atomic_wchar_t::fetch_sub(wchar_t __m, memory_order __x) volatile
3952   { return atomic_fetch_sub_explicit(this, __m, __x); }
3955   inline wchar_t 
3956   atomic_wchar_t::fetch_and(wchar_t __m, memory_order __x) volatile
3957   { return atomic_fetch_and_explicit(this, __m, __x); }
3960   inline wchar_t 
3961   atomic_wchar_t::fetch_or(wchar_t __m, memory_order __x) volatile
3962   { return atomic_fetch_or_explicit(this, __m, __x); }
3965   inline wchar_t 
3966   atomic_wchar_t::fetch_xor(wchar_t __m, memory_order __x) volatile
3967   { return atomic_fetch_xor_explicit(this, __m, __x); }
3970   inline bool 
3971   atomic_address::is_lock_free() const volatile
3972   { return false; }
3974   inline void 
3975   atomic_address::store(void* __m, memory_order __x) volatile
3976   { atomic_store_explicit(this, __m, __x); }
3978   inline void* 
3979   atomic_address::load(memory_order __x) volatile
3980   { return atomic_load_explicit(this, __x); }
3982   inline void* 
3983   atomic_address::swap(void* __m, memory_order __x) volatile
3984   { return atomic_swap_explicit(this, __m, __x); }
3986   inline bool 
3987   atomic_address::compare_swap(void*& __e, void* __m,
3988                                memory_order __x, memory_order __y) volatile
3989   { return atomic_compare_swap_explicit(this, &__e, __m, __x, __y); }
3991   inline bool 
3992   atomic_address::compare_swap(void*& __e, void* __m, 
3993                                memory_order __x) volatile
3994   {
3995     const bool __cond1 = __x == memory_order_release;
3996     const bool __cond2 = __x == memory_order_acq_rel;
3997     memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
3998     memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
3999     return atomic_compare_swap_explicit(this, &__e, __m, __x, __mo2);
4000   }
4002   inline void 
4003   atomic_address::fence(memory_order __x) const volatile
4004   { return atomic_fence(this, __x); }
4007   template<typename _Tp>
4008     inline bool 
4009     atomic<_Tp>::is_lock_free() const volatile
4010     { return false; }
4012   template<typename _Tp>
4013     inline void 
4014     atomic<_Tp>::store(_Tp __v, memory_order __x) volatile
4015     // XXX
4016     //  { _ATOMIC_STORE_(this, __v, __x); }
4017     { }
4019   template<typename _Tp>
4020     inline _Tp 
4021     atomic<_Tp>::load(memory_order __x) volatile
4022     // XXX
4023     //  { return _ATOMIC_LOAD_(this, __x); }
4024     { }
4026   template<typename _Tp>
4027     inline _Tp 
4028     atomic<_Tp>::swap(_Tp __v, memory_order __x) volatile
4029     // XXX
4030     //  { return _ATOMIC_MODIFY_(this, =, __v, __x); }
4031     { }
4033   template<typename _Tp>
4034     inline bool 
4035     atomic<_Tp>::compare_swap(_Tp& __r, _Tp __v, memory_order __x, 
4036                               memory_order __y) volatile
4037     // XXX
4038     // { return _ATOMIC_CMPSWP_(this, &__r, __v, __x); }
4039     { }
4041   template<typename _Tp>
4042     inline bool 
4043     atomic<_Tp>::compare_swap(_Tp& __r, _Tp __v, memory_order __x) volatile
4044     { 
4045       const bool __cond1 = __x == memory_order_release;
4046       const bool __cond2 = __x == memory_order_acq_rel;
4047       memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
4048       memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
4049       return compare_swap(__r, __v, __x, __mo2);
4050     }
4052   template<typename _Tp>
4053     _Tp* 
4054     atomic<_Tp*>::load(memory_order __x) volatile
4055     { return static_cast<_Tp*>(atomic_address::load(__x)); }
4057   template<typename _Tp>
4058     _Tp* 
4059     atomic<_Tp*>::swap(_Tp* __v, memory_order __x) volatile
4060     { return static_cast<_Tp*>(atomic_address::swap(__v, __x)); }
4062   template<typename _Tp>
4063     bool 
4064     atomic<_Tp*>::compare_swap(_Tp*& __r, _Tp* __v, memory_order __x, 
4065                                memory_order __y) volatile
4066     { return atomic_address::compare_swap(*reinterpret_cast<void**>(&__r),
4067                                           static_cast<void*>(__v), __x, __y); }
4069   template<typename _Tp>
4070     bool 
4071     atomic<_Tp*>::compare_swap(_Tp*& __r, _Tp* __v, memory_order __x) volatile
4072     { 
4073       const bool __cond1 = __x == memory_order_release;
4074       const bool __cond2 = __x == memory_order_acq_rel;
4075       memory_order __mo1(__cond1 ? memory_order_relaxed : __x);
4076       memory_order __mo2(__cond2 ? memory_order_acquire : __mo1);
4077       return compare_swap(__r, __v, __x, __mo2);
4078     }
4080   template<typename _Tp>
4081     _Tp* 
4082     atomic<_Tp*>::fetch_add(ptrdiff_t __v, memory_order __x) volatile
4083     { 
4084       void* __p = atomic_fetch_add_explicit(this, sizeof(_Tp) * __v, __x);
4085       return static_cast<_Tp*>(__p);
4086     }
4088   template<typename _Tp>
4089     _Tp* 
4090     atomic<_Tp*>::fetch_sub(ptrdiff_t __v, memory_order __x) volatile
4091     { 
4092       void* __p = atomic_fetch_sub_explicit(this, sizeof(_Tp) * __v, __x); 
4093       return static_cast<_Tp*>(__p);    
4094     }
4096 _GLIBCXX_END_NAMESPACE
4098 #endif