Skip to content

Commit 254e88b

Browse files
markmentovaijwakely
authored andcommitted
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>
1 parent 30cc1b6 commit 254e88b

File tree

1 file changed

+6
-6
lines changed
  • libstdc++-v3/include/experimental/bits

1 file changed

+6
-6
lines changed

libstdc++-v3/include/experimental/bits/fs_path.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,10 @@ namespace __detail
140140
inline _Source
141141
_S_range_begin(_Source __begin) { return __begin; }
142142

143-
struct __null_terminated { };
143+
struct __nul_terminated { };
144144

145145
template<typename _Source>
146-
inline __null_terminated
146+
inline __nul_terminated
147147
_S_range_end(_Source) { return {}; }
148148

149149
template<typename _CharT, typename _Traits, typename _Alloc>
@@ -459,11 +459,11 @@ namespace __detail
459459
struct _Cvt;
460460

461461
static string_type
462-
_S_convert(value_type* __src, __detail::__null_terminated)
462+
_S_convert(value_type* __src, __detail::__nul_terminated)
463463
{ return string_type(__src); }
464464

465465
static string_type
466-
_S_convert(const value_type* __src, __detail::__null_terminated)
466+
_S_convert(const value_type* __src, __detail::__nul_terminated)
467467
{ return string_type(__src); }
468468

469469
template<typename _Iter>
@@ -477,7 +477,7 @@ namespace __detail
477477

478478
template<typename _InputIterator>
479479
static string_type
480-
_S_convert(_InputIterator __src, __detail::__null_terminated)
480+
_S_convert(_InputIterator __src, __detail::__nul_terminated)
481481
{
482482
auto __s = _S_string_from_iter(__src);
483483
return _S_convert(__s.c_str(), __s.c_str() + __s.size());
@@ -504,7 +504,7 @@ namespace __detail
504504

505505
template<typename _InputIterator>
506506
static string_type
507-
_S_convert_loc(_InputIterator __src, __detail::__null_terminated,
507+
_S_convert_loc(_InputIterator __src, __detail::__nul_terminated,
508508
const std::locale& __loc)
509509
{
510510
const std::string __s = _S_string_from_iter(__src);

0 commit comments

Comments
 (0)