Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libc++] Remove use of internal glibc macros to determine if c8rtomb(…
…) and mbrtoc8() are present. When support for declaring the c8rtomb() and mbrtoc8() functions within the std namespace was added in commit 7e7013c, internal glibc macros were used to determine if C2X extensions are enabled. Specifically, a check for whether `__GLIBC_USE` is defined and whether `__GLIBC_USE(ISOC2X)` is non-0 was added. `__GLIBC_USE` is an internal detail of the glibc implementation that may be changed or removed in the future potentially leading to inconsistency or compilation failures. This change removes the use of the internal glibc macro to avoid such problems. Unfortunately, without another mechanism to determine if C2X extensions are enabled, this removal will result in inconsistent declarations of the c8rtomb() and mbrtoc8() functions; when C++ char8_t support is not enabled, but C2X extensions are, these functions will be declared in the global namespace but not in the std namespace. This situation will improve when C23 support is finalized and the check can be re-implemented using `__STDC_VERSION__`.
- Loading branch information