1*0ba22f51SPetr Hosek //===-- atomic_thread_fence.c ---------------------------------------------===// 2*0ba22f51SPetr Hosek // 3*0ba22f51SPetr Hosek // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0ba22f51SPetr Hosek // See https://llvm.org/LICENSE.txt for license information. 5*0ba22f51SPetr Hosek // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0ba22f51SPetr Hosek // 7*0ba22f51SPetr Hosek //===----------------------------------------------------------------------===// 8*0ba22f51SPetr Hosek // 9*0ba22f51SPetr Hosek // This file implements atomic_thread_fence from C11's stdatomic.h. 10*0ba22f51SPetr Hosek // 11*0ba22f51SPetr Hosek //===----------------------------------------------------------------------===// 12fa752593SJustin Bogner 130a9466c1SChris Bieneman #ifndef __has_include 140a9466c1SChris Bieneman #define __has_include(inc) 0 150a9466c1SChris Bieneman #endif 160a9466c1SChris Bieneman 177908b129SChris Bieneman #if __has_include(<stdatomic.h>) 187908b129SChris Bieneman 19fa752593SJustin Bogner #include <stdatomic.h> 20fa752593SJustin Bogner #undef atomic_thread_fence atomic_thread_fence(memory_order order)21fa752593SJustin Bognervoid atomic_thread_fence(memory_order order) { 22fa752593SJustin Bogner __c11_atomic_thread_fence(order); 23fa752593SJustin Bogner } 247908b129SChris Bieneman 257908b129SChris Bieneman #endif 26