diff options
author | Martin Liska <mliska@suse.cz> | 2021-03-23 09:06:36 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-03-23 09:22:43 +0100 |
commit | 81a26466d86482ed39ad3be1ed786f9ac3a86e42 (patch) | |
tree | 136c5b5be36700d391cd58ba00f09aaa9e0608f7 | |
parent | 70e958370c8f4dc3222b658a725571d8d2f5f98a (diff) | |
download | binutils-gdb-81a26466d86482ed39ad3be1ed786f9ac3a86e42.tar.gz |
Add str-util.h.
-rw-r--r-- | bfd/bfd-in.h | 8 | ||||
-rw-r--r-- | bfd/bfd-in2.h | 8 | ||||
-rw-r--r-- | bfd/sysdep.h | 2 | ||||
-rw-r--r-- | binutils/sysdep.h | 2 | ||||
-rw-r--r-- | gas/as.h | 2 | ||||
-rw-r--r-- | gdbsupport/common-utils.h | 2 | ||||
-rw-r--r-- | ld/sysdep.h | 2 | ||||
-rw-r--r-- | opcodes/sysdep.h | 2 |
8 files changed, 12 insertions, 16 deletions
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index fda9fe0198e..92391bb6a34 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -554,11 +554,3 @@ struct ecoff_debug_swap; struct ecoff_extr; struct bfd_link_info; struct bfd_link_hash_entry; - -/* Return TRUE if the start of STR matches PREFIX, FALSE otherwise. */ - -static inline bfd_boolean -startswith (const char *str, const char *prefix) -{ - return strncmp (str, prefix, strlen (prefix)) == 0; -} diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 8874da88afd..5084c022938 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -561,14 +561,6 @@ struct ecoff_debug_swap; struct ecoff_extr; struct bfd_link_info; struct bfd_link_hash_entry; - -/* Return TRUE if the start of STR matches PREFIX, FALSE otherwise. */ - -static inline bfd_boolean -startswith (const char *str, const char *prefix) -{ - return strncmp (str, prefix, strlen (prefix)) == 0; -} /* Extracted from init.c. */ unsigned int bfd_init (void); diff --git a/bfd/sysdep.h b/bfd/sysdep.h index 338d7311125..b04847ffc38 100644 --- a/bfd/sysdep.h +++ b/bfd/sysdep.h @@ -119,6 +119,8 @@ extern char *strrchr (); #include "filenames.h" +#include "str-util.h" + #if !HAVE_DECL_FFS extern int ffs (int); #endif diff --git a/binutils/sysdep.h b/binutils/sysdep.h index 183bb016538..022029a3f9b 100644 --- a/binutils/sysdep.h +++ b/binutils/sysdep.h @@ -78,6 +78,8 @@ extern char *strrchr (); #include "binary-io.h" +#include "str-util.h" + #if !HAVE_DECL_STPCPY extern char *stpcpy (char *, const char *); #endif @@ -97,6 +97,8 @@ /* Define the standard progress macros. */ #include "progress.h" +#include "str-util.h" + /* Other stuff from config.h. */ #ifdef NEED_DECLARATION_ENVIRON extern char **environ; diff --git a/gdbsupport/common-utils.h b/gdbsupport/common-utils.h index 1de747f186d..65569ffe788 100644 --- a/gdbsupport/common-utils.h +++ b/gdbsupport/common-utils.h @@ -45,6 +45,8 @@ #include "gdb_string_view.h" +#include "str-util.h" + /* xmalloc(), xrealloc() and xcalloc() have already been declared in "libiberty.h". */ diff --git a/ld/sysdep.h b/ld/sysdep.h index 206c02c8c5e..9e97d2d95ba 100644 --- a/ld/sysdep.h +++ b/ld/sysdep.h @@ -68,6 +68,8 @@ extern char *strrchr (); #include "fopen-same.h" #endif +#include "str-util.h" + #ifdef HAVE_FCNTL_H #include <fcntl.h> #else diff --git a/opcodes/sysdep.h b/opcodes/sysdep.h index bcac6d851c5..a0732861b7c 100644 --- a/opcodes/sysdep.h +++ b/opcodes/sysdep.h @@ -52,6 +52,8 @@ #endif #endif +#include "str-util.h" + #if !HAVE_DECL_STPCPY extern char *stpcpy (char *__dest, const char *__src); #endif |