diff options
author | Alan Modra <amodra@gmail.com> | 2024-10-09 11:41:08 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2024-10-09 12:00:11 +1030 |
commit | 967dc35c78adb85ee1e2e596047d9dc69107a9db (patch) | |
tree | a1337458708dcc5c053038ffa5f3b17a74e92a5f | |
parent | df475bd53291a218cf681f1321888bb41f0a15c9 (diff) | |
download | binutils-967dc35c78adb85ee1e2e596047d9dc69107a9db.zip binutils-967dc35c78adb85ee1e2e596047d9dc69107a9db.tar.gz binutils-967dc35c78adb85ee1e2e596047d9dc69107a9db.tar.bz2 |
PR32243, NAME_MAX does not exist on mingw-w64 without _POSIX_
PR 32243
* dlltool.c: Move forward decls. Delete unnecessary ones.
(bfd_errmsg): Delete macro, define as inline function.
(PATHMAX): Delete.
(NAME_MAX): Define.
-rw-r--r-- | binutils/dlltool.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c index 9acd080..17e9416 100644 --- a/binutils/dlltool.c +++ b/binutils/dlltool.c @@ -271,16 +271,8 @@ #define PAGE_MASK ((bfd_vma) (- COFF_PAGE_SIZE)) #endif -/* Get current BFD error message. */ -#define bfd_get_errmsg() (bfd_errmsg (bfd_get_error ())) - -/* Forward references. */ -static char *look_for_prog (const char *, const char *, int); -static char *deduce_name (const char *); - -#ifdef DLLTOOL_MCORE_ELF -static void mcore_elf_cache_filename (const char *); -static void mcore_elf_gen_out_file (void); +#ifndef NAME_MAX +#define NAME_MAX 255 #endif #ifdef HAVE_SYS_WAIT_H @@ -483,9 +475,6 @@ static char * mcore_elf_linker_flags = NULL; #define DRECTVE_SECTION_NAME ".drectve" #endif -/* What's the right name for this ? */ -#define PATHMAX 250 - /* External name alias numbering starts here. */ #define PREFIX_ALIAS_BASE 20000 @@ -805,8 +794,9 @@ struct string_list static struct string_list *excludes; +/* Forward references. */ +static char *deduce_name (const char *); static const char *xlate (const char *); -static bfd *make_delay_head (void); static void dll_name_list_free_contents (dll_name_list_node_type *); static void identify_search_archive (bfd *, void (*) (bfd *, bfd *, void *), void *); @@ -814,6 +804,18 @@ static void identify_search_member (bfd *, bfd *, void *); static void identify_search_section (bfd *, asection *, void *); static void inform (const char *, ...) ATTRIBUTE_PRINTF_1; +#ifdef DLLTOOL_MCORE_ELF +static void mcore_elf_cache_filename (const char *); +static void mcore_elf_gen_out_file (void); +#endif + +/* Get current BFD error message. */ +static inline const char * +bfd_get_errmsg (void) +{ + return bfd_errmsg (bfd_get_error ()); +} + static char * prefix_encode (char *start, unsigned code) { @@ -2778,7 +2780,7 @@ make_head (void) return abfd; } -bfd * +static bfd * make_delay_head (void) { FILE *f = fopen (TMP_HEAD_S, FOPEN_WT); |