/* Shared general utility routines for GDB, the GNU debugger.
- Copyright (C) 1986-2020 Free Software Foundation, Inc.
+ Copyright (C) 1986-2021 Free Software Foundation, Inc.
This file is part of GDB.
data type. Use operator delete instead.");
if (ptr != NULL)
- free (ptr); /* ARI: free */
+#ifdef GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::free (ptr); /* ARI: free */
+#else
+ free (ptr); /* ARI: free */
+#endif
}
extern const char *safe_strerror (int);
-/* Return true if the start of STRING matches PATTERN, false otherwise. */
-
-static inline bool
-startswith (const char *string, const char *pattern)
-{
- return strncmp (string, pattern, strlen (pattern)) == 0;
-}
-
-/* Version of startswith that takes string_view arguments. See comment
- above. */
+/* Version of startswith that takes string_view arguments. Return
+ true if the start of STRING matches PATTERN, false otherwise. */
static inline bool
startswith (gdb::string_view string, gdb::string_view pattern)
freeing all the elements. */
extern void free_vector_argv (std::vector<char *> &v);
-/* Given a vector of arguments ARGV, return a string equivalent to
- joining all the arguments with a whitespace separating them. */
-extern std::string stringify_argv (const std::vector<char *> &argv);
-
/* Return true if VALUE is in [LOW, HIGH]. */
template <typename T>
return value >= low && value <= high;
}
-/* Ensure that V is aligned to an N byte boundary (B's assumed to be a
+/* Ensure that V is aligned to an N byte boundary (N's assumed to be a
power of 2). Round up/down when necessary. Examples of correct
use include: