add harvested dev-util/cdecl to save from deprecation
[portage-squeep] / dev-util / cdecl / files / cdecl-2.5.patch
1 --- cdecl.c
2 +++ cdecl.c.new
3 @@ -67,6 +67,7 @@
4 # include <stddef.h>
5 # include <string.h>
6 # include <stdarg.h>
7 +# include <errno.h>
8 #else
9 # ifndef NOVARARGS
10 # include <varargs.h>
11 @@ -124,7 +125,6 @@
12
13 #if __STDC__
14 char *ds(char *), *cat(char *, ...), *visible(int);
15 - int getopt(int,char **,char *);
16 int main(int, char **);
17 int yywrap(void);
18 int dostdin(void);
19
20 --- cdecl.c 2009-07-07 13:20:37.000000000 +0200
21 +++ cdecl.c.new 2009-07-07 13:25:00.000000000 +0200
22 @@ -91,7 +91,7 @@
23 #ifdef USE_READLINE
24 # include <readline/readline.h>
25 /* prototypes for functions related to readline() */
26 - char * getline();
27 + char * mygetline();
28 char ** attempt_completion(char *, int, int);
29 char * keyword_completion(char *, int);
30 char * command_completion(char *, int);
31 @@ -375,7 +375,7 @@
32 static char *line_read = NULL;
33
34 /* Read a string, and return a pointer to it. Returns NULL on EOF. */
35 -char * getline ()
36 +char * mygetline ()
37 {
38 /* If the buffer has already been allocated, return the memory
39 to the free pool. */
40 @@ -887,7 +887,7 @@
41
42 if (!quiet) (void) printf("Type `help' or `?' for help\n");
43 ret = 0;
44 - while ((line = getline())) {
45 + while ((line = mygetline())) {
46 if (!strcmp(line, "quit") || !strcmp(line, "exit")) {
47 free(line);
48 return ret;
49 --- Makefile.old 2010-08-26 22:06:28.000000000 +0200
50 +++ Makefile 2010-08-26 22:11:42.000000000 +0200
51 @@ -15,9 +15,9 @@
52 #
53 # add -DUSE_READLINE To compile in support for the GNU readline library.
54
55 -CFLAGS= -s -O2 -DUSE_READLINE
56 +
57 CC= gcc
58 -LIBS= -lreadline -ltermcap
59 +
60 ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++
61 BINDIR= /usr/bin
62 MANDIR= /usr/man/man1
63 @@ -29,7 +29,7 @@
64 ln c++decl cdecl
65
66 c++decl: cdgram.c cdlex.c cdecl.c
67 - $(CC) $(CFLAGS) -o c++decl cdecl.c $(LIBS)
68 + $(CC) $(CFLAGS) ${LDFLAGS} -o c++decl cdecl.c $(LIBS)
69 rm -f cdecl
70
71 cdlex.c: cdlex.l