summaryrefslogtreecommitdiff
path: root/devel/cdecl/patches/patch-aa
blob: 94fb2810f94edcd23cd029bd85e60fd8fe5b86ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
$NetBSD: patch-aa,v 1.7 2005/10/31 19:24:03 tv Exp $

--- cdecl.c.orig	1996-01-15 22:54:46.000000000 -0500
+++ cdecl.c
@@ -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 @@ char cdeclsccsid[] = "@(#)cdecl.c	2.5 1/
 # ifndef NOVARARGS
 #  include <varargs.h>
 # endif /* ndef NOVARARGS */
+#if !(defined(__sun__) && defined(__svr4__)) && !(defined(BSD) && (BSD >= 199306)) && !defined(__INTERIX)
 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 @@ void free(), exit(), perror();
 # endif /* NOVOID */
 #endif /* __STDC__ || DOS */
 
+#if (defined(__svr4__) && defined(__sun__)) || defined(__NetBSD__) || defined(__APPLE__) || defined(__sgi) || defined(__INTERIX)
+#include <errno.h>
+#endif
+
 #ifdef USE_READLINE
 # include <readline/readline.h>
   /* prototypes for functions related to readline() */
@@ -124,7 +131,11 @@ char real_prompt[MAX_NAME+3];
 
 #if __STDC__
   char *ds(char *), *cat(char *, ...), *visible(int);
+#if !(defined(BSD) && BSD >= 199306) && \
+	!(defined(__sun__) && defined(__svr4__)) && \
+	!(defined(__linux__)) && !(defined(__INTERIX))
   int getopt(int,char **,char *);
+#endif
   int main(int, char **);
   int yywrap(void);
   int dostdin(void);
@@ -138,7 +149,7 @@ char real_prompt[MAX_NAME+3];
   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 +159,7 @@ char real_prompt[MAX_NAME+3];
   void unsupp(), notsupported();
   void yyerror();
   void doset(), dodeclare(), docast(), dodexplain(), docexplain();
-  void setprogname();
+  void mysetprogname();
   int dotmpfile(), dofileargs();
 #endif /* __STDC__ */
   FILE *tmpfile();
@@ -803,7 +814,7 @@ void prompt()
 }
 
 /* Save away the name of the program from argv[0] */
-void setprogname(argv0)
+void mysetprogname(argv0)
 char *argv0;
 {
 #ifdef DOS
@@ -1255,7 +1266,7 @@ char **argv;
     rl_completion_entry_function = (Function *)keyword_completion;
 #endif
 
-    setprogname(argv[0]);
+    mysetprogname(argv[0]);
 #ifdef DOS
     if (strcmp(progname, "cppdecl") == 0)
 #else