xref: /freebsd/contrib/llvm-project/clang/lib/Headers/__stddef_unreachable.h (revision dfa39133b333f57ca3133bf6c71cd75be4c3e801)
15f757f3fSDimitry Andric /*===---- __stddef_unreachable.h - Definition of unreachable ---------------===
25f757f3fSDimitry Andric  *
35f757f3fSDimitry Andric  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45f757f3fSDimitry Andric  * See https://llvm.org/LICENSE.txt for license information.
55f757f3fSDimitry Andric  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65f757f3fSDimitry Andric  *
75f757f3fSDimitry Andric  *===-----------------------------------------------------------------------===
85f757f3fSDimitry Andric  */
95f757f3fSDimitry Andric 
10*dfa39133SDimitry Andric #ifndef __cplusplus
11*dfa39133SDimitry Andric 
12439352acSDimitry Andric /*
13439352acSDimitry Andric  * When -fbuiltin-headers-in-system-modules is set this is a non-modular header
14439352acSDimitry Andric  * and needs to behave as if it was textual.
15439352acSDimitry Andric  */
16439352acSDimitry Andric #if !defined(unreachable) ||                                                   \
17439352acSDimitry Andric     (__has_feature(modules) && !__building_module(_Builtin_stddef))
185f757f3fSDimitry Andric #define unreachable() __builtin_unreachable()
195f757f3fSDimitry Andric #endif
20*dfa39133SDimitry Andric 
21*dfa39133SDimitry Andric #endif
22