00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if !defined(__GNUC__)
00021 #error "This file must be compiled with GNUC compiler"
00022 #endif
00023
00024 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 0)
00025 #else
00026 #error "GCC version too low. It must be greater than 4.0"
00027 #endif
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #ifdef __cplusplus
00046
00047
00048
00049
00050 inline void* atomic_fetch_add_explicit
00051 ( volatile atomic_address* __a__, ptrdiff_t __m__, memory_order __x__ )
00052 {return __sync_fetch_and_add(&__a__->__f__, __m__);}
00053
00054 inline void* atomic_fetch_add
00055 ( volatile atomic_address* __a__, ptrdiff_t __m__ )
00056 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00057
00058
00059 inline void* atomic_fetch_sub_explicit
00060 ( volatile atomic_address* __a__, ptrdiff_t __m__, memory_order __x__ )
00061 { return __sync_fetch_and_sub(&__a__->__f__, __m__);}
00062
00063 inline void* atomic_fetch_sub
00064 ( volatile atomic_address* __a__, ptrdiff_t __m__ )
00065 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00066
00067
00068 inline char atomic_fetch_add_explicit
00069 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
00070 { return __sync_fetch_and_add(&__a__->__f__, __m__);}
00071
00072 inline char atomic_fetch_add
00073 ( volatile atomic_char* __a__, char __m__ )
00074 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00075
00076
00077 inline char atomic_fetch_sub_explicit
00078 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
00079 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00080
00081 inline char atomic_fetch_sub
00082 ( volatile atomic_char* __a__, char __m__ )
00083 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00084
00085
00086 inline char atomic_fetch_and_explicit
00087 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
00088 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00089
00090 inline char atomic_fetch_and
00091 ( volatile atomic_char* __a__, char __m__ )
00092 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00093
00094
00095 inline char atomic_fetch_or_explicit
00096 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
00097 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00098
00099 inline char atomic_fetch_or
00100 ( volatile atomic_char* __a__, char __m__ )
00101 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00102
00103
00104 inline char atomic_fetch_xor_explicit
00105 ( volatile atomic_char* __a__, char __m__, memory_order __x__ )
00106 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00107
00108 inline char atomic_fetch_xor
00109 ( volatile atomic_char* __a__, char __m__ )
00110 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00111
00112
00113 inline signed char atomic_fetch_add_explicit
00114 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
00115 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00116
00117 inline signed char atomic_fetch_add
00118 ( volatile atomic_schar* __a__, signed char __m__ )
00119 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00120
00121
00122 inline signed char atomic_fetch_sub_explicit
00123 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
00124 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00125
00126 inline signed char atomic_fetch_sub
00127 ( volatile atomic_schar* __a__, signed char __m__ )
00128 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00129
00130
00131 inline signed char atomic_fetch_and_explicit
00132 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
00133 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00134
00135 inline signed char atomic_fetch_and
00136 ( volatile atomic_schar* __a__, signed char __m__ )
00137 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00138
00139
00140 inline signed char atomic_fetch_or_explicit
00141 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
00142 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00143
00144 inline signed char atomic_fetch_or
00145 ( volatile atomic_schar* __a__, signed char __m__ )
00146 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00147
00148
00149 inline signed char atomic_fetch_xor_explicit
00150 ( volatile atomic_schar* __a__, signed char __m__, memory_order __x__ )
00151 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00152
00153 inline signed char atomic_fetch_xor
00154 ( volatile atomic_schar* __a__, signed char __m__ )
00155 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00156
00157
00158 inline unsigned char atomic_fetch_add_explicit
00159 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
00160 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00161
00162 inline unsigned char atomic_fetch_add
00163 ( volatile atomic_uchar* __a__, unsigned char __m__ )
00164 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00165
00166
00167 inline unsigned char atomic_fetch_sub_explicit
00168 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
00169 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00170
00171 inline unsigned char atomic_fetch_sub
00172 ( volatile atomic_uchar* __a__, unsigned char __m__ )
00173 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00174
00175
00176 inline unsigned char atomic_fetch_and_explicit
00177 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
00178 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00179
00180 inline unsigned char atomic_fetch_and
00181 ( volatile atomic_uchar* __a__, unsigned char __m__ )
00182 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00183
00184
00185 inline unsigned char atomic_fetch_or_explicit
00186 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
00187 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00188
00189 inline unsigned char atomic_fetch_or
00190 ( volatile atomic_uchar* __a__, unsigned char __m__ )
00191 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00192
00193
00194 inline unsigned char atomic_fetch_xor_explicit
00195 ( volatile atomic_uchar* __a__, unsigned char __m__, memory_order __x__ )
00196 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00197
00198 inline unsigned char atomic_fetch_xor
00199 ( volatile atomic_uchar* __a__, unsigned char __m__ )
00200 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00201
00202
00203 inline short atomic_fetch_add_explicit
00204 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
00205 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00206
00207 inline short atomic_fetch_add
00208 ( volatile atomic_short* __a__, short __m__ )
00209 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00210
00211
00212 inline short atomic_fetch_sub_explicit
00213 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
00214 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00215
00216 inline short atomic_fetch_sub
00217 ( volatile atomic_short* __a__, short __m__ )
00218 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00219
00220
00221 inline short atomic_fetch_and_explicit
00222 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
00223 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00224
00225 inline short atomic_fetch_and
00226 ( volatile atomic_short* __a__, short __m__ )
00227 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00228
00229
00230 inline short atomic_fetch_or_explicit
00231 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
00232 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00233
00234 inline short atomic_fetch_or
00235 ( volatile atomic_short* __a__, short __m__ )
00236 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00237
00238
00239 inline short atomic_fetch_xor_explicit
00240 ( volatile atomic_short* __a__, short __m__, memory_order __x__ )
00241 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00242
00243 inline short atomic_fetch_xor
00244 ( volatile atomic_short* __a__, short __m__ )
00245 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00246
00247
00248 inline unsigned short atomic_fetch_add_explicit
00249 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
00250 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00251
00252 inline unsigned short atomic_fetch_add
00253 ( volatile atomic_ushort* __a__, unsigned short __m__ )
00254 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00255
00256
00257 inline unsigned short atomic_fetch_sub_explicit
00258 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
00259 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00260
00261 inline unsigned short atomic_fetch_sub
00262 ( volatile atomic_ushort* __a__, unsigned short __m__ )
00263 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00264
00265
00266 inline unsigned short atomic_fetch_and_explicit
00267 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
00268 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00269
00270 inline unsigned short atomic_fetch_and
00271 ( volatile atomic_ushort* __a__, unsigned short __m__ )
00272 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00273
00274
00275 inline unsigned short atomic_fetch_or_explicit
00276 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
00277 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00278
00279 inline unsigned short atomic_fetch_or
00280 ( volatile atomic_ushort* __a__, unsigned short __m__ )
00281 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00282
00283
00284 inline unsigned short atomic_fetch_xor_explicit
00285 ( volatile atomic_ushort* __a__, unsigned short __m__, memory_order __x__ )
00286 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00287
00288 inline unsigned short atomic_fetch_xor
00289 ( volatile atomic_ushort* __a__, unsigned short __m__ )
00290 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00291
00292
00293 inline int atomic_fetch_add_explicit
00294 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
00295 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00296
00297 inline int atomic_fetch_add
00298 ( volatile atomic_int* __a__, int __m__ )
00299 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00300
00301
00302 inline int atomic_fetch_sub_explicit
00303 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
00304 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00305
00306 inline int atomic_fetch_sub
00307 ( volatile atomic_int* __a__, int __m__ )
00308 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00309
00310
00311 inline int atomic_fetch_and_explicit
00312 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
00313 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00314
00315 inline int atomic_fetch_and
00316 ( volatile atomic_int* __a__, int __m__ )
00317 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00318
00319
00320 inline int atomic_fetch_or_explicit
00321 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
00322 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00323
00324 inline int atomic_fetch_or
00325 ( volatile atomic_int* __a__, int __m__ )
00326 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00327
00328
00329 inline int atomic_fetch_xor_explicit
00330 ( volatile atomic_int* __a__, int __m__, memory_order __x__ )
00331 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00332
00333 inline int atomic_fetch_xor
00334 ( volatile atomic_int* __a__, int __m__ )
00335 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00336
00337
00338 inline unsigned int atomic_fetch_add_explicit
00339 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
00340 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00341
00342 inline unsigned int atomic_fetch_add
00343 ( volatile atomic_uint* __a__, unsigned int __m__ )
00344 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00345
00346
00347 inline unsigned int atomic_fetch_sub_explicit
00348 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
00349 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00350
00351 inline unsigned int atomic_fetch_sub
00352 ( volatile atomic_uint* __a__, unsigned int __m__ )
00353 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00354
00355
00356 inline unsigned int atomic_fetch_and_explicit
00357 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
00358 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00359
00360 inline unsigned int atomic_fetch_and
00361 ( volatile atomic_uint* __a__, unsigned int __m__ )
00362 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00363
00364
00365 inline unsigned int atomic_fetch_or_explicit
00366 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
00367 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00368
00369 inline unsigned int atomic_fetch_or
00370 ( volatile atomic_uint* __a__, unsigned int __m__ )
00371 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00372
00373
00374 inline unsigned int atomic_fetch_xor_explicit
00375 ( volatile atomic_uint* __a__, unsigned int __m__, memory_order __x__ )
00376 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00377
00378 inline unsigned int atomic_fetch_xor
00379 ( volatile atomic_uint* __a__, unsigned int __m__ )
00380 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00381
00382
00383 inline long atomic_fetch_add_explicit
00384 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
00385 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00386
00387 inline long atomic_fetch_add
00388 ( volatile atomic_long* __a__, long __m__ )
00389 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00390
00391
00392 inline long atomic_fetch_sub_explicit
00393 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
00394 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00395
00396 inline long atomic_fetch_sub
00397 ( volatile atomic_long* __a__, long __m__ )
00398 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00399
00400
00401 inline long atomic_fetch_and_explicit
00402 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
00403 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00404
00405 inline long atomic_fetch_and
00406 ( volatile atomic_long* __a__, long __m__ )
00407 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00408
00409
00410 inline long atomic_fetch_or_explicit
00411 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
00412 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00413
00414 inline long atomic_fetch_or
00415 ( volatile atomic_long* __a__, long __m__ )
00416 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00417
00418
00419 inline long atomic_fetch_xor_explicit
00420 ( volatile atomic_long* __a__, long __m__, memory_order __x__ )
00421 { return __sync_fetch_and_xor(&(__a__->__f__), __m__); }
00422
00423 inline long atomic_fetch_xor
00424 ( volatile atomic_long* __a__, long __m__ )
00425 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00426
00427
00428 inline unsigned long atomic_fetch_add_explicit
00429 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
00430 { return __sync_fetch_and_add(&(__a__->__f__), __m__); }
00431
00432 inline unsigned long atomic_fetch_add
00433 ( volatile atomic_ulong* __a__, unsigned long __m__ )
00434 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00435
00436
00437 inline unsigned long atomic_fetch_sub_explicit
00438 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
00439 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00440
00441 inline unsigned long atomic_fetch_sub
00442 ( volatile atomic_ulong* __a__, unsigned long __m__ )
00443 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00444
00445
00446 inline unsigned long atomic_fetch_and_explicit
00447 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
00448 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00449
00450 inline unsigned long atomic_fetch_and
00451 ( volatile atomic_ulong* __a__, unsigned long __m__ )
00452 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00453
00454
00455 inline unsigned long atomic_fetch_or_explicit
00456 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
00457 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00458
00459 inline unsigned long atomic_fetch_or
00460 ( volatile atomic_ulong* __a__, unsigned long __m__ )
00461 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00462
00463
00464 inline unsigned long atomic_fetch_xor_explicit
00465 ( volatile atomic_ulong* __a__, unsigned long __m__, memory_order __x__ )
00466 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00467
00468 inline unsigned long atomic_fetch_xor
00469 ( volatile atomic_ulong* __a__, unsigned long __m__ )
00470 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00471
00472
00473 inline long long atomic_fetch_add_explicit
00474 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
00475 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00476
00477 inline long long atomic_fetch_add
00478 ( volatile atomic_llong* __a__, long long __m__ )
00479 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00480
00481
00482 inline long long atomic_fetch_sub_explicit
00483 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
00484 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00485
00486 inline long long atomic_fetch_sub
00487 ( volatile atomic_llong* __a__, long long __m__ )
00488 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00489
00490
00491 inline long long atomic_fetch_and_explicit
00492 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
00493 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00494
00495 inline long long atomic_fetch_and
00496 ( volatile atomic_llong* __a__, long long __m__ )
00497 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00498
00499
00500 inline long long atomic_fetch_or_explicit
00501 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
00502 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00503
00504 inline long long atomic_fetch_or
00505 ( volatile atomic_llong* __a__, long long __m__ )
00506 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00507
00508
00509 inline long long atomic_fetch_xor_explicit
00510 ( volatile atomic_llong* __a__, long long __m__, memory_order __x__ )
00511 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00512
00513 inline long long atomic_fetch_xor
00514 ( volatile atomic_llong* __a__, long long __m__ )
00515 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00516
00517
00518 inline unsigned long long atomic_fetch_add_explicit
00519 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
00520 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00521
00522 inline unsigned long long atomic_fetch_add
00523 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
00524 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00525
00526
00527 inline unsigned long long atomic_fetch_sub_explicit
00528 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
00529 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00530
00531 inline unsigned long long atomic_fetch_sub
00532 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
00533 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00534
00535
00536 inline unsigned long long atomic_fetch_and_explicit
00537 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
00538 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00539
00540 inline unsigned long long atomic_fetch_and
00541 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
00542 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00543
00544
00545 inline unsigned long long atomic_fetch_or_explicit
00546 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
00547 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00548
00549 inline unsigned long long atomic_fetch_or
00550 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
00551 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00552
00553
00554 inline unsigned long long atomic_fetch_xor_explicit
00555 ( volatile atomic_ullong* __a__, unsigned long long __m__, memory_order __x__ )
00556 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00557
00558 inline unsigned long long atomic_fetch_xor
00559 ( volatile atomic_ullong* __a__, unsigned long long __m__ )
00560 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00561
00562
00563 inline wchar_t atomic_fetch_add_explicit
00564 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
00565 { return __sync_fetch_and_add(&__a__->__f__, __m__); }
00566
00567 inline wchar_t atomic_fetch_add
00568 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
00569 { return atomic_fetch_add_explicit( __a__, __m__, memory_order_seq_cst ); }
00570
00571
00572 inline wchar_t atomic_fetch_sub_explicit
00573 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
00574 { return __sync_fetch_and_sub(&__a__->__f__, __m__); }
00575
00576 inline wchar_t atomic_fetch_sub
00577 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
00578 { return atomic_fetch_sub_explicit( __a__, __m__, memory_order_seq_cst ); }
00579
00580
00581 inline wchar_t atomic_fetch_and_explicit
00582 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
00583 { return __sync_fetch_and_and(&__a__->__f__, __m__); }
00584
00585 inline wchar_t atomic_fetch_and
00586 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
00587 { return atomic_fetch_and_explicit( __a__, __m__, memory_order_seq_cst ); }
00588
00589
00590 inline wchar_t atomic_fetch_or_explicit
00591 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
00592 { return __sync_fetch_and_or(&__a__->__f__, __m__); }
00593
00594 inline wchar_t atomic_fetch_or
00595 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
00596 { return atomic_fetch_or_explicit( __a__, __m__, memory_order_seq_cst ); }
00597
00598
00599 inline wchar_t atomic_fetch_xor_explicit
00600 ( volatile atomic_wchar_t* __a__, wchar_t __m__, memory_order __x__ )
00601 { return __sync_fetch_and_xor(&__a__->__f__, __m__); }
00602
00603 inline wchar_t atomic_fetch_xor
00604 ( volatile atomic_wchar_t* __a__, wchar_t __m__ )
00605 { return atomic_fetch_xor_explicit( __a__, __m__, memory_order_seq_cst ); }
00606
00607 #else
00608
00609 #define atomic_fetch_add_explicit( __a__, __m__, __x__ ) \
00610 __sync_fetch_and_add(&((__a__)->__f__), __m__)
00611
00612 #define atomic_fetch_add( __a__, __m__ ) \
00613 __sync_fetch_and_add(&((__a__)->__f__), __m__)
00614
00615
00616 #define atomic_fetch_sub_explicit( __a__, __m__, __x__ ) \
00617 __sync_fetch_and_sub(&((__a__)->__f__), __m__)
00618
00619 #define atomic_fetch_sub( __a__, __m__ ) \
00620 __sync_fetch_and_sub(&((__a__)->__f__), __m__)
00621
00622
00623 #define atomic_fetch_and_explicit( __a__, __m__, __x__ ) \
00624 __sync_fetch_and_and(&((__a__)->__f__), __m__)
00625
00626 #define atomic_fetch_and( __a__, __m__ ) \
00627 __sync_fetch_and_and(&((__a__)->__f__), __m__)
00628
00629
00630 #define atomic_fetch_or_explicit( __a__, __m__, __x__ ) \
00631 __sync_fetch_and_or(&((__a__)->__f__), __m__)
00632
00633 #define atomic_fetch_or( __a__, __m__ ) \
00634 __sync_fetch_and_or(&((__a__)->__f__), __m__)
00635
00636
00637 #define atomic_fetch_xor_explicit( __a__, __m__, __x__ ) \
00638 __sync_fetch_and_xor(&((__a__)->__f__), __m__)
00639
00640 #define atomic_fetch_xor( __a__, __m__ ) \
00641 __sync_fetch_and_xor(&((__a__)->__f__), __m__)
00642
00643 #endif
00644