]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Rename _doprnt -> _bfd_doprnt to fix DJGPP bfd build (and likely others)
authorPedro Alves <palves@redhat.com>
Wed, 11 Oct 2017 11:47:25 +0000 (12:47 +0100)
committerAlan Modra <amodra@gmail.com>
Sun, 5 Nov 2017 09:01:43 +0000 (19:31 +1030)
Building bfd/ for DJGPP, I see:

 ../../src/bfd/bfd.c:642:1: error: conflicting types for '_doprnt'
  _doprnt (FILE *stream, const char *format, va_list ap)
  ^~~~~~~
 In file included from ../../src/bfd/sysdep.h:37:0,
  from ../../src/bfd/bfd.c:367:
 /usr/lib64/gcc/i586-pc-msdosdjgpp/6.1.0/include-fixed/stdio.h:171:5: note: previous declaration of '_doprnt' was here
  int _doprnt(const char *_fmt, va_list _args, FILE *_f);
      ^~~~~~~

Possible fixes the build on other systems too -- _doprnt was/is an
exported symbol on old Unix/BSD systems too.

bfd/ChangeLog:
2017-10-11  Pedro Alves  <palves@redhat.com>

* bfd.c (_doprnt): Rename to ...
(_bfd_doprnt): ... this.
(error_handler_internal): Adjust.

(cherry picked from commit 8f314ad58ec824ce6c8467af29f11583f79a80ea)

bfd/ChangeLog
bfd/bfd.c

index 97c4b1d9e88a768baf8566db54100c3154ed1938..991648b92a9c70b0381dd953f4bd7a99cc5ae079 100644 (file)
@@ -1,3 +1,11 @@
+2017-11-05  Alan Modra  <amodra@gmail.com>
+
+       Apply from master
+       2017-10-11  Pedro Alves  <palves@redhat.com>
+       * bfd.c (_doprnt): Rename to ...
+       (_bfd_doprnt): ... this.
+       (error_handler_internal): Adjust.
+
 2017-11-01  Alan Modra  <amodra@gmail.com>
 
        Apply from master
index 5da1a6fd53a7024bd037913d77e5ab603e4ef8fd..5c6e250a82fc8c53f350b57061766ce69422b0e1 100644 (file)
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -611,10 +611,11 @@ CODE_FRAGMENT
 
 static const char *_bfd_error_program_name;
 
-/* This macro and _doprnt taken from libiberty _doprnt.c, tidied a
-   little and extended to handle '%A' and '%B'.  'L' as a modifer for
-   integer formats is used for bfd_vma and bfd_size_type args, which
-   vary in size depending on BFD configuration.  */
+/* This macro and _bfd_doprnt (originally _doprint) taken from
+   libiberty _doprnt.c, tidied a little and extended to handle '%A'
+   and '%B'.  'L' as a modifer for integer formats is used for bfd_vma
+   and bfd_size_type args, which vary in size depending on BFD
+   configuration.  */
 
 #define PRINT_TYPE(TYPE) \
   do                                                           \
@@ -624,7 +625,7 @@ static const char *_bfd_error_program_name;
     } while (0)
 
 static int
-_doprnt (FILE *stream, const char *format, va_list ap)
+_bfd_doprnt (FILE *stream, const char *format, va_list ap)
 {
   const char *ptr = format;
   char specifier[128];
@@ -868,7 +869,7 @@ error_handler_internal (const char *fmt, va_list ap)
   else
     fprintf (stderr, "BFD: ");
 
-  _doprnt (stderr, fmt, ap);
+  _bfd_doprnt (stderr, fmt, ap);
 
   /* On AIX, putc is implemented as a macro that triggers a -Wunused-value
      warning, so use the fputc function to avoid it.  */