From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7934) id D41673858D38; Mon, 11 Sep 2023 15:11:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D41673858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694445093; bh=iFzXRD5H9HXSjt9kv3olxhUEIkY2vgGx2a2jhF2nO0U=; h=From:To:Subject:Date:From; b=SN0KM2YukrcOs6FbAbqAvF3jI5RmHZKvQHgG2FrE6fFltfdA/S86o5cZ3AZSas2A8 YBFf+1bncTUfeEka/xzt6NoXYtgGTraBbTTMv8NCRP1uSpjk5kwpDVPyzdRdjmFUiZ JDoJPkGBIZcAFgHNpuvxcY/JKzrUYqBcZZR6xtEk= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Ken Matsui To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-3844] libstdc++: Define _GLIBCXX_USE_BUILTIN_TRAIT X-Act-Checkin: gcc X-Git-Author: Ken Matsui X-Git-Refname: refs/heads/master X-Git-Oldrev: af91934c2f6b8efc67d625c99068b4761ae5edd0 X-Git-Newrev: 286655d04678cb61dee9cac43b139571247c4ad1 Message-Id: <20230911151133.D41673858D38@sourceware.org> Date: Mon, 11 Sep 2023 15:11:33 +0000 (GMT) List-Id: https://gcc.gnu.org/g:286655d04678cb61dee9cac43b139571247c4ad1 commit r14-3844-g286655d04678cb61dee9cac43b139571247c4ad1 Author: Ken Matsui Date: Tue Jul 18 15:24:50 2023 -0700 libstdc++: Define _GLIBCXX_USE_BUILTIN_TRAIT This patch defines _GLIBCXX_USE_BUILTIN_TRAIT macro, which will be used as a flag to toggle the use of built-in traits in the type_traits header through _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS macro, without needing to modify the source code. libstdc++-v3/ChangeLog: * include/bits/c++config (_GLIBCXX_HAS_BUILTIN): Do not undef. (_GLIBCXX_USE_BUILTIN_TRAIT): Define. Signed-off-by: Ken Matsui Reviewed-by: Patrick Palka Reviewed-by: Jonathan Wakely Diff: --- libstdc++-v3/include/bits/c++config | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 0a41cdd29a9a..410c136e1b11 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -854,7 +854,15 @@ namespace __gnu_cxx # define _GLIBCXX_HAVE_BUILTIN_LAUNDER 1 #endif -#undef _GLIBCXX_HAS_BUILTIN +// Returns 1 if _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS is not defined and the +// compiler has a corresponding built-in type trait, 0 otherwise. +// _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS can be defined to disable the use of +// built-in traits. +#ifndef _GLIBCXX_DO_NOT_USE_BUILTIN_TRAITS +# define _GLIBCXX_USE_BUILTIN_TRAIT(BT) _GLIBCXX_HAS_BUILTIN(BT) +#else +# define _GLIBCXX_USE_BUILTIN_TRAIT(BT) 0 +#endif // Mark code that should be ignored by the compiler, but seen by Doxygen. #define _GLIBCXX_DOXYGEN_ONLY(X)