$NetBSD: patch-aa,v 1.3 2001/05/22 05:48:15 jlam Exp $ --- cdecl.c.orig Mon Jan 15 22:54:46 1996 +++ cdecl.c Tue May 22 01:41:35 2001 @@ -59,7 +59,9 @@ */ char cdeclsccsid[] = "@(#)cdecl.c 2.5 1/15/96"; - + +#include + #include #include #if __STDC__ || defined(DOS) @@ -71,11 +73,12 @@ # ifndef NOVARARGS # include # endif /* ndef NOVARARGS */ +#if !(defined(__sun__) && defined(__svr4__)) && !(defined(BSD) && (BSD >= 199306)) char *malloc(); void free(), exit(), perror(); +#endif # ifdef BSD # include - 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 +#endif + #ifdef USE_READLINE # include /* 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); @@ -138,7 +147,7 @@ void docast(char*, char*, char*, char*); void dodexplain(char*, char*, char*, char*); void docexplain(char*, char*, char*, char*); - void setprogname(char *); + void mysetprogname(char *); int dotmpfile(int, char**), dofileargs(int, char**); #else char *ds(), *cat(), *visible(); @@ -148,7 +157,7 @@ void unsupp(), notsupported(); void yyerror(); void doset(), dodeclare(), docast(), dodexplain(), docexplain(); - void setprogname(); + void mysetprogname(); int dotmpfile(), dofileargs(); #endif /* __STDC__ */ FILE *tmpfile(); @@ -803,7 +812,7 @@ } /* Save away the name of the program from argv[0] */ -void setprogname(argv0) +void mysetprogname(argv0) char *argv0; { #ifdef DOS @@ -1255,7 +1264,7 @@ rl_completion_entry_function = (Function *)keyword_completion; #endif - setprogname(argv[0]); + mysetprogname(argv[0]); #ifdef DOS if (strcmp(progname, "cppdecl") == 0) #else