@@ -1432,6 +1432,11 @@ unsigned int wolfSSL_Atomic_Uint_SubFetch(wolfSSL_Atomic_Uint* c,
14321432 return val - i ;
14331433}
14341434
1435+ int wolfSSL_Atomic_Int_Exchange (wolfSSL_Atomic_Int * c , int new_i )
1436+ {
1437+ return atomic_swap_int (c , new_i );
1438+ }
1439+
14351440int wolfSSL_Atomic_Int_CompareExchange (wolfSSL_Atomic_Int * c , int * expected_i ,
14361441 int new_i )
14371442{
@@ -1495,6 +1500,11 @@ int wolfSSL_Atomic_Int_SubFetch(wolfSSL_Atomic_Int* c, int i)
14951500 return ret - i ;
14961501}
14971502
1503+ int wolfSSL_Atomic_Int_Exchange (wolfSSL_Atomic_Int * c , int new_i )
1504+ {
1505+ return atomic_exchange_explicit (c , new_i , memory_order_seq_cst );
1506+ }
1507+
14981508int wolfSSL_Atomic_Int_CompareExchange (
14991509 wolfSSL_Atomic_Int * c , int * expected_i , int new_i )
15001510{
@@ -1600,6 +1610,11 @@ int wolfSSL_Atomic_Int_SubFetch(wolfSSL_Atomic_Int* c, int i)
16001610 return __atomic_sub_fetch (c , i , __ATOMIC_RELAXED );
16011611}
16021612
1613+ int wolfSSL_Atomic_Int_Exchange (wolfSSL_Atomic_Int * c , int new_i )
1614+ {
1615+ return __atomic_exchange_n (c , new_i , __ATOMIC_SEQ_CST );
1616+ }
1617+
16031618int wolfSSL_Atomic_Int_CompareExchange (wolfSSL_Atomic_Int * c , int * expected_i ,
16041619 int new_i )
16051620{
@@ -1692,6 +1707,12 @@ int wolfSSL_Atomic_Int_SubFetch(wolfSSL_Atomic_Int* c, int i)
16921707 return ret - i ;
16931708}
16941709
1710+ int wolfSSL_Atomic_Int_Exchange (wolfSSL_Atomic_Int * c , int new_i )
1711+ {
1712+ long actual_i = InterlockedExchange (c , (long )new_i );
1713+ return (int )actual_i ;
1714+ }
1715+
16951716int wolfSSL_Atomic_Int_CompareExchange (wolfSSL_Atomic_Int * c , int * expected_i ,
16961717 int new_i )
16971718{
0 commit comments