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) {
308
308
// Anyone is allowed to use our builtin stdarg.h and stddef.h and their
309
309
// accompanying modules.
310
310
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" )
313
312
return true ;
314
313
315
314
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 ------------ ---===
2
2
*
3
3
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
* See https://llvm.org/LICENSE.txt for license information.
Original file line number Diff line number Diff line change 7
7
*===-----------------------------------------------------------------------===
8
8
*/
9
9
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
+ */
10
17
#undef NULL
18
+
11
19
#ifdef __cplusplus
12
20
#if !defined(__MINGW32__ ) && !defined(_MSC_VER )
13
21
#define NULL __null
17
25
#else
18
26
#define NULL ((void *)0)
19
27
#endif
28
+
29
+ #endif
Original file line number Diff line number Diff line change 7
7
*===-----------------------------------------------------------------------===
8
8
*/
9
9
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
13
11
#define _NULLPTR_T
14
- # endif
12
+
15
13
#ifdef __cplusplus
16
14
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
17
15
namespace std {
18
16
typedef decltype (nullptr ) nullptr_t;
19
17
}
20
18
using ::std::nullptr_t ;
21
19
#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
23
23
typedef typeof (nullptr ) nullptr_t;
24
24
#endif
25
+
25
26
#endif
Original file line number Diff line number Diff line change 7
7
*===-----------------------------------------------------------------------===
8
8
*/
9
9
10
- #if !defined(offsetof ) || __has_feature (modules )
11
- /* Always define offsetof when modules are available. */
10
+ #ifndef offsetof
12
11
#define offsetof (t , d ) __builtin_offsetof(t, d)
13
12
#endif
Original file line number Diff line number Diff line change 7
7
*===-----------------------------------------------------------------------===
8
8
*/
9
9
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
13
11
#define _PTRDIFF_T
14
- #endif
12
+
15
13
typedef __PTRDIFF_TYPE__ ptrdiff_t ;
14
+
16
15
#endif
Original file line number Diff line number Diff line change 7
7
*===-----------------------------------------------------------------------===
8
8
*/
9
9
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
13
11
#define _RSIZE_T
14
- #endif
12
+
15
13
typedef __SIZE_TYPE__ rsize_t ;
14
+
16
15
#endif
Original file line number Diff line number Diff line change 7
7
*===-----------------------------------------------------------------------===
8
8
*/
9
9
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
13
11
#define _SIZE_T
14
- #endif
12
+
15
13
typedef __SIZE_TYPE__ size_t ;
14
+
16
15
#endif
Original file line number Diff line number Diff line change 7
7
*===-----------------------------------------------------------------------===
8
8
*/
9
9
10
- #if !defined(unreachable ) || __has_feature (modules )
11
- /* Always define unreachable when modules are available. */
10
+ #ifndef unreachable
12
11
#define unreachable () __builtin_unreachable()
13
12
#endif
Original file line number Diff line number Diff line change 8
8
*/
9
9
10
10
#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
14
13
#define _WCHAR_T
15
- #if defined(_MSC_EXTENSIONS )
14
+
15
+ #ifdef _MSC_EXTENSIONS
16
16
#define _WCHAR_T_DEFINED
17
17
#endif
18
- #endif
18
+
19
19
typedef __WCHAR_TYPE__ wchar_t ;
20
+
20
21
#endif
22
+
21
23
#endif
You can’t perform that action at this time.
0 commit comments