xref: /freebsd/contrib/llvm-project/clang/lib/Headers/__stddef_nullptr_t.h (revision 439352ac8257c8419cb4a662abb7f260f31f9932)
15f757f3fSDimitry Andric /*===---- __stddef_nullptr_t.h - Definition of nullptr_t -------------------===
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*439352acSDimitry Andric /*
11*439352acSDimitry Andric  * When -fbuiltin-headers-in-system-modules is set this is a non-modular header
12*439352acSDimitry Andric  * and needs to behave as if it was textual.
13*439352acSDimitry Andric  */
14*439352acSDimitry Andric #if !defined(_NULLPTR_T) ||                                                    \
15*439352acSDimitry Andric     (__has_feature(modules) && !__building_module(_Builtin_stddef))
165f757f3fSDimitry Andric #define _NULLPTR_T
175f757f3fSDimitry Andric 
185f757f3fSDimitry Andric #ifdef __cplusplus
195f757f3fSDimitry Andric #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
205f757f3fSDimitry Andric namespace std {
215f757f3fSDimitry Andric typedef decltype(nullptr) nullptr_t;
225f757f3fSDimitry Andric }
235f757f3fSDimitry Andric using ::std::nullptr_t;
245f757f3fSDimitry Andric #endif
255f757f3fSDimitry Andric #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
265f757f3fSDimitry Andric typedef typeof(nullptr) nullptr_t;
275f757f3fSDimitry Andric #endif
285f757f3fSDimitry Andric 
295f757f3fSDimitry Andric #endif
30