Avoid potentially empty struct.
[p5sagit/p5-mst-13.2.git] / x2p / util.c
index 0c6f99f..f087557 100644 (file)
@@ -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 <stdarg.h>
-#endif
+#include <stdarg.h>
 #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