From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 476DD3856266; Wed, 15 Jun 2022 08:15:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 476DD3856266 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r10-10842] libstdc++: Rename __null_terminated to avoid collision with Apple SDK X-Act-Checkin: gcc X-Git-Author: Mark Mentovai X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: 6b59f8acada4858f5dd532185a0030cf79163247 X-Git-Newrev: 7137ae4051ae71bb7fc7fd59d956952c53403239 Message-Id: <20220615081505.476DD3856266@sourceware.org> Date: Wed, 15 Jun 2022 08:15:05 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2022 08:15:05 -0000 https://gcc.gnu.org/g:7137ae4051ae71bb7fc7fd59d956952c53403239 commit r10-10842-g7137ae4051ae71bb7fc7fd59d956952c53403239 Author: Mark Mentovai Date: Mon Jun 13 16:40:19 2022 +0100 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 : 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 (cherry picked from commit 254e88b3d7e8abcc236be3451609834371cf4d5d) Diff: --- libstdc++-v3/include/experimental/bits/fs_path.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h index 0a8f4eee0a1..11b4ce0fe58 100644 --- a/libstdc++-v3/include/experimental/bits/fs_path.h +++ b/libstdc++-v3/include/experimental/bits/fs_path.h @@ -140,10 +140,10 @@ namespace __detail inline _Source _S_range_begin(_Source __begin) { return __begin; } - struct __null_terminated { }; + struct __nul_terminated { }; template - inline __null_terminated + inline __nul_terminated _S_range_end(_Source) { return {}; } template @@ -467,11 +467,11 @@ namespace __detail struct _Cvt; static string_type - _S_convert(value_type* __src, __detail::__null_terminated) + _S_convert(value_type* __src, __detail::__nul_terminated) { return string_type(__src); } static string_type - _S_convert(const value_type* __src, __detail::__null_terminated) + _S_convert(const value_type* __src, __detail::__nul_terminated) { return string_type(__src); } template @@ -485,7 +485,7 @@ namespace __detail template static string_type - _S_convert(_InputIterator __src, __detail::__null_terminated) + _S_convert(_InputIterator __src, __detail::__nul_terminated) { auto __s = _S_string_from_iter(__src); return _S_convert(__s.c_str(), __s.c_str() + __s.size()); @@ -505,7 +505,7 @@ namespace __detail template static string_type - _S_convert_loc(_InputIterator __src, __detail::__null_terminated, + _S_convert_loc(_InputIterator __src, __detail::__nul_terminated, const std::locale& __loc) { const std::string __s = _S_string_from_iter(__src);