From 57ae980e3290c0c1a9fb4a93144cc5b24457f05a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 31 Mar 2021 10:02:08 +1030 Subject: Include string.h in bfd.h and delete LITMEMCPY, LITSTRCPY This fixes the issue that startswith depends on strncpy being declared, and not all projects using bfd.h include string.h before bfd.h. I've also deleted some macros that don't find much use anywhere. bfd/ * bfd-in.h: Include string.h. (LITMEMCPY, LITSTRCPY): Delete. * bfd-in2.h: Regenerate. binutils/ * prdbg.c (pr_function_type): Replace LITSTTCPY with strcpy. --- bfd/bfd-in.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'bfd/bfd-in.h') diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index fda9fe0..f90f718 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -37,6 +37,7 @@ extern "C" { #include "bfd_stdint.h" #include "diagnostics.h" #include +#include #include #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE) @@ -57,13 +58,6 @@ extern "C" { is error prone, so using this macro is safer. */ #define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1) - /* strcpy() can have a similar problem, but since we know we are - copying a constant string, we can use memcpy which will be faster - since there is no need to check for a NUL byte inside STR. We - can also save time if we do not need to copy the terminating NUL. */ -#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1) -#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2)) - #define BFD_SUPPORTS_PLUGINS @supports_plugins@ /* The word size used by BFD on the host. This may be 64 with a 32 -- cgit v1.1