X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=x2p%2Futil.c;h=f0875577fe07870d2972698310dc58070525c7b0;hb=158b3652342ca691c9e3b061a1d78456ae1a9b4a;hp=0c6f99f795ee16bee906bbe9faff3b6c482bbc19;hpb=ba3eb2af450c2577c20a691fb686a5e02955c48b;p=p5sagit%2Fp5-mst-13.2.git diff --git a/x2p/util.c b/x2p/util.c index 0c6f99f..f087557 100644 --- a/x2p/util.c +++ b/x2p/util.c @@ -1,6 +1,6 @@ /* $RCSfile: util.c,v $$Revision: 4.1 $$Date: 92/08/07 18:29:29 $ * - * Copyright (c) 1991-1997, Larry Wall + * Copyright (c) 1991-2002, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -13,9 +13,7 @@ #include "INTERN.h" #include "util.h" -#ifdef I_STDARG -# include -#endif +#include #define FLUSH static char nomem[] = "Out of memory!\n"; @@ -178,20 +176,14 @@ growstr(char **strptr, int *curlen, int newlen) } void -#if defined(I_STDARG) && defined(HAS_VPRINTF) croak(char *pat,...) -#else /* I_STDARG */ -/*VARARGS1*/ -croak(pat,a1,a2,a3,a4) - char *pat; - int a1,a2,a3,a4; -#endif /* I_STDARG */ { -#if defined(I_STDARG) && defined(HAS_VPRINTF) +#if defined(HAS_VPRINTF) va_list args; va_start(args, pat); vfprintf(stderr,pat,args); + va_end(args); #else fprintf(stderr,pat,a1,a2,a3,a4); #endif @@ -199,41 +191,32 @@ croak(pat,a1,a2,a3,a4) } void -#if defined(I_STDARG) && defined(HAS_VPRINTF) fatal(char *pat,...) -#else /* I_STDARG */ -/*VARARGS1*/ -fatal(pat,a1,a2,a3,a4) - char *pat; - int a1,a2,a3,a4; -#endif /* I_STDARG */ { -#if defined(I_STDARG) && defined(HAS_VPRINTF) +#if defined(HAS_VPRINTF) va_list args; va_start(args, pat); vfprintf(stderr,pat,args); + va_end(args); #else fprintf(stderr,pat,a1,a2,a3,a4); #endif exit(1); } +#if defined(__APPLE_CC__) +__private_extern__ /* warn() conflicts with libc */ +#endif void -#if defined(I_STDARG) && defined(HAS_VPRINTF) warn(char *pat,...) -#else /* I_STDARG */ -/*VARARGS1*/ -warn(pat,a1,a2,a3,a4) - char *pat; - int a1,a2,a3,a4; -#endif /* I_STDARG */ { -#if defined(I_STDARG) && defined(HAS_VPRINTF) +#if defined(HAS_VPRINTF) va_list args; va_start(args, pat); vfprintf(stderr,pat,args); + va_end(args); #else fprintf(stderr,pat,a1,a2,a3,a4); #endif