@@ -222,58 +222,79 @@ USHORT QueryDepthSList(WINPR_PSLIST_HEADER ListHead)
222
222
223
223
LONG InterlockedIncrement (LONG volatile * Addend )
224
224
{
225
- #ifdef __GNUC__
226
- #pragma GCC diagnostic push
227
- #pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
225
+ #if defined(__GNUC__ ) || defined(__clang__ )
226
+ #ifdef __clang__
227
+ #pragma clang diagnostic push
228
+ #pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
229
+ #endif
228
230
return __sync_add_and_fetch (Addend , 1 );
229
- #pragma GCC diagnostic pop
231
+ #ifdef __clang__
232
+ #pragma clang diagnostic pop
233
+ #endif
230
234
#else
231
235
return 0 ;
232
236
#endif
233
237
}
234
238
235
239
LONG InterlockedDecrement (LONG volatile * Addend )
236
240
{
237
- #ifdef __GNUC__
238
- #pragma GCC diagnostic push
239
- #pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
241
+ #if defined(__GNUC__ ) || defined(__clang__ )
242
+ #ifdef __clang__
243
+ #pragma clang diagnostic push
244
+ #pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
245
+ #endif
240
246
return __sync_sub_and_fetch (Addend , 1 );
241
- #pragma GCC diagnostic pop
247
+ #ifdef __clang__
248
+ #pragma clang diagnostic pop
249
+ #endif
242
250
#else
243
251
return 0 ;
244
252
#endif
245
253
}
246
254
247
255
LONG InterlockedExchange (LONG volatile * Target , LONG Value )
248
256
{
249
- #ifdef __GNUC__
250
- #pragma GCC diagnostic push
251
- #pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
257
+ #if defined(__GNUC__ ) || defined(__clang__ )
258
+ #ifdef __clang__
259
+ #pragma clang diagnostic push
260
+ #pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
261
+ #endif
252
262
return __sync_val_compare_and_swap (Target , * Target , Value );
263
+ #ifdef __clang__
264
+ #pragma clang diagnostic pop
265
+ #endif
253
266
#else
254
267
return 0 ;
255
268
#endif
256
269
}
257
270
258
271
LONG InterlockedExchangeAdd (LONG volatile * Addend , LONG Value )
259
272
{
260
- #ifdef __GNUC__
261
- #pragma GCC diagnostic push
262
- #pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
273
+ #if defined(__GNUC__ ) || defined(__clang__ )
274
+ #ifdef __clang__
275
+ #pragma clang diagnostic push
276
+ #pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
277
+ #endif
263
278
return __sync_fetch_and_add (Addend , Value );
264
- #pragma GCC diagnostic pop
279
+ #ifdef __clang__
280
+ #pragma clang diagnostic pop
281
+ #endif
265
282
#else
266
283
return 0 ;
267
284
#endif
268
285
}
269
286
270
287
LONG InterlockedCompareExchange (LONG volatile * Destination , LONG Exchange , LONG Comperand )
271
288
{
272
- #ifdef __GNUC__
273
- #pragma GCC diagnostic push
274
- #pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
289
+ #if defined(__GNUC__ ) || defined(__clang__ )
290
+ #ifdef __clang__
291
+ #pragma clang diagnostic push
292
+ #pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
293
+ #endif
275
294
return __sync_val_compare_and_swap (Destination , Comperand , Exchange );
276
- #pragma GCC diagnostic pop
295
+ #ifdef __clang__
296
+ #pragma clang diagnostic pop
297
+ #endif
277
298
#else
278
299
return 0 ;
279
300
#endif
@@ -282,11 +303,15 @@ LONG InterlockedCompareExchange(LONG volatile* Destination, LONG Exchange, LONG
282
303
PVOID InterlockedCompareExchangePointer (PVOID volatile * Destination , PVOID Exchange ,
283
304
PVOID Comperand )
284
305
{
285
- #ifdef __GNUC__
286
- #pragma GCC diagnostic push
287
- #pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
306
+ #if defined(__GNUC__ ) || defined(__clang__ )
307
+ #ifdef __clang__
308
+ #pragma clang diagnostic push
309
+ #pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
310
+ #endif
288
311
return __sync_val_compare_and_swap (Destination , Comperand , Exchange );
289
- #pragma GCC diagnostic pop
312
+ #ifdef __clang__
313
+ #pragma clang diagnostic pop
314
+ #endif
290
315
#else
291
316
return 0 ;
292
317
#endif
@@ -366,11 +391,15 @@ LONGLONG InterlockedCompareExchange64(LONGLONG volatile* Destination, LONGLONG E
366
391
LONGLONG InterlockedCompareExchange64 (LONGLONG volatile * Destination , LONGLONG Exchange ,
367
392
LONGLONG Comperand )
368
393
{
369
- #ifdef __GNUC__
370
- #pragma GCC diagnostic push
371
- #pragma GCC diagnostic ignored "-Watomic-implicit-seq-cst"
394
+ #if defined(__GNUC__ ) || defined(__clang__ )
395
+ #ifdef __clang__
396
+ #pragma clang diagnostic push
397
+ #pragma clang diagnostic ignored "-Watomic-implicit-seq-cst"
398
+ #endif
372
399
return __sync_val_compare_and_swap (Destination , Comperand , Exchange );
373
- #pragma GCC diagnostic pop
400
+ #ifdef __clang__
401
+ #pragma clang diagnostic pop
402
+ #endif
374
403
#else
375
404
return 0 ;
376
405
#endif
0 commit comments