$NetBSD: patch-aa,v 1.2 1999/11/26 13:58:33 hubertf Exp $

--- cdecl.c.orig	Tue Jan 16 04:54:46 1996
+++ cdecl.c	Fri Nov 26 15:02:00 1999
@@ -59,7 +59,9 @@
  */
 
 char cdeclsccsid[] = "@(#)cdecl.c	2.5 1/15/96";
-
+
+#include <sys/param.h>
+
 #include <stdio.h>
 #include <ctype.h>
 #if __STDC__ || defined(DOS)
@@ -71,11 +73,12 @@
 # ifndef NOVARARGS
 #  include <varargs.h>
 # endif /* ndef NOVARARGS */
+#if !(defined(__sun__) && defined(__svr4__)) && !(defined(BSD) && (BSD >= 199306))
 char *malloc();
 void free(), exit(), perror();
+#endif
 # ifdef BSD
 #  include <strings.h>
-   extern int errno;
 #  define strrchr rindex
 #  define NOTMPFILE
 # else
@@ -87,6 +90,10 @@
 # endif /* NOVOID */
 #endif /* __STDC__ || DOS */
 
+#if defined(__svr4__) && defined(__sun__) || defined(__NetBSD__)
+#include <errno.h>
+#endif
+
 #ifdef USE_READLINE
 # include <readline/readline.h>
   /* prototypes for functions related to readline() */
@@ -124,7 +131,9 @@
 
 #if __STDC__
   char *ds(char *), *cat(char *, ...), *visible(int);
+#if !(defined(BSD) && BSD >= 199306) && !(defined(__sun__) && defined(__svr4__))
   int getopt(int,char **,char *);
+#endif
   int main(int, char **);
   int yywrap(void);
   int dostdin(void);
