Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 1 | /*===-- atomic_flag_clear_explicit.c ----------------------------------------=== |
| 2 | * |
| 3 | * The LLVM Compiler Infrastructure |
| 4 | * |
| 5 | * This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | * Source Licenses. See LICENSE.TXT for details. |
| 7 | * |
| 8 | *===------------------------------------------------------------------------=== |
| 9 | * |
| 10 | * This file implements atomic_flag_clear_explicit from C11's stdatomic.h. |
| 11 | * |
| 12 | *===------------------------------------------------------------------------=== |
| 13 | */ |
| 14 | |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 15 | #ifndef __has_include |
| 16 | #define __has_include(inc) 0 |
| 17 | #endif |
| 18 | |
| 19 | #if __has_include(<stdatomic.h>) |
| 20 | |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 21 | #include <stdatomic.h> |
| 22 | #undef atomic_flag_clear_explicit |
| 23 | void atomic_flag_clear_explicit(volatile atomic_flag *object, |
| 24 | memory_order order) { |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 25 | __c11_atomic_store(&(object)->_Value, 0, order); |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 26 | } |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 27 | |
| 28 | #endif |