diff options
Diffstat (limited to 'bfd/bfd-in.h')
-rw-r--r-- | bfd/bfd-in.h | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 453ac48..fda9fe0 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -56,15 +56,7 @@ extern "C" { comma and then the length of the string. Doing this by hand is error prone, so using this macro is safer. */ #define STRING_COMMA_LEN(STR) (STR), (sizeof (STR) - 1) -/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro - to create the arguments to another macro, since the preprocessor - will mis-count the number of arguments to the outer macro (by not - evaluating STRING_COMMA_LEN and so missing the comma). This is a - problem for example when trying to use STRING_COMMA_LEN to build - the arguments to the strncmp() macro. Hence this alternative - definition of strncmp is provided here. - - Note - these macros do NOT work if STR2 is not a constant string. */ + /* 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 @@ -72,7 +64,6 @@ extern "C" { #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 @@ -571,4 +562,3 @@ startswith (const char *str, const char *prefix) { return strncmp (str, prefix, strlen (prefix)) == 0; } -#define CONST_STRNEQ(STR1,STR2) startswith (STR1, STR2) |