]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: move RequireLongest to gdbsupport/traits.h
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 22 Apr 2024 20:10:15 +0000 (16:10 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 23 Apr 2024 01:34:19 +0000 (21:34 -0400)
Move it out of defs.h.

Change-Id: Ie1743d41a57f81667650048563e66073c72230cf
Approved-By: John Baldwin <jhb@FreeBSD.org>
gdb/defs.h
gdb/extract-store-integer.h
gdb/regcache.h
gdbsupport/traits.h

index 5da8ce7281533f135f7bdd1d07413a2c6a85abc1..535ca671673248751595fd3ca9d71d6b604c87cf 100644 (file)
 #include "gdbsupport/enum-flags.h"
 #include "gdbsupport/array-view.h"
 
-template<typename T>
-using RequireLongest = gdb::Requires<gdb::Or<std::is_same<T, LONGEST>,
-                                            std::is_same<T, ULONGEST>>>;
-
 /* Just in case they're not defined in stdio.h.  */
 
 #ifndef SEEK_SET
index 1ba5f82da9a739ff50c47e5e2639322e508a8b9b..fd195dc6436270fc51d5dcc4e8bb79736f566097 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef GDB_EXTRACT_STORE_INTEGER_H
 #define GDB_EXTRACT_STORE_INTEGER_H
 
+#include "gdbsupport/traits.h"
+
 template<typename T, typename = RequireLongest<T>>
 T extract_integer (gdb::array_view<const gdb_byte>, enum bfd_endian byte_order);
 
index 1d049fe7ae8de794197076f9ede74fe8b9ab9ff4..2f4b7d94c69344bbe9d2f5b716874fc47c6720c4 100644 (file)
@@ -23,6 +23,7 @@
 #include "gdbsupport/array-view.h"
 #include "gdbsupport/common-regcache.h"
 #include "gdbsupport/function-view.h"
+#include "gdbsupport/traits.h"
 
 struct regcache;
 struct regset;
index 92fe59f34af726de5c389c8d2de87b0873f81f86..85cbc94bc6c952f797fc904db31d07ce3599c9d8 100644 (file)
@@ -143,4 +143,8 @@ template<typename Condition>
 using Requires = typename std::enable_if<Condition::value, void>::type;
 }
 
+template<typename T>
+using RequireLongest = gdb::Requires<gdb::Or<std::is_same<T, LONGEST>,
+                                            std::is_same<T, ULONGEST>>>;
+
 #endif /* COMMON_TRAITS_H */