https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126782
--- Comment #5 from Bjorn Pagen <hello at bjornpagen dot com> --- USE_CLANG_STDDEF tells these SDK headers to obtain selected fundamental typedefs from the compiler-provided <stddef.h> rather than defining them directly in the SDK header. In this case, _rsize_t.h defines __need_rsize_t and includes <stddef.h>. Clang's <stddef.h> recognizes that request and defines: typedef __SIZE_TYPE__ rsize_t; GCC's <stddef.h> supports the same selective-inclusion pattern for types such as size_t, ptrdiff_t, and wchar_t, but it does not currently recognize __need_rsize_t. Consequently, the include returns without defining the type. This does not require GCC or the C library to implement all of Annex K. It only provides the rsize_t typedef when the system header explicitly requests it. For an ordinary full inclusion of <stddef.h>, it could continue to expose rsize_t only when __STDC_WANT_LIB_EXT1__ >= 1, matching Clang's behavior. I agree that supporting __need_rsize_t in GCC's <stddef.h> is preferable to a Darwin fixincludes rule, particularly because the SDK can be selected at build time.
