File tree Expand file tree Collapse file tree 26 files changed +598
-163
lines changed
Inputs/System/usr/include Expand file tree Collapse file tree 26 files changed +598
-163
lines changed Original file line number Diff line number Diff line change @@ -308,8 +308,7 @@ bool Module::directlyUses(const Module *Requested) {
308308 // Anyone is allowed to use our builtin stdarg.h and stddef.h and their
309309 // accompanying modules.
310310 if (Requested->getTopLevelModuleName () == " _Builtin_stdarg" ||
311- Requested->getTopLevelModuleName () == " _Builtin_stddef" ||
312- (!Requested->Parent && Requested->Name == " _Builtin_stddef_max_align_t" ))
311+ Requested->getTopLevelModuleName () == " _Builtin_stddef" )
313312 return true ;
314313
315314 if (NoUndeclaredIncludes)
Original file line number Diff line number Diff line change 1- /*===---- __stddef_max_align_t.h - Definition of max_align_t for modules ---===
1+ /*===---- __stddef_max_align_t.h - Definition of max_align_t ------------ ---===
22 *
33 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44 * See https://llvm.org/LICENSE.txt for license information.
Original file line number Diff line number Diff line change 77 *===-----------------------------------------------------------------------===
88 */
99
10+ #if !defined(NULL ) || !__has_feature (modules )
11+
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.
16+ */
1017#undef NULL
18+
1119#ifdef __cplusplus
1220#if !defined(__MINGW32__ ) && !defined(_MSC_VER )
1321#define NULL __null
1725#else
1826#define NULL ((void *)0)
1927#endif
28+
29+ #endif
Original file line number Diff line number Diff line change 77 *===-----------------------------------------------------------------------===
88 */
99
10- #if !defined(_NULLPTR_T) || __has_feature(modules)
11- /* Always define nullptr_t when modules are available. */
12- #if !__has_feature(modules)
10+ #ifndef _NULLPTR_T
1311#define _NULLPTR_T
14- # endif
12+
1513#ifdef __cplusplus
1614#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
1715namespace std {
1816typedef decltype (nullptr ) nullptr_t;
1917}
2018using ::std::nullptr_t ;
2119#endif
22- #else
20+ /* FIXME: This is using the placeholder dates Clang produces for these macros
21+ in C2x mode; switch to the correct values once they've been published. */
22+ #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L
2323typedef typeof (nullptr ) nullptr_t;
2424#endif
25+
2526#endif
Original file line number Diff line number Diff line change 77 *===-----------------------------------------------------------------------===
88 */
99
10- #if !defined(offsetof ) || __has_feature (modules )
11- /* Always define offsetof when modules are available. */
10+ #ifndef offsetof
1211#define offsetof (t , d ) __builtin_offsetof(t, d)
1312#endif
Original file line number Diff line number Diff line change 77 *===-----------------------------------------------------------------------===
88 */
99
10- #if !defined(_PTRDIFF_T ) || __has_feature (modules )
11- /* Always define ptrdiff_t when modules are available. */
12- #if !__has_feature (modules )
10+ #ifndef _PTRDIFF_T
1311#define _PTRDIFF_T
14- #endif
12+
1513typedef __PTRDIFF_TYPE__ ptrdiff_t ;
14+
1615#endif
Original file line number Diff line number Diff line change 77 *===-----------------------------------------------------------------------===
88 */
99
10- #if !defined(_RSIZE_T ) || __has_feature (modules )
11- /* Always define rsize_t when modules are available. */
12- #if !__has_feature (modules )
10+ #ifndef _RSIZE_T
1311#define _RSIZE_T
14- #endif
12+
1513typedef __SIZE_TYPE__ rsize_t ;
14+
1615#endif
Original file line number Diff line number Diff line change 77 *===-----------------------------------------------------------------------===
88 */
99
10- #if !defined(_SIZE_T ) || __has_feature (modules )
11- /* Always define size_t when modules are available. */
12- #if !__has_feature (modules )
10+ #ifndef _SIZE_T
1311#define _SIZE_T
14- #endif
12+
1513typedef __SIZE_TYPE__ size_t ;
14+
1615#endif
Original file line number Diff line number Diff line change 77 *===-----------------------------------------------------------------------===
88 */
99
10- #if !defined(unreachable ) || __has_feature (modules )
11- /* Always define unreachable when modules are available. */
10+ #ifndef unreachable
1211#define unreachable () __builtin_unreachable()
1312#endif
Original file line number Diff line number Diff line change 88 */
99
1010#if !defined(__cplusplus ) || (defined(_MSC_VER ) && !_NATIVE_WCHAR_T_DEFINED )
11- /* Always define wchar_t when modules are available. */
12- #if !defined(_WCHAR_T ) || __has_feature (modules )
13- #if !__has_feature (modules )
11+
12+ #ifndef _WCHAR_T
1413#define _WCHAR_T
15- #if defined(_MSC_EXTENSIONS )
14+
15+ #ifdef _MSC_EXTENSIONS
1616#define _WCHAR_T_DEFINED
1717#endif
18- #endif
18+
1919typedef __WCHAR_TYPE__ wchar_t ;
20+
2021#endif
22+
2123#endif
You can’t perform that action at this time.
0 commit comments