aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Matsui <kmatsui@gcc.gnu.org>2023-07-18 15:24:50 -0700
committerKen Matsui <kmatsui@gcc.gnu.org>2023-09-11 08:11:24 -0700
commit286655d04678cb61dee9cac43b139571247c4ad1 (patch)
tree97b3993ab85c949a470bacbd4936d539c4de0f74
parentaf91934c2f6b8efc67d625c99068b4761ae5edd0 (diff)
downloadgcc-286655d04678cb61dee9cac43b139571247c4ad1.zip
gcc-286655d04678cb61dee9cac43b139571247c4ad1.tar.gz
gcc-286655d04678cb61dee9cac43b139571247c4ad1.tar.bz2
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 <kmatsui@gcc.gnu.org> Reviewed-by: Patrick Palka <ppalka@redhat.com> Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
-rw-r--r--libstdc++-v3/include/bits/c++config10
1 files changed, 9 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 0a41cdd..410c136 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)