Fix interaction of max_align_t and modules.When building with modules enabled, we were defining max_align_t as a typedeffor a different anonymous struct type each time it was included, resulting i
Fix interaction of max_align_t and modules.When building with modules enabled, we were defining max_align_t as a typedeffor a different anonymous struct type each time it was included, resulting inan error if <stddef.h> is not covered by a module map and is included more thanonce in the same modules-enabled compilation of C11 or C++11 code.llvm-svn: 218931
show more ...
<rdar://problem/13479214> Make Clang's <stddef.h> robust against system headers defining size_t/ptrdiff_t/wchar_t.Clang's <stddef.h> provides definitions for the C standard librarytypes size_t, pt
<rdar://problem/13479214> Make Clang's <stddef.h> robust against system headers defining size_t/ptrdiff_t/wchar_t.Clang's <stddef.h> provides definitions for the C standard librarytypes size_t, ptrdiff_t, and wchar_t. However, the system's C standardlibrary headers tend to provide the same typedefs, and the twogenerally avoid each other using the macros_SIZE_T/_PTRDIFF_T/_WCHAR_T. With modules, however, we need to see*all* of the places where these types are defined, so provide thetypedefs (ignoring the macros) when modules are enabled.llvm-svn: 177686