Thread: tools/entab/halt.c compile fix

tools/entab/halt.c compile fix

From
"Niels Breet"
Date:
This patch changes the use of varargs.h to stdarg.h as
required by GCC.

Niels Breet



Index: halt.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/tools/entab/halt.c,v
retrieving revision 1.5
diff -c -r1.5 halt.c
*** halt.c      22 Mar 2001 04:01:45 -0000      1.5
--- halt.c      4 Apr 2005 20:09:03 -0000
***************
*** 5,11 ****
  **            This is used to print out error messages and exit
  */

! #include <varargs.h>
  #include <signal.h>
  #include <stdio.h>
  #include <errno.h>
--- 5,11 ----
  **            This is used to print out error messages and exit
  */

! #include <stdarg.h>
  #include <signal.h>
  #include <stdio.h>
  #include <errno.h>
***************
*** 19,33 ****

  /*VARARGS*/
  void
! halt(va_alist)
! va_dcl
  {
        va_list         arg_ptr;
        char       *format,
                           *pstr;
        void            (*sig_func) ();

!       va_start(arg_ptr);
        format = va_arg(arg_ptr, char *);
        if (strncmp(format, "PERROR", 6) != 0)
                vfprintf(stderr, format, arg_ptr);
--- 19,32 ----

  /*VARARGS*/
  void
! halt(const char *path, ...)
  {
        va_list         arg_ptr;
        char       *format,
                           *pstr;
        void            (*sig_func) ();

!       va_start(arg_ptr, path);
        format = va_arg(arg_ptr, char *);
        if (strncmp(format, "PERROR", 6) != 0)
                vfprintf(stderr, format, arg_ptr);



Re: tools/entab/halt.c compile fix

From
Neil Conway
Date:
Niels Breet wrote:
> This patch changes the use of varargs.h to stdarg.h as
> required by GCC.

Patch applied, thanks.

-Neil