impatomic: add strong/weak compare_exchange
authorBrian Norris <banorris@uci.edu>
Wed, 10 Oct 2012 22:16:59 +0000 (15:16 -0700)
committerBrian Norris <banorris@uci.edu>
Wed, 10 Oct 2012 22:16:59 +0000 (15:16 -0700)
According to n2748.html, there was a change to allow spurious failure of
compare_exchange operations. Thus, there is no longer a
compare_exchange() operation, but rather a pair of
compare_exchange_{strong,weak)(). I resolve this for compilation
purposes now by editing the impatomic header (mostly with Vim macros for
patterned copy-paste-substitute) and adding an _ATOMIC_CMPSWP_WEAK_
macro, which is just an alias for _ATOMIC_CMPSWP_. Thus, we don't
simulate spurious failure yet.

See:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2748.html

include/impatomic.h

index 34bf7018c71f8cd7f0d6a628fde3642a11e89fbc..0122c69602b33ca0b6231821f74d012468f1e884 100644 (file)
@@ -99,6 +99,9 @@ inline void atomic_flag::fence( memory_order __x__ ) const volatile
         model_rmw_action((void *)__p__, __x__, (uint64_t) __copy__);          \
         __old__; })
 
         model_rmw_action((void *)__p__, __x__, (uint64_t) __copy__);          \
         __old__; })
 
