gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git] / libiberty / _doprnt.c
index a91e27f4127b8e01ed9e97bb51195ab7f509d690..a739f4304f9568546fceb745c674f2f6d2005f74 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide a version of _doprnt in terms of fprintf.
-   Copyright (C) 1998, 1999, 2000, 2001   Free Software Foundation, Inc.
+   Copyright (C) 1998-2020 Free Software Foundation, Inc.
    Contributed by Kaveh Ghazi  (ghazi@caip.rutgers.edu)  3/29/98
 
 This program is free software; you can redistribute it and/or modify it
@@ -14,24 +14,27 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include "config.h"
 #include "ansidecl.h"
 #include "safe-ctype.h"
 
 #include <stdio.h>
-#ifdef ANSI_PROTOTYPES
 #include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
 
 #undef _doprnt
 
+#ifdef HAVE__DOPRNT
+#define TEST
+#endif
+
 #ifdef TEST /* Make sure to use the internal one.  */
 #define _doprnt my_doprnt
 #endif
@@ -72,10 +75,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
       } while (0)
 
 int
-_doprnt (format, ap, stream)
-  const char * format;
-  va_list ap;
-  FILE * stream;
+_doprnt (const char *format, va_list ap, FILE *stream)
 {
   const char * ptr = format;
   char specifier[128];
@@ -216,23 +216,23 @@ _doprnt (format, ap, stream)
     fflush(stdin); \
 } while (0)
 
-static int checkit PARAMS ((const char * format, ...)) ATTRIBUTE_PRINTF_1;
+static int checkit (const char * format, ...) ATTRIBUTE_PRINTF_1;
 
 static int
-checkit VPARAMS ((const char* format, ...))
+checkit (const char* format, ...)
 {
   int result;
-  VA_OPEN (args, format);
-  VA_FIXEDARG (args, char *, format);
+  va_list args;
+  va_start (args, format);
 
   result = _doprnt (format, args, stdout);
-  VA_CLOSE (args);
+  va_end (args);
 
   return result;
 }
 
 int
-main ()
+main (void)
 {
   RESULT(checkit ("<%d>\n", 0x12345678));
   RESULT(printf ("<%d>\n", 0x12345678));
This page took 0.04813 seconds and 4 git commands to generate.