diff options
author | Eli Bendersky <eliben@chromium.org> | 2013-07-15 16:08:08 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@chromium.org> | 2013-07-15 16:08:08 -0700 |
commit | e789858899a7b36caf11b371a97411a1582a482b (patch) | |
tree | e8c28b178b32010f73b477b3c65b5ff74437530c /lib/Headers/stddef.h | |
parent | 99a5501f5ae5b75017dfc386d4abf648234e85df (diff) | |
parent | 20c7d45a4da9f58ad805ad1d37f92fe7dc232ec8 (diff) |
Merge commit '20c7d45a4da9f58ad805ad1d37f92fe7dc232ec8'
Conflicts:
lib/CodeGen/ItaniumCXXABI.cpp
Diffstat (limited to 'lib/Headers/stddef.h')
-rw-r--r-- | lib/Headers/stddef.h | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/lib/Headers/stddef.h b/lib/Headers/stddef.h index ad5dc21fb0..6a64d6d32a 100644 --- a/lib/Headers/stddef.h +++ b/lib/Headers/stddef.h @@ -26,17 +26,42 @@ #ifndef __STDDEF_H #define __STDDEF_H -#ifndef _PTRDIFF_T +#if !defined(_PTRDIFF_T) || __has_feature(modules) +/* Always define ptrdiff_t when modules are available. */ +#if !__has_feature(modules) #define _PTRDIFF_T +#endif typedef __PTRDIFF_TYPE__ ptrdiff_t; #endif -#ifndef _SIZE_T + +#if !defined(_SIZE_T) || __has_feature(modules) +/* Always define size_t when modules are available. */ +#if !__has_feature(modules) #define _SIZE_T +#endif typedef __SIZE_TYPE__ size_t; #endif + +/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is + * enabled. */ +#if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \ + !defined(_RSIZE_T)) || __has_feature(modules) +/* Always define rsize_t when modules are available. */ +#if !__has_feature(modules) +#define _RSIZE_T +#endif +typedef __SIZE_TYPE__ rsize_t; +#endif + #ifndef __cplusplus -#ifndef _WCHAR_T +/* Always define wchar_t when modules are available. */ +#if !defined(_WCHAR_T) || __has_feature(modules) +#if !__has_feature(modules) #define _WCHAR_T +#if defined(_MSC_EXTENSIONS) +#define _WCHAR_T_DEFINED +#endif +#endif typedef __WCHAR_TYPE__ wchar_t; #endif #endif @@ -66,9 +91,12 @@ using ::std::nullptr_t; /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */ #if defined(__need_wint_t) -#if !defined(_WINT_T) +/* Always define wint_t when modules are available. */ +#if !defined(_WINT_T) || __has_feature(modules) +#if !__has_feature(modules) #define _WINT_T +#endif typedef __WINT_TYPE__ wint_t; -#endif /* _WINT_T */ +#endif #undef __need_wint_t #endif /* __need_wint_t */ |