+/* No spurious failure for now */
+#define _ATOMIC_CMPSWP_WEAK_ _ATOMIC_CMPSWP_
+
 #define _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ )                         \
         ({ volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__);   \
                 __typeof__(__e__) __q__ = (__e__);                            \
 #define _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ )                         \
         ({ volatile __typeof__((__a__)->__f__)* __p__ = & ((__a__)->__f__);   \
                 __typeof__(__e__) __q__ = (__e__);                            \
@@ -131,8 +134,11 @@ typedef struct atomic_bool
     void store( bool, memory_order = memory_order_seq_cst ) volatile;
     bool load( memory_order = memory_order_seq_cst ) volatile;
     bool exchange( bool, memory_order = memory_order_seq_cst ) volatile;
     void store( bool, memory_order = memory_order_seq_cst ) volatile;
     bool load( memory_order = memory_order_seq_cst ) volatile;
     bool exchange( bool, memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange ( bool&, bool, memory_order, memory_order ) volatile;
-    bool compare_exchange ( bool&, bool,
+    bool compare_exchange_weak ( bool&, bool, memory_order, memory_order ) volatile;
+    bool compare_exchange_strong ( bool&, bool, memory_order, memory_order ) volatile;
+    bool compare_exchange_weak ( bool&, bool,
+                        memory_order = memory_order_seq_cst) volatile;
+    bool compare_exchange_strong ( bool&, bool,
                         memory_order = memory_order_seq_cst) volatile;
     void fence( memory_order ) const volatile;
 
                         memory_order = memory_order_seq_cst) volatile;
     void fence( memory_order ) const volatile;
 
@@ -149,7 +155,9 @@ typedef struct atomic_bool
     friend bool atomic_load_explicit( volatile atomic_bool*, memory_order );
     friend bool atomic_exchange_explicit( volatile atomic_bool*, bool,
                                       memory_order );
     friend bool atomic_load_explicit( volatile atomic_bool*, memory_order );
     friend bool atomic_exchange_explicit( volatile atomic_bool*, bool,
                                       memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_bool*, bool*, bool,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_bool*, bool*, bool,
+                                              memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_bool*, bool*, bool,
                                               memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_bool*, memory_order );
 
                                               memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_bool*, memory_order );
 
@@ -166,8 +174,11 @@ typedef struct atomic_address
     void store( void*, memory_order = memory_order_seq_cst ) volatile;
     void* load( memory_order = memory_order_seq_cst ) volatile;
     void* exchange( void*, memory_order = memory_order_seq_cst ) volatile;
     void store( void*, memory_order = memory_order_seq_cst ) volatile;
     void* load( memory_order = memory_order_seq_cst ) volatile;
     void* exchange( void*, memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( void*&, void*, memory_order, memory_order ) volatile;
-    bool compare_exchange( void*&, void*,
+    bool compare_exchange_weak( void*&, void*, memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( void*&, void*, memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( void*&, void*,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( void*&, void*,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     void* fetch_add( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     void* fetch_add( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
@@ -192,7 +203,9 @@ typedef struct atomic_address
     friend void* atomic_load_explicit( volatile atomic_address*, memory_order );
     friend void* atomic_exchange_explicit( volatile atomic_address*, void*,
                                        memory_order );
     friend void* atomic_load_explicit( volatile atomic_address*, memory_order );
     friend void* atomic_exchange_explicit( volatile atomic_address*, void*,
                                        memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_address*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_address*,
+                              void**, void*, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_address*,
                               void**, void*, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_address*, memory_order );
     friend void* atomic_fetch_add_explicit( volatile atomic_address*, ptrdiff_t,
                               void**, void*, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_address*, memory_order );
     friend void* atomic_fetch_add_explicit( volatile atomic_address*, ptrdiff_t,
@@ -215,9 +228,13 @@ typedef struct atomic_char
     char load( memory_order = memory_order_seq_cst ) volatile;
     char exchange( char,
                       memory_order = memory_order_seq_cst ) volatile;
     char load( memory_order = memory_order_seq_cst ) volatile;
     char exchange( char,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( char&, char,
+    bool compare_exchange_weak( char&, char,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( char&, char,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( char&, char,
+    bool compare_exchange_weak( char&, char,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( char&, char,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     char fetch_add( char,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     char fetch_add( char,
@@ -272,7 +289,9 @@ typedef struct atomic_char
                                              memory_order );
     friend char atomic_exchange_explicit( volatile atomic_char*,
                                              char, memory_order );
                                              memory_order );
     friend char atomic_exchange_explicit( volatile atomic_char*,
                                              char, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_char*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_char*,
+                      char*, char, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_char*,
                       char*, char, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_char*, memory_order );
     friend char atomic_fetch_add_explicit( volatile atomic_char*,
                       char*, char, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_char*, memory_order );
     friend char atomic_fetch_add_explicit( volatile atomic_char*,
@@ -301,9 +320,13 @@ typedef struct atomic_schar
     signed char load( memory_order = memory_order_seq_cst ) volatile;
     signed char exchange( signed char,
                       memory_order = memory_order_seq_cst ) volatile;
     signed char load( memory_order = memory_order_seq_cst ) volatile;
     signed char exchange( signed char,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( signed char&, signed char,
+    bool compare_exchange_weak( signed char&, signed char,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( signed char&, signed char,
+    bool compare_exchange_strong( signed char&, signed char,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( signed char&, signed char,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( signed char&, signed char,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     signed char fetch_add( signed char,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     signed char fetch_add( signed char,
@@ -358,7 +381,9 @@ typedef struct atomic_schar
                                              memory_order );
     friend signed char atomic_exchange_explicit( volatile atomic_schar*,
                                              signed char, memory_order );
                                              memory_order );
     friend signed char atomic_exchange_explicit( volatile atomic_schar*,
                                              signed char, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_schar*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_schar*,
+                      signed char*, signed char, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_schar*,
                       signed char*, signed char, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_schar*, memory_order );
     friend signed char atomic_fetch_add_explicit( volatile atomic_schar*,
                       signed char*, signed char, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_schar*, memory_order );
     friend signed char atomic_fetch_add_explicit( volatile atomic_schar*,
@@ -387,9 +412,13 @@ typedef struct atomic_uchar
     unsigned char load( memory_order = memory_order_seq_cst ) volatile;
     unsigned char exchange( unsigned char,
                       memory_order = memory_order_seq_cst ) volatile;
     unsigned char load( memory_order = memory_order_seq_cst ) volatile;
     unsigned char exchange( unsigned char,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( unsigned char&, unsigned char,
+    bool compare_exchange_weak( unsigned char&, unsigned char,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( unsigned char&, unsigned char,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( unsigned char&, unsigned char,
+    bool compare_exchange_weak( unsigned char&, unsigned char,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( unsigned char&, unsigned char,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned char fetch_add( unsigned char,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned char fetch_add( unsigned char,
@@ -444,7 +473,9 @@ typedef struct atomic_uchar
                                              memory_order );
     friend unsigned char atomic_exchange_explicit( volatile atomic_uchar*,
                                              unsigned char, memory_order );
                                              memory_order );
     friend unsigned char atomic_exchange_explicit( volatile atomic_uchar*,
                                              unsigned char, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_uchar*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_uchar*,
+                      unsigned char*, unsigned char, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_uchar*,
                       unsigned char*, unsigned char, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_uchar*, memory_order );
     friend unsigned char atomic_fetch_add_explicit( volatile atomic_uchar*,
                       unsigned char*, unsigned char, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_uchar*, memory_order );
     friend unsigned char atomic_fetch_add_explicit( volatile atomic_uchar*,
@@ -473,9 +504,13 @@ typedef struct atomic_short
     short load( memory_order = memory_order_seq_cst ) volatile;
     short exchange( short,
                       memory_order = memory_order_seq_cst ) volatile;
     short load( memory_order = memory_order_seq_cst ) volatile;
     short exchange( short,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( short&, short,
+    bool compare_exchange_weak( short&, short,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( short&, short,
+    bool compare_exchange_strong( short&, short,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( short&, short,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( short&, short,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     short fetch_add( short,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     short fetch_add( short,
@@ -530,7 +565,9 @@ typedef struct atomic_short
                                              memory_order );
     friend short atomic_exchange_explicit( volatile atomic_short*,
                                              short, memory_order );
                                              memory_order );
     friend short atomic_exchange_explicit( volatile atomic_short*,
                                              short, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_short*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_short*,
+                      short*, short, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_short*,
                       short*, short, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_short*, memory_order );
     friend short atomic_fetch_add_explicit( volatile atomic_short*,
                       short*, short, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_short*, memory_order );
     friend short atomic_fetch_add_explicit( volatile atomic_short*,
@@ -559,9 +596,13 @@ typedef struct atomic_ushort
     unsigned short load( memory_order = memory_order_seq_cst ) volatile;
     unsigned short exchange( unsigned short,
                       memory_order = memory_order_seq_cst ) volatile;
     unsigned short load( memory_order = memory_order_seq_cst ) volatile;
     unsigned short exchange( unsigned short,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( unsigned short&, unsigned short,
+    bool compare_exchange_weak( unsigned short&, unsigned short,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( unsigned short&, unsigned short,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( unsigned short&, unsigned short,
+    bool compare_exchange_weak( unsigned short&, unsigned short,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( unsigned short&, unsigned short,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned short fetch_add( unsigned short,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned short fetch_add( unsigned short,
@@ -616,7 +657,9 @@ typedef struct atomic_ushort
                                              memory_order );
     friend unsigned short atomic_exchange_explicit( volatile atomic_ushort*,
                                              unsigned short, memory_order );
                                              memory_order );
     friend unsigned short atomic_exchange_explicit( volatile atomic_ushort*,
                                              unsigned short, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_ushort*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_ushort*,
+                      unsigned short*, unsigned short, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_ushort*,
                       unsigned short*, unsigned short, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_ushort*, memory_order );
     friend unsigned short atomic_fetch_add_explicit( volatile atomic_ushort*,
                       unsigned short*, unsigned short, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_ushort*, memory_order );
     friend unsigned short atomic_fetch_add_explicit( volatile atomic_ushort*,
@@ -645,9 +688,13 @@ typedef struct atomic_int
     int load( memory_order = memory_order_seq_cst ) volatile;
     int exchange( int,
                       memory_order = memory_order_seq_cst ) volatile;
     int load( memory_order = memory_order_seq_cst ) volatile;
     int exchange( int,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( int&, int,
+    bool compare_exchange_weak( int&, int,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( int&, int,
+    bool compare_exchange_strong( int&, int,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( int&, int,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( int&, int,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     int fetch_add( int,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     int fetch_add( int,
@@ -702,7 +749,9 @@ typedef struct atomic_int
                                              memory_order );
     friend int atomic_exchange_explicit( volatile atomic_int*,
                                              int, memory_order );
                                              memory_order );
     friend int atomic_exchange_explicit( volatile atomic_int*,
                                              int, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_int*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_int*,
+                      int*, int, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_int*,
                       int*, int, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_int*, memory_order );
     friend int atomic_fetch_add_explicit( volatile atomic_int*,
                       int*, int, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_int*, memory_order );
     friend int atomic_fetch_add_explicit( volatile atomic_int*,
@@ -731,9 +780,13 @@ typedef struct atomic_uint
     unsigned int load( memory_order = memory_order_seq_cst ) volatile;
     unsigned int exchange( unsigned int,
                       memory_order = memory_order_seq_cst ) volatile;
     unsigned int load( memory_order = memory_order_seq_cst ) volatile;
     unsigned int exchange( unsigned int,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( unsigned int&, unsigned int,
+    bool compare_exchange_weak( unsigned int&, unsigned int,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( unsigned int&, unsigned int,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( unsigned int&, unsigned int,
+    bool compare_exchange_weak( unsigned int&, unsigned int,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( unsigned int&, unsigned int,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned int fetch_add( unsigned int,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned int fetch_add( unsigned int,
@@ -788,7 +841,9 @@ typedef struct atomic_uint
                                              memory_order );
     friend unsigned int atomic_exchange_explicit( volatile atomic_uint*,
                                              unsigned int, memory_order );
                                              memory_order );
     friend unsigned int atomic_exchange_explicit( volatile atomic_uint*,
                                              unsigned int, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_uint*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_uint*,
+                      unsigned int*, unsigned int, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_uint*,
                       unsigned int*, unsigned int, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_uint*, memory_order );
     friend unsigned int atomic_fetch_add_explicit( volatile atomic_uint*,
                       unsigned int*, unsigned int, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_uint*, memory_order );
     friend unsigned int atomic_fetch_add_explicit( volatile atomic_uint*,
@@ -817,9 +872,13 @@ typedef struct atomic_long
     long load( memory_order = memory_order_seq_cst ) volatile;
     long exchange( long,
                       memory_order = memory_order_seq_cst ) volatile;
     long load( memory_order = memory_order_seq_cst ) volatile;
     long exchange( long,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( long&, long,
+    bool compare_exchange_weak( long&, long,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( long&, long,
+    bool compare_exchange_strong( long&, long,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( long&, long,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( long&, long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     long fetch_add( long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     long fetch_add( long,
@@ -874,7 +933,9 @@ typedef struct atomic_long
                                              memory_order );
     friend long atomic_exchange_explicit( volatile atomic_long*,
                                              long, memory_order );
                                              memory_order );
     friend long atomic_exchange_explicit( volatile atomic_long*,
                                              long, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_long*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_long*,
+                      long*, long, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_long*,
                       long*, long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_long*, memory_order );
     friend long atomic_fetch_add_explicit( volatile atomic_long*,
                       long*, long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_long*, memory_order );
     friend long atomic_fetch_add_explicit( volatile atomic_long*,
@@ -903,9 +964,13 @@ typedef struct atomic_ulong
     unsigned long load( memory_order = memory_order_seq_cst ) volatile;
     unsigned long exchange( unsigned long,
                       memory_order = memory_order_seq_cst ) volatile;
     unsigned long load( memory_order = memory_order_seq_cst ) volatile;
     unsigned long exchange( unsigned long,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( unsigned long&, unsigned long,
+    bool compare_exchange_weak( unsigned long&, unsigned long,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( unsigned long&, unsigned long,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( unsigned long&, unsigned long,
+    bool compare_exchange_weak( unsigned long&, unsigned long,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( unsigned long&, unsigned long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned long fetch_add( unsigned long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned long fetch_add( unsigned long,
@@ -960,7 +1025,9 @@ typedef struct atomic_ulong
                                              memory_order );
     friend unsigned long atomic_exchange_explicit( volatile atomic_ulong*,
                                              unsigned long, memory_order );
                                              memory_order );
     friend unsigned long atomic_exchange_explicit( volatile atomic_ulong*,
                                              unsigned long, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_ulong*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_ulong*,
+                      unsigned long*, unsigned long, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_ulong*,
                       unsigned long*, unsigned long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_ulong*, memory_order );
     friend unsigned long atomic_fetch_add_explicit( volatile atomic_ulong*,
                       unsigned long*, unsigned long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_ulong*, memory_order );
     friend unsigned long atomic_fetch_add_explicit( volatile atomic_ulong*,
@@ -989,9 +1056,13 @@ typedef struct atomic_llong
     long long load( memory_order = memory_order_seq_cst ) volatile;
     long long exchange( long long,
                       memory_order = memory_order_seq_cst ) volatile;
     long long load( memory_order = memory_order_seq_cst ) volatile;
     long long exchange( long long,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( long long&, long long,
+    bool compare_exchange_weak( long long&, long long,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( long long&, long long,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( long long&, long long,
+    bool compare_exchange_weak( long long&, long long,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( long long&, long long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     long long fetch_add( long long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     long long fetch_add( long long,
@@ -1046,7 +1117,9 @@ typedef struct atomic_llong
                                              memory_order );
     friend long long atomic_exchange_explicit( volatile atomic_llong*,
                                              long long, memory_order );
                                              memory_order );
     friend long long atomic_exchange_explicit( volatile atomic_llong*,
                                              long long, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_llong*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_llong*,
+                      long long*, long long, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_llong*,
                       long long*, long long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_llong*, memory_order );
     friend long long atomic_fetch_add_explicit( volatile atomic_llong*,
                       long long*, long long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_llong*, memory_order );
     friend long long atomic_fetch_add_explicit( volatile atomic_llong*,
@@ -1075,9 +1148,13 @@ typedef struct atomic_ullong
     unsigned long long load( memory_order = memory_order_seq_cst ) volatile;
     unsigned long long exchange( unsigned long long,
                       memory_order = memory_order_seq_cst ) volatile;
     unsigned long long load( memory_order = memory_order_seq_cst ) volatile;
     unsigned long long exchange( unsigned long long,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( unsigned long long&, unsigned long long,
+    bool compare_exchange_weak( unsigned long long&, unsigned long long,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( unsigned long long&, unsigned long long,
+    bool compare_exchange_strong( unsigned long long&, unsigned long long,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( unsigned long long&, unsigned long long,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( unsigned long long&, unsigned long long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned long long fetch_add( unsigned long long,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     unsigned long long fetch_add( unsigned long long,
@@ -1132,7 +1209,9 @@ typedef struct atomic_ullong
                                              memory_order );
     friend unsigned long long atomic_exchange_explicit( volatile atomic_ullong*,
                                              unsigned long long, memory_order );
                                              memory_order );
     friend unsigned long long atomic_exchange_explicit( volatile atomic_ullong*,
                                              unsigned long long, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_ullong*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_ullong*,
+                      unsigned long long*, unsigned long long, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_ullong*,
                       unsigned long long*, unsigned long long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_ullong*, memory_order );
     friend unsigned long long atomic_fetch_add_explicit( volatile atomic_ullong*,
                       unsigned long long*, unsigned long long, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_ullong*, memory_order );
     friend unsigned long long atomic_fetch_add_explicit( volatile atomic_ullong*,
@@ -1193,9 +1272,13 @@ typedef struct atomic_wchar_t
     wchar_t load( memory_order = memory_order_seq_cst ) volatile;
     wchar_t exchange( wchar_t,
                       memory_order = memory_order_seq_cst ) volatile;
     wchar_t load( memory_order = memory_order_seq_cst ) volatile;
     wchar_t exchange( wchar_t,
                       memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( wchar_t&, wchar_t,
+    bool compare_exchange_weak( wchar_t&, wchar_t,
+                       memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( wchar_t&, wchar_t,
                        memory_order, memory_order ) volatile;
                        memory_order, memory_order ) volatile;
-    bool compare_exchange( wchar_t&, wchar_t,
+    bool compare_exchange_weak( wchar_t&, wchar_t,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( wchar_t&, wchar_t,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     wchar_t fetch_add( wchar_t,
                        memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
     wchar_t fetch_add( wchar_t,
@@ -1250,7 +1333,9 @@ typedef struct atomic_wchar_t
                                              memory_order );
     friend wchar_t atomic_exchange_explicit( volatile atomic_wchar_t*,
                                              wchar_t, memory_order );
                                              memory_order );
     friend wchar_t atomic_exchange_explicit( volatile atomic_wchar_t*,
                                              wchar_t, memory_order );
-    friend bool atomic_compare_exchange_explicit( volatile atomic_wchar_t*,
+    friend bool atomic_compare_exchange_weak_explicit( volatile atomic_wchar_t*,
+                    wchar_t*, wchar_t, memory_order, memory_order );
+    friend bool atomic_compare_exchange_strong_explicit( volatile atomic_wchar_t*,
                     wchar_t*, wchar_t, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_wchar_t*, memory_order );
     friend wchar_t atomic_fetch_add_explicit( volatile atomic_wchar_t*,
                     wchar_t*, wchar_t, memory_order, memory_order );
     friend void atomic_fence( const volatile atomic_wchar_t*, memory_order );
     friend wchar_t atomic_fetch_add_explicit( volatile atomic_wchar_t*,
@@ -1290,8 +1375,10 @@ struct atomic
     void store( T, memory_order = memory_order_seq_cst ) volatile;
     T load( memory_order = memory_order_seq_cst ) volatile;
     T exchange( T __v__, memory_order = memory_order_seq_cst ) volatile;
     void store( T, memory_order = memory_order_seq_cst ) volatile;
     T load( memory_order = memory_order_seq_cst ) volatile;
     T exchange( T __v__, memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( T&, T, memory_order, memory_order ) volatile;
-    bool compare_exchange( T&, T, memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_weak( T&, T, memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( T&, T, memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( T&, T, memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( T&, T, memory_order = memory_order_seq_cst ) volatile;
     void fence( memory_order ) const volatile;
 
     CPP0X( atomic() = default; )
     void fence( memory_order ) const volatile;
 
     CPP0X( atomic() = default; )
@@ -1315,8 +1402,11 @@ template<typename T> struct atomic< T* > : atomic_address
 {
     T* load( memory_order = memory_order_seq_cst ) volatile;
     T* exchange( T*, memory_order = memory_order_seq_cst ) volatile;
 {
     T* load( memory_order = memory_order_seq_cst ) volatile;
     T* exchange( T*, memory_order = memory_order_seq_cst ) volatile;
-    bool compare_exchange( T*&, T*, memory_order, memory_order ) volatile;
-    bool compare_exchange( T*&, T*,
+    bool compare_exchange_weak( T*&, T*, memory_order, memory_order ) volatile;
+    bool compare_exchange_strong( T*&, T*, memory_order, memory_order ) volatile;
+    bool compare_exchange_weak( T*&, T*,
+                       memory_order = memory_order_seq_cst ) volatile;
+    bool compare_exchange_strong( T*&, T*,
                        memory_order = memory_order_seq_cst ) volatile;
     T* fetch_add( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
     T* fetch_sub( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
                        memory_order = memory_order_seq_cst ) volatile;
     T* fetch_add( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
     T* fetch_sub( ptrdiff_t, memory_order = memory_order_seq_cst ) volatile;
@@ -1568,14 +1658,24 @@ inline bool atomic_exchange
 ( volatile atomic_bool* __a__, bool __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_bool* __a__, bool __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_bool* __a__, bool* __e__, bool __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_bool* __a__, bool* __e__, bool __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_bool* __a__, bool* __e__, bool __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
+( volatile atomic_bool* __a__, bool* __e__, bool __m__ )
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
 ( volatile atomic_bool* __a__, bool* __e__, bool __m__ )
 ( volatile atomic_bool* __a__, bool* __e__, bool __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1609,14 +1709,24 @@ inline void* atomic_exchange
 ( volatile atomic_address* __a__, void* __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_address* __a__, void* __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_address* __a__, void** __e__, void* __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_address* __a__, void** __e__, void* __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_address* __a__, void** __e__, void* __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
+( volatile atomic_address* __a__, void** __e__, void* __m__ )
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
 ( volatile atomic_address* __a__, void** __e__, void* __m__ )
 ( volatile atomic_address* __a__, void** __e__, void* __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1650,14 +1760,24 @@ inline char atomic_exchange
 ( volatile atomic_char* __a__, char __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_char* __a__, char __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_char* __a__, char* __e__, char __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_char* __a__, char* __e__, char __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_char* __a__, char* __e__, char __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_char* __a__, char* __e__, char __m__ )
 ( volatile atomic_char* __a__, char* __e__, char __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_char* __a__, char* __e__, char __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1691,14 +1811,24 @@ inline signed char atomic_exchange
 ( volatile atomic_schar* __a__, signed char __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_schar* __a__, signed char __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_schar* __a__, signed char* __e__, signed char __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
+( volatile atomic_schar* __a__, signed char* __e__, signed char __m__ )
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__ )
 ( volatile atomic_schar* __a__, signed char* __e__, signed char __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1732,14 +1862,24 @@ inline unsigned char atomic_exchange
 ( volatile atomic_uchar* __a__, unsigned char __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_uchar* __a__, unsigned char __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__ )
 ( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_uchar* __a__, unsigned char* __e__, unsigned char __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1773,14 +1913,24 @@ inline short atomic_exchange
 ( volatile atomic_short* __a__, short __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_short* __a__, short __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_short* __a__, short* __e__, short __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_short* __a__, short* __e__, short __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_short* __a__, short* __e__, short __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_short* __a__, short* __e__, short __m__ )
 ( volatile atomic_short* __a__, short* __e__, short __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_short* __a__, short* __e__, short __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1814,14 +1964,24 @@ inline unsigned short atomic_exchange
 ( volatile atomic_ushort* __a__, unsigned short __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_ushort* __a__, unsigned short __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__ )
 ( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_ushort* __a__, unsigned short* __e__, unsigned short __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1855,14 +2015,24 @@ inline int atomic_exchange
 ( volatile atomic_int* __a__, int __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_int* __a__, int __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_int* __a__, int* __e__, int __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_int* __a__, int* __e__, int __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_int* __a__, int* __e__, int __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_int* __a__, int* __e__, int __m__ )
 ( volatile atomic_int* __a__, int* __e__, int __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_int* __a__, int* __e__, int __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1896,14 +2066,24 @@ inline unsigned int atomic_exchange
 ( volatile atomic_uint* __a__, unsigned int __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_uint* __a__, unsigned int __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
+( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__ )
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__ )
 ( volatile atomic_uint* __a__, unsigned int* __e__, unsigned int __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1937,14 +2117,24 @@ inline long atomic_exchange
 ( volatile atomic_long* __a__, long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_long* __a__, long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_long* __a__, long* __e__, long __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_long* __a__, long* __e__, long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_long* __a__, long* __e__, long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_long* __a__, long* __e__, long __m__ )
 ( volatile atomic_long* __a__, long* __e__, long __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_long* __a__, long* __e__, long __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -1978,14 +2168,24 @@ inline unsigned long atomic_exchange
 ( volatile atomic_ulong* __a__, unsigned long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_ulong* __a__, unsigned long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
+( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__ )
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__ )
 ( volatile atomic_ulong* __a__, unsigned long* __e__, unsigned long __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -2019,14 +2219,24 @@ inline long long atomic_exchange
 ( volatile atomic_llong* __a__, long long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_llong* __a__, long long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_llong* __a__, long long* __e__, long long __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_llong* __a__, long long* __e__, long long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_llong* __a__, long long* __e__, long long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_llong* __a__, long long* __e__, long long __m__ )
 ( volatile atomic_llong* __a__, long long* __e__, long long __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_llong* __a__, long long* __e__, long long __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -2060,14 +2270,24 @@ inline unsigned long long atomic_exchange
 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__ )
 ( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
+( volatile atomic_ullong* __a__, unsigned long long* __e__, unsigned long long __m__ )
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -2101,14 +2321,24 @@ inline wchar_t atomic_exchange
 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
 { return atomic_exchange_explicit( __a__, __m__, memory_order_seq_cst ); }
 
-inline bool atomic_compare_exchange_explicit
+inline bool atomic_compare_exchange_weak_explicit
+( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__,
+  memory_order __x__, memory_order __y__ )
+{ return _ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ ); }
+
+inline bool atomic_compare_exchange_strong_explicit
 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__,
   memory_order __x__, memory_order __y__ )
 { return _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ ); }
 
-inline bool atomic_compare_exchange
+inline bool atomic_compare_exchange_weak
+( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__ )
+{ return atomic_compare_exchange_weak_explicit( __a__, __e__, __m__,
+                 memory_order_seq_cst, memory_order_seq_cst ); }
+
+inline bool atomic_compare_exchange_strong
 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__ )
 ( volatile atomic_wchar_t* __a__, wchar_t* __e__, wchar_t __m__ )
-{ return atomic_compare_exchange_explicit( __a__, __e__, __m__,
+{ return atomic_compare_exchange_strong_explicit( __a__, __e__, __m__,
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
                  memory_order_seq_cst, memory_order_seq_cst ); }
 
 inline void atomic_fence
@@ -2708,10 +2938,16 @@ _ATOMIC_MODIFY_( __a__, =, __m__, memory_order_seq_cst )
 #define atomic_exchange_explicit( __a__, __m__, __x__ ) \
 _ATOMIC_MODIFY_( __a__, =, __m__, __x__ )
 
 #define atomic_exchange_explicit( __a__, __m__, __x__ ) \
 _ATOMIC_MODIFY_( __a__, =, __m__, __x__ )
 
-#define atomic_compare_exchange( __a__, __e__, __m__ ) \
+#define atomic_compare_exchange_weak( __a__, __e__, __m__ ) \
+_ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, memory_order_seq_cst )
+
+#define atomic_compare_exchange_strong( __a__, __e__, __m__ ) \
 _ATOMIC_CMPSWP_( __a__, __e__, __m__, memory_order_seq_cst )
 
 _ATOMIC_CMPSWP_( __a__, __e__, __m__, memory_order_seq_cst )
 
-#define atomic_compare_exchange_explicit( __a__, __e__, __m__, __x__, __y__ ) \
+#define atomic_compare_exchange_weak_explicit( __a__, __e__, __m__, __x__, __y__ ) \
+_ATOMIC_CMPSWP_WEAK_( __a__, __e__, __m__, __x__ )
+
+#define atomic_compare_exchange_strong_explicit( __a__, __e__, __m__, __x__, __y__ ) \
 _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ )
 
 #define atomic_fence( __a__, __x__ ) \
 _ATOMIC_CMPSWP_( __a__, __e__, __m__, __x__ )
 
 #define atomic_fence( __a__, __x__ ) \
@@ -2774,14 +3010,25 @@ inline bool atomic_bool::exchange
 ( bool __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( bool __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_bool::compare_exchange
+inline bool atomic_bool::compare_exchange_weak
+( bool& __e__, bool __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_bool::compare_exchange_strong
 ( bool& __e__, bool __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( bool& __e__, bool __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_bool::compare_exchange_weak
+( bool& __e__, bool __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
 
-inline bool atomic_bool::compare_exchange
+inline bool atomic_bool::compare_exchange_strong
 ( bool& __e__, bool __m__, memory_order __x__ ) volatile
 ( bool& __e__, bool __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -2805,14 +3052,25 @@ inline void* atomic_address::exchange
 ( void* __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( void* __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_address::compare_exchange
+inline bool atomic_address::compare_exchange_weak
+( void*& __e__, void* __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_address::compare_exchange_strong
 ( void*& __e__, void* __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( void*& __e__, void* __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_address::compare_exchange
+inline bool atomic_address::compare_exchange_weak
 ( void*& __e__, void* __m__, memory_order __x__ ) volatile
 ( void*& __e__, void* __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_address::compare_exchange_strong
+( void*& __e__, void* __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -2836,14 +3094,25 @@ inline char atomic_char::exchange
 ( char __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( char __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_char::compare_exchange
+inline bool atomic_char::compare_exchange_weak
 ( char& __e__, char __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( char& __e__, char __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_char::compare_exchange
+inline bool atomic_char::compare_exchange_strong
+( char& __e__, char __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_char::compare_exchange_weak
 ( char& __e__, char __m__, memory_order __x__ ) volatile
 ( char& __e__, char __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_char::compare_exchange_strong
+( char& __e__, char __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -2867,14 +3136,25 @@ inline signed char atomic_schar::exchange
 ( signed char __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( signed char __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_schar::compare_exchange
+inline bool atomic_schar::compare_exchange_weak
 ( signed char& __e__, signed char __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( signed char& __e__, signed char __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_schar::compare_exchange
+inline bool atomic_schar::compare_exchange_strong
+( signed char& __e__, signed char __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_schar::compare_exchange_weak
 ( signed char& __e__, signed char __m__, memory_order __x__ ) volatile
 ( signed char& __e__, signed char __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_schar::compare_exchange_strong
+( signed char& __e__, signed char __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -2898,14 +3178,25 @@ inline unsigned char atomic_uchar::exchange
 ( unsigned char __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( unsigned char __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_uchar::compare_exchange
+inline bool atomic_uchar::compare_exchange_weak
+( unsigned char& __e__, unsigned char __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_uchar::compare_exchange_strong
 ( unsigned char& __e__, unsigned char __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( unsigned char& __e__, unsigned char __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_uchar::compare_exchange
+inline bool atomic_uchar::compare_exchange_weak
 ( unsigned char& __e__, unsigned char __m__, memory_order __x__ ) volatile
 ( unsigned char& __e__, unsigned char __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_uchar::compare_exchange_strong
+( unsigned char& __e__, unsigned char __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -2929,14 +3220,25 @@ inline short atomic_short::exchange
 ( short __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( short __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_short::compare_exchange
+inline bool atomic_short::compare_exchange_weak
 ( short& __e__, short __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( short& __e__, short __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_short::compare_exchange_strong
+( short& __e__, short __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_short::compare_exchange_weak
+( short& __e__, short __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
 
-inline bool atomic_short::compare_exchange
+inline bool atomic_short::compare_exchange_strong
 ( short& __e__, short __m__, memory_order __x__ ) volatile
 ( short& __e__, short __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -2960,14 +3262,25 @@ inline unsigned short atomic_ushort::exchange
 ( unsigned short __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( unsigned short __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_ushort::compare_exchange
+inline bool atomic_ushort::compare_exchange_weak
+( unsigned short& __e__, unsigned short __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_ushort::compare_exchange_strong
 ( unsigned short& __e__, unsigned short __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( unsigned short& __e__, unsigned short __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_ushort::compare_exchange
+inline bool atomic_ushort::compare_exchange_weak
 ( unsigned short& __e__, unsigned short __m__, memory_order __x__ ) volatile
 ( unsigned short& __e__, unsigned short __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_ushort::compare_exchange_strong
+( unsigned short& __e__, unsigned short __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -2991,14 +3304,25 @@ inline int atomic_int::exchange
 ( int __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( int __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_int::compare_exchange
+inline bool atomic_int::compare_exchange_weak
+( int& __e__, int __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_int::compare_exchange_strong
 ( int& __e__, int __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( int& __e__, int __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_int::compare_exchange
+inline bool atomic_int::compare_exchange_weak
 ( int& __e__, int __m__, memory_order __x__ ) volatile
 ( int& __e__, int __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_int::compare_exchange_strong
+( int& __e__, int __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3022,14 +3346,25 @@ inline unsigned int atomic_uint::exchange
 ( unsigned int __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( unsigned int __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_uint::compare_exchange
+inline bool atomic_uint::compare_exchange_weak
+( unsigned int& __e__, unsigned int __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_uint::compare_exchange_strong
 ( unsigned int& __e__, unsigned int __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( unsigned int& __e__, unsigned int __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_uint::compare_exchange_weak
+( unsigned int& __e__, unsigned int __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
 
-inline bool atomic_uint::compare_exchange
+inline bool atomic_uint::compare_exchange_strong
 ( unsigned int& __e__, unsigned int __m__, memory_order __x__ ) volatile
 ( unsigned int& __e__, unsigned int __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3053,14 +3388,25 @@ inline long atomic_long::exchange
 ( long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_long::compare_exchange
+inline bool atomic_long::compare_exchange_weak
 ( long& __e__, long __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( long& __e__, long __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_long::compare_exchange_strong
+( long& __e__, long __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_long::compare_exchange_weak
+( long& __e__, long __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
 
-inline bool atomic_long::compare_exchange
+inline bool atomic_long::compare_exchange_strong
 ( long& __e__, long __m__, memory_order __x__ ) volatile
 ( long& __e__, long __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3084,14 +3430,25 @@ inline unsigned long atomic_ulong::exchange
 ( unsigned long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( unsigned long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_ulong::compare_exchange
+inline bool atomic_ulong::compare_exchange_weak
 ( unsigned long& __e__, unsigned long __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( unsigned long& __e__, unsigned long __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_ulong::compare_exchange
+inline bool atomic_ulong::compare_exchange_strong
+( unsigned long& __e__, unsigned long __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_ulong::compare_exchange_weak
+( unsigned long& __e__, unsigned long __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_ulong::compare_exchange_strong
 ( unsigned long& __e__, unsigned long __m__, memory_order __x__ ) volatile
 ( unsigned long& __e__, unsigned long __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3115,14 +3472,25 @@ inline long long atomic_llong::exchange
 ( long long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( long long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_llong::compare_exchange
+inline bool atomic_llong::compare_exchange_weak
 ( long long& __e__, long long __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( long long& __e__, long long __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_llong::compare_exchange
+inline bool atomic_llong::compare_exchange_strong
+( long long& __e__, long long __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_llong::compare_exchange_weak
 ( long long& __e__, long long __m__, memory_order __x__ ) volatile
 ( long long& __e__, long long __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_llong::compare_exchange_strong
+( long long& __e__, long long __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3146,14 +3514,25 @@ inline unsigned long long atomic_ullong::exchange
 ( unsigned long long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( unsigned long long __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_ullong::compare_exchange
+inline bool atomic_ullong::compare_exchange_weak
+( unsigned long long& __e__, unsigned long long __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_ullong::compare_exchange_strong
 ( unsigned long long& __e__, unsigned long long __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( unsigned long long& __e__, unsigned long long __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_ullong::compare_exchange_weak
+( unsigned long long& __e__, unsigned long long __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
 
-inline bool atomic_ullong::compare_exchange
+inline bool atomic_ullong::compare_exchange_strong
 ( unsigned long long& __e__, unsigned long long __m__, memory_order __x__ ) volatile
 ( unsigned long long& __e__, unsigned long long __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3177,14 +3556,25 @@ inline wchar_t atomic_wchar_t::exchange
 ( wchar_t __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
 ( wchar_t __m__, memory_order __x__ ) volatile
 { return atomic_exchange_explicit( this, __m__, __x__ ); }
 
-inline bool atomic_wchar_t::compare_exchange
+inline bool atomic_wchar_t::compare_exchange_weak
 ( wchar_t& __e__, wchar_t __m__,
   memory_order __x__, memory_order __y__ ) volatile
 ( wchar_t& __e__, wchar_t __m__,
   memory_order __x__, memory_order __y__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__, __y__ ); }
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__, __y__ ); }
 
 
-inline bool atomic_wchar_t::compare_exchange
+inline bool atomic_wchar_t::compare_exchange_strong
+( wchar_t& __e__, wchar_t __m__,
+  memory_order __x__, memory_order __y__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__, __y__ ); }
+
+inline bool atomic_wchar_t::compare_exchange_weak
 ( wchar_t& __e__, wchar_t __m__, memory_order __x__ ) volatile
 ( wchar_t& __e__, wchar_t __m__, memory_order __x__ ) volatile
-{ return atomic_compare_exchange_explicit( this, &__e__, __m__, __x__,
+{ return atomic_compare_exchange_weak_explicit( this, &__e__, __m__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+inline bool atomic_wchar_t::compare_exchange_strong
+( wchar_t& __e__, wchar_t __m__, memory_order __x__ ) volatile
+{ return atomic_compare_exchange_strong_explicit( this, &__e__, __m__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3210,14 +3600,26 @@ inline T atomic<T>::exchange( T __v__, memory_order __x__ ) volatile
 { return _ATOMIC_MODIFY_( this, =, __v__, __x__ ); }
 
 template< typename T >
 { return _ATOMIC_MODIFY_( this, =, __v__, __x__ ); }
 
 template< typename T >
-inline bool atomic<T>::compare_exchange
+inline bool atomic<T>::compare_exchange_weak
+( T& __r__, T __v__, memory_order __x__, memory_order __y__ ) volatile
+{ return _ATOMIC_CMPSWP_WEAK_( this, &__r__, __v__, __x__ ); }
+
+template< typename T >
+inline bool atomic<T>::compare_exchange_strong
 ( T& __r__, T __v__, memory_order __x__, memory_order __y__ ) volatile
 { return _ATOMIC_CMPSWP_( this, &__r__, __v__, __x__ ); }
 
 template< typename T >
 ( T& __r__, T __v__, memory_order __x__, memory_order __y__ ) volatile
 { return _ATOMIC_CMPSWP_( this, &__r__, __v__, __x__ ); }
 
 template< typename T >
-inline bool atomic<T>::compare_exchange
+inline bool atomic<T>::compare_exchange_weak
+( T& __r__, T __v__, memory_order __x__ ) volatile
+{ return compare_exchange_weak( __r__, __v__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+template< typename T >
+inline bool atomic<T>::compare_exchange_strong
 ( T& __r__, T __v__, memory_order __x__ ) volatile
 ( T& __r__, T __v__, memory_order __x__ ) volatile
-{ return compare_exchange( __r__, __v__, __x__,
+{ return compare_exchange_strong( __r__, __v__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
@@ -3540,16 +3942,30 @@ T* atomic<T*>::exchange( T* __v__, memory_order __x__ ) volatile
 { return static_cast<T*>( atomic_address::exchange( __v__, __x__ ) ); }
 
 template< typename T >
 { return static_cast<T*>( atomic_address::exchange( __v__, __x__ ) ); }
 
 template< typename T >
-bool atomic<T*>::compare_exchange
+bool atomic<T*>::compare_exchange_weak
 ( T*& __r__, T* __v__, memory_order __x__, memory_order __y__) volatile
 ( T*& __r__, T* __v__, memory_order __x__, memory_order __y__) volatile
-{ return atomic_address::compare_exchange( *reinterpret_cast<void**>( &__r__ ),
+{ return atomic_address::compare_exchange_weak( *reinterpret_cast<void**>( &__r__ ),
+               static_cast<void*>( __v__ ), __x__, __y__ ); }
+//{ return _ATOMIC_CMPSWP_WEAK_( this, &__r__, __v__, __x__ ); }
+
+template< typename T >
+bool atomic<T*>::compare_exchange_strong
+( T*& __r__, T* __v__, memory_order __x__, memory_order __y__) volatile
+{ return atomic_address::compare_exchange_strong( *reinterpret_cast<void**>( &__r__ ),
                static_cast<void*>( __v__ ), __x__, __y__ ); }
 //{ return _ATOMIC_CMPSWP_( this, &__r__, __v__, __x__ ); }
 
 template< typename T >
                static_cast<void*>( __v__ ), __x__, __y__ ); }
 //{ return _ATOMIC_CMPSWP_( this, &__r__, __v__, __x__ ); }
 
 template< typename T >
-bool atomic<T*>::compare_exchange
+bool atomic<T*>::compare_exchange_weak
+( T*& __r__, T* __v__, memory_order __x__ ) volatile
+{ return compare_exchange_weak( __r__, __v__, __x__,
+      __x__ == memory_order_acq_rel ? memory_order_acquire :
+      __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
+
+template< typename T >
+bool atomic<T*>::compare_exchange_strong
 ( T*& __r__, T* __v__, memory_order __x__ ) volatile
 ( T*& __r__, T* __v__, memory_order __x__ ) volatile
-{ return compare_exchange( __r__, __v__, __x__,
+{ return compare_exchange_strong( __r__, __v__, __x__,
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }
 
       __x__ == memory_order_acq_rel ? memory_order_acquire :
       __x__ == memory_order_release ? memory_order_relaxed : __x__ ); }