summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Mentovai <mark@mentovai.com>2022-06-13 16:40:19 +0100
committerJonathan Wakely <jwakely@redhat.com>2022-06-14 20:28:14 +0100
commitd1201dbf55a11d391030914985ba6b443e59baa5 (patch)
tree6147b11044f07559837bba387bb43e36ca796cc3
parentx86: Require AVX for F16C and VAES (diff)
downloadgcc-d1201dbf55a11d391030914985ba6b443e59baa5.tar.gz
gcc-d1201dbf55a11d391030914985ba6b443e59baa5.tar.bz2
gcc-d1201dbf55a11d391030914985ba6b443e59baa5.tar.xz
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)
-rw-r--r--libstdc++-v3/include/experimental/bits/fs_path.h12
1 files 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 b0825ba76e8..19d246100cb 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
140 inline _Source 140 inline _Source
141 _S_range_begin(_Source __begin) { return __begin; } 141 _S_range_begin(_Source __begin) { return __begin; }
142 142
143 struct __null_terminated { }; 143 struct __nul_terminated { };
144 144
145 template<typename _Source> 145 template<typename _Source>
146 inline __null_terminated 146 inline __nul_terminated
147 _S_range_end(_Source) { return {}; } 147 _S_range_end(_Source) { return {}; }
148 148
149 template<typename _CharT, typename _Traits, typename _Alloc> 149 template<typename _CharT, typename _Traits, typename _Alloc>
@@ -459,11 +459,11 @@ namespace __detail
459 struct _Cvt; 459 struct _Cvt;
460 460
461 static string_type 461 static string_type
462 _S_convert(value_type* __src, __detail::__null_terminated) 462 _S_convert(value_type* __src, __detail::__nul_terminated)
463 { return string_type(__src); } 463 { return string_type(__src); }
464 464
465 static string_type 465 static string_type
466 _S_convert(const value_type* __src, __detail::__null_terminated) 466 _S_convert(const value_type* __src, __detail::__nul_terminated)
467 { return string_type(__src); } 467 { return string_type(__src); }
468 468
469 template<typename _Iter> 469 template<typename _Iter>
@@ -477,7 +477,7 @@ namespace __detail
477 477
478 template<typename _InputIterator> 478 template<typename _InputIterator>
479 static string_type 479 static string_type
480 _S_convert(_InputIterator __src, __detail::__null_terminated) 480 _S_convert(_InputIterator __src, __detail::__nul_terminated)
481 { 481 {
482 auto __s = _S_string_from_iter(__src); 482 auto __s = _S_string_from_iter(__src);
483 return _S_convert(__s.c_str(), __s.c_str() + __s.size()); 483 return _S_convert(__s.c_str(), __s.c_str() + __s.size());
@@ -504,7 +504,7 @@ namespace __detail
504 504
505 template<typename _InputIterator> 505 template<typename _InputIterator>
506 static string_type 506 static string_type
507 _S_convert_loc(_InputIterator __src, __detail::__null_terminated, 507 _S_convert_loc(_InputIterator __src, __detail::__nul_terminated,
508 const std::locale& __loc) 508 const std::locale& __loc)
509 { 509 {
510 const std::string __s = _S_string_from_iter(__src); 510 const std::string __s = _S_string_from_iter(__src);