libstdc++: Rename __null_terminated to avoid collision with Apple SDK
authorMark Mentovai <mark@mentovai.com>
Mon, 13 Jun 2022 15:40:19 +0000 (16:40 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 14 Jun 2022 19:28:14 +0000 (20:28 +0100)
commitd1201dbf55a11d391030914985ba6b443e59baa5
tree6147b11044f07559837bba387bb43e36ca796cc3
parent4b06b7304066fb1016e017d15e189f2e745dceae
libstdc++: Rename __null_terminated to avoid collision with Apple SDK

The macOS 13 SDK (and equivalent-version iOS and other Apple OS SDKs)
contain this definition in <sys/cdefs.h>:

863  #define __null_terminated

This collides with the use of __null_terminated in libstdc++'s
experimental fs_path.h.

As libstdc++'s use of this token is entirely internal to fs_path.h, the
simplest workaround, renaming it, is most appropriate. Here, it's
renamed to __nul_terminated, referencing the NUL ('\0') value that is
used to terminate the strings in the context in which this tag structure
is used.

libstdc++-v3/ChangeLog:

* include/experimental/bits/fs_path.h (__detail::__null_terminated):
Rename to __nul_terminated to avoid colliding with a macro in
Apple's SDK.

Signed-off-by: Mark Mentovai <mark@mentovai.com>
(cherry picked from commit 254e88b3d7e8abcc236be3451609834371cf4d5d)
libstdc++-v3/include/experimental/bits/fs_path.h