VA_CLOSE.
(non_fatal): Likewise.
* objdump.c (objdump_sprintf): Likewise.
* readelf.c (error): Likewise.
(warn): Likewise.
+2001-09-26 Alan Modra <amodra@bigpond.net.au>
+
+ * bucomm.c (fatal): Define using VPARAMS, VA_OPEN, VA_FIXEDARG,
+ VA_CLOSE.
+ (non_fatal): Likewise.
+ * objdump.c (objdump_sprintf): Likewise.
+ * readelf.c (error): Likewise.
+ (warn): Likewise.
+
2001-09-25 Jakub Jelinek <jakub@redhat.com>
* readelf.c (do_wide): New.
putc ('\n', stderr);
}
-#ifdef ANSI_PROTOTYPES
void
-fatal (const char *format, ...)
+fatal VPARAMS ((const char *format, ...))
{
- va_list args;
+ VA_OPEN (args, format);
+ VA_FIXEDARG (args, const char *, format);
- va_start (args, format);
report (format, args);
- va_end (args);
+ VA_CLOSE (args);
xexit (1);
}
void
-non_fatal (const char *format, ...)
+non_fatal VPARAMS ((const char *format, ...))
{
- va_list args;
+ VA_OPEN (args, format);
+ VA_FIXEDARG (args, const char *, format);
- va_start (args, format);
report (format, args);
- va_end (args);
+ VA_CLOSE (args);
}
-#else
-void
-fatal (va_alist)
- va_dcl
-{
- char *Format;
- va_list args;
-
- va_start (args);
- Format = va_arg (args, char *);
- report (Format, args);
- va_end (args);
- xexit (1);
-}
-
-void
-non_fatal (va_alist)
- va_dcl
-{
- char *Format;
- va_list args;
-
- va_start (args);
- Format = va_arg (args, char *);
- report (Format, args);
- va_end (args);
-}
-#endif
/* Set the default BFD target based on the configured target. Doing
this permits the binutils to be configured for a particular target,
/* sprintf to a "stream" */
static int
-#ifdef ANSI_PROTOTYPES
-objdump_sprintf (SFILE *f, const char *format, ...)
-#else
-objdump_sprintf (va_alist)
- va_dcl
-#endif
+objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...))
{
-#ifndef ANSI_PROTOTYPES
- SFILE *f;
- const char *format;
-#endif
char *buf;
- va_list args;
size_t n;
-#ifdef ANSI_PROTOTYPES
- va_start (args, format);
-#else
- va_start (args);
- f = va_arg (args, SFILE *);
- format = va_arg (args, const char *);
-#endif
+ VA_OPEN (args, format);
+ VA_FIXEDARG (args, SFILE *, f);
+ VA_FIXEDARG (args, const char *, format);
vasprintf (&buf, format, args);
- va_end (args);
-
if (buf == NULL)
{
+ va_end (args);
fatal (_("Out of virtual memory"));
}
free (buf);
+ VA_CLOSE (args);
return n;
}
: get_64bit_elf_symbols (file, offset, size))
-#ifdef ANSI_PROTOTYPES
static void
-error (const char * message, ...)
+error VPARAMS ((const char *message, ...))
{
- va_list args;
+ VA_OPEN (args, message);
+ VA_FIXEDARG (args, const char *, message);
fprintf (stderr, _("%s: Error: "), program_name);
- va_start (args, message);
vfprintf (stderr, message, args);
- va_end (args);
- return;
+ VA_CLOSE (args);
}
static void
-warn (const char * message, ...)
+warn VPARAMS ((const char *message, ...))
{
- va_list args;
+ VA_OPEN (args, message);
+ VA_FIXEDARG (args, const char *, message);
fprintf (stderr, _("%s: Warning: "), program_name);
- va_start (args, message);
- vfprintf (stderr, message, args);
- va_end (args);
- return;
-}
-#else
-static void
-error (va_alist)
- va_dcl
-{
- char * message;
- va_list args;
-
- fprintf (stderr, _("%s: Error: "), program_name);
- va_start (args);
- message = va_arg (args, char *);
vfprintf (stderr, message, args);
- va_end (args);
- return;
+ VA_CLOSE (args);
}
-static void
-warn (va_alist)
- va_dcl
-{
- char * message;
- va_list args;
-
- fprintf (stderr, _("%s: Warning: "), program_name);
- va_start (args);
- message = va_arg (args, char *);
- vfprintf (stderr, message, args);
- va_end (args);
- return;
-}
-#endif
-
static PTR get_data PARAMS ((PTR, FILE *, long, size_t, const char *));
static PTR