[clang-format] Fix a bug in aligning comments above PPDirective (#72791)
[llvm-project.git] / clang / lib / Headers / __stddef_null.h
blob7336fdab389723d0277acc4f11d30253ab96fd8a
1 /*===---- __stddef_null.h - Definition of NULL -----------------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
8 */
10 #if !defined(NULL) || !__has_feature(modules)
12 /* linux/stddef.h will define NULL to 0. glibc (and other) headers then define
13 * __need_NULL and rely on stddef.h to redefine NULL to the correct value again.
14 * Modules don't support redefining macros like that, but support that pattern
15 * in the non-modules case.
17 #undef NULL
19 #ifdef __cplusplus
20 #if !defined(__MINGW32__) && !defined(_MSC_VER)
21 #define NULL __null
22 #else
23 #define NULL 0
24 #endif
25 #else
26 #define NULL ((void*)0)
27 #endif
29 #endif