From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by sourceware.org (Postfix) with ESMTPS id D1BB13856253 for ; Fri, 10 Jun 2022 20:11:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D1BB13856253 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mentovai.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentovai.com Received: by mail-qv1-xf2d.google.com with SMTP id q104so302681qvq.8 for ; Fri, 10 Jun 2022 13:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mentovai.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P9OQoWiqesUo8n8318ufYVhm7uVkmfw92gDABXxgWLI=; b=UsCDcbUPVwfvdoRsgzRDKjooGAKjxzDueOultIgO4IOCL+dEAW6JvxHhf6q29vcFbt YBd7kSj53SFSepBmJA67dbo2yTvRgKRqycJzVrAa86irM0+BuuINs2Dz2HsZEZuzRlHO xDNk9bpUxegPVIzVnOA3PL80mxH130TdTlyiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=P9OQoWiqesUo8n8318ufYVhm7uVkmfw92gDABXxgWLI=; b=ZJP/lbD5+RQfSKX9QxfYkujPGIJmHufKA+skcPztc0GnyWH9f1zakzLks0uo+d/C0/ 7xGO3cH3+x1QOKzd0RtXvZgdMQTaSB/+WL0qhlowdsvsd0/IOdguEjF2br2NKOcxEad3 lzg++1q/6NgQXDDgrK4yUqRzhZFTud4oXRc2O7IEmrbxlOUcFZZXUufce17r7B0iv55d z0tOfwMMjKwMY/bAwbPjpoEGt3IS9PXboDQQYGYowYd8655/qqH4lHY9/9hcxROIFrSX WcMPpOpzaB9T/Y3q8idVC0ZKTcRrXiAWhvMFYhojdFHC+UM6uJ9iQGFaLp8O38T0ucCy iB4A== X-Gm-Message-State: AOAM532mDV468KYSe7amf4clgVgqPbwRpTM1XzoiNFb3I9Moz4IArUvJ PaIZ+c7gnyPSADA3YReqXVyhSg== X-Google-Smtp-Source: ABdhPJwF9AzBw1iuhpZEmIPU98/0LjgtrzV7D1KLQ64T5ifR5+NF+r7/hvCbABa8GmUOT0dzSvgmFg== X-Received: by 2002:a05:6214:27ec:b0:46b:a37b:b2c9 with SMTP id jt12-20020a05621427ec00b0046ba37bb2c9mr20357981qvb.90.1654891916998; Fri, 10 Jun 2022 13:11:56 -0700 (PDT) Received: from redacted ([2620:0:1003:512:e086:7cce:acb8:ad0a]) by smtp.gmail.com with ESMTPSA id t21-20020a05620a451500b006a6a7e70211sm222262qkp.96.2022.06.10.13.11.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 13:11:56 -0700 (PDT) From: Mark Mentovai To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Cc: Jonathan Wakely , Iain Sandoe Subject: [PATCH] libstdc++: Rename __null_terminated to avoid collision with Apple SDK Date: Fri, 10 Jun 2022 16:11:45 -0400 Message-Id: <20220610201145.34747-1-mark@mentovai.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-16.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2022 20:12:04 -0000 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: Rename __null_terminated to __nul_terminated avoid colliding with a macro in Apple's SDK. Signed-off-by: Mark Mentovai --- 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 b0825ba76e80..19d246100cb5 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 @@ -459,11 +459,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 @@ -477,7 +477,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()); @@ -504,7 +504,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); -- 2.36.1