head 1.13; access; symbols pkgsrc-2026Q1:1.13.0.4 pkgsrc-2026Q1-base:1.13 pkgsrc-2025Q4:1.13.0.2 pkgsrc-2025Q4-base:1.13 pkgsrc-2025Q3:1.12.0.4 pkgsrc-2025Q3-base:1.12 pkgsrc-2025Q2:1.12.0.2 pkgsrc-2025Q2-base:1.12 pkgsrc-2025Q1:1.11.0.90 pkgsrc-2025Q1-base:1.11 pkgsrc-2024Q4:1.11.0.88 pkgsrc-2024Q4-base:1.11 pkgsrc-2024Q3:1.11.0.86 pkgsrc-2024Q3-base:1.11 pkgsrc-2024Q2:1.11.0.84 pkgsrc-2024Q2-base:1.11 pkgsrc-2024Q1:1.11.0.82 pkgsrc-2024Q1-base:1.11 pkgsrc-2023Q4:1.11.0.80 pkgsrc-2023Q4-base:1.11 pkgsrc-2023Q3:1.11.0.78 pkgsrc-2023Q3-base:1.11 pkgsrc-2023Q2:1.11.0.76 pkgsrc-2023Q2-base:1.11 pkgsrc-2023Q1:1.11.0.74 pkgsrc-2023Q1-base:1.11 pkgsrc-2022Q4:1.11.0.72 pkgsrc-2022Q4-base:1.11 pkgsrc-2022Q3:1.11.0.70 pkgsrc-2022Q3-base:1.11 pkgsrc-2022Q2:1.11.0.68 pkgsrc-2022Q2-base:1.11 pkgsrc-2022Q1:1.11.0.66 pkgsrc-2022Q1-base:1.11 pkgsrc-2021Q4:1.11.0.64 pkgsrc-2021Q4-base:1.11 pkgsrc-2021Q3:1.11.0.62 pkgsrc-2021Q3-base:1.11 pkgsrc-2021Q2:1.11.0.60 pkgsrc-2021Q2-base:1.11 pkgsrc-2021Q1:1.11.0.58 pkgsrc-2021Q1-base:1.11 pkgsrc-2020Q4:1.11.0.56 pkgsrc-2020Q4-base:1.11 pkgsrc-2020Q3:1.11.0.54 pkgsrc-2020Q3-base:1.11 pkgsrc-2020Q2:1.11.0.50 pkgsrc-2020Q2-base:1.11 pkgsrc-2020Q1:1.11.0.30 pkgsrc-2020Q1-base:1.11 pkgsrc-2019Q4:1.11.0.52 pkgsrc-2019Q4-base:1.11 pkgsrc-2019Q3:1.11.0.48 pkgsrc-2019Q3-base:1.11 pkgsrc-2019Q2:1.11.0.46 pkgsrc-2019Q2-base:1.11 pkgsrc-2019Q1:1.11.0.44 pkgsrc-2019Q1-base:1.11 pkgsrc-2018Q4:1.11.0.42 pkgsrc-2018Q4-base:1.11 pkgsrc-2018Q3:1.11.0.40 pkgsrc-2018Q3-base:1.11 pkgsrc-2018Q2:1.11.0.38 pkgsrc-2018Q2-base:1.11 pkgsrc-2018Q1:1.11.0.36 pkgsrc-2018Q1-base:1.11 pkgsrc-2017Q4:1.11.0.34 pkgsrc-2017Q4-base:1.11 pkgsrc-2017Q3:1.11.0.32 pkgsrc-2017Q3-base:1.11 pkgsrc-2017Q2:1.11.0.28 pkgsrc-2017Q2-base:1.11 pkgsrc-2017Q1:1.11.0.26 pkgsrc-2017Q1-base:1.11 pkgsrc-2016Q4:1.11.0.24 pkgsrc-2016Q4-base:1.11 pkgsrc-2016Q3:1.11.0.22 pkgsrc-2016Q3-base:1.11 pkgsrc-2016Q2:1.11.0.20 pkgsrc-2016Q2-base:1.11 pkgsrc-2016Q1:1.11.0.18 pkgsrc-2016Q1-base:1.11 pkgsrc-2015Q4:1.11.0.16 pkgsrc-2015Q4-base:1.11 pkgsrc-2015Q3:1.11.0.14 pkgsrc-2015Q3-base:1.11 pkgsrc-2015Q2:1.11.0.12 pkgsrc-2015Q2-base:1.11 pkgsrc-2015Q1:1.11.0.10 pkgsrc-2015Q1-base:1.11 pkgsrc-2014Q4:1.11.0.8 pkgsrc-2014Q4-base:1.11 pkgsrc-2014Q3:1.11.0.6 pkgsrc-2014Q3-base:1.11 pkgsrc-2014Q2:1.11.0.4 pkgsrc-2014Q2-base:1.11 pkgsrc-2014Q1:1.11.0.2 pkgsrc-2014Q1-base:1.11 pkgsrc-2013Q4:1.10.0.36 pkgsrc-2013Q4-base:1.10 pkgsrc-2013Q3:1.10.0.34 pkgsrc-2013Q3-base:1.10 pkgsrc-2013Q2:1.10.0.32 pkgsrc-2013Q2-base:1.10 pkgsrc-2013Q1:1.10.0.30 pkgsrc-2013Q1-base:1.10 pkgsrc-2012Q4:1.10.0.28 pkgsrc-2012Q4-base:1.10 pkgsrc-2012Q3:1.10.0.26 pkgsrc-2012Q3-base:1.10 pkgsrc-2012Q2:1.10.0.24 pkgsrc-2012Q2-base:1.10 pkgsrc-2012Q1:1.10.0.22 pkgsrc-2012Q1-base:1.10 pkgsrc-2011Q4:1.10.0.20 pkgsrc-2011Q4-base:1.10 pkgsrc-2011Q3:1.10.0.18 pkgsrc-2011Q3-base:1.10 pkgsrc-2011Q2:1.10.0.16 pkgsrc-2011Q2-base:1.10 pkgsrc-2011Q1:1.10.0.14 pkgsrc-2011Q1-base:1.10 pkgsrc-2010Q4:1.10.0.12 pkgsrc-2010Q4-base:1.10 pkgsrc-2010Q3:1.10.0.10 pkgsrc-2010Q3-base:1.10 pkgsrc-2010Q2:1.10.0.8 pkgsrc-2010Q2-base:1.10 pkgsrc-2010Q1:1.10.0.6 pkgsrc-2010Q1-base:1.10 pkgsrc-2009Q4:1.10.0.4 pkgsrc-2009Q4-base:1.10 pkgsrc-2009Q3:1.10.0.2 pkgsrc-2009Q3-base:1.10 pkgsrc-2009Q2:1.9.0.24 pkgsrc-2009Q2-base:1.9 pkgsrc-2009Q1:1.9.0.22 pkgsrc-2009Q1-base:1.9 pkgsrc-2008Q4:1.9.0.20 pkgsrc-2008Q4-base:1.9 pkgsrc-2008Q3:1.9.0.18 pkgsrc-2008Q3-base:1.9 cube-native-xorg:1.9.0.16 cube-native-xorg-base:1.9 pkgsrc-2008Q2:1.9.0.14 pkgsrc-2008Q2-base:1.9 cwrapper:1.9.0.12 pkgsrc-2008Q1:1.9.0.10 pkgsrc-2008Q1-base:1.9 pkgsrc-2007Q4:1.9.0.8 pkgsrc-2007Q4-base:1.9 pkgsrc-2007Q3:1.9.0.6 pkgsrc-2007Q3-base:1.9 pkgsrc-2007Q2:1.9.0.4 pkgsrc-2007Q2-base:1.9 pkgsrc-2007Q1:1.9.0.2 pkgsrc-2007Q1-base:1.9 pkgsrc-2006Q4:1.8.0.8 pkgsrc-2006Q4-base:1.8 pkgsrc-2006Q3:1.8.0.6 pkgsrc-2006Q3-base:1.8 pkgsrc-2006Q2:1.8.0.4 pkgsrc-2006Q2-base:1.8 pkgsrc-2006Q1:1.8.0.2 pkgsrc-2006Q1-base:1.8 pkgsrc-2005Q4:1.7.0.2 pkgsrc-2005Q4-base:1.7 pkgsrc-2005Q3:1.6.0.4 pkgsrc-2005Q3-base:1.6 pkgsrc-2005Q2:1.6.0.2 pkgsrc-2005Q2-base:1.6 pkgsrc-2005Q1:1.4.0.6 pkgsrc-2005Q1-base:1.4 pkgsrc-2004Q4:1.4.0.4 pkgsrc-2004Q4-base:1.4 pkgsrc-2004Q3:1.4.0.2 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.3.0.14 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.12 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.10 pkgsrc-2003Q4-base:1.3 netbsd-1-6-1:1.3.0.6 netbsd-1-6-1-base:1.3 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 netbsd-1-5-PATCH001:1.2 netbsd-1-5-RELEASE:1.2 netbsd-1-4-PATCH003:1.2 netbsd-1-4-PATCH002:1.2 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.13 date 2025.09.29.20.48.53; author mrg; state Exp; branches; next 1.12; commitid 27iNs8hdOykXsEcG; 1.12 date 2025.04.21.16.30.45; author wiz; state Exp; branches; next 1.11; commitid 0XcgoFRqpl1idWRF; 1.11 date 2014.03.17.07.07.40; author dholland; state Exp; branches; next 1.10; commitid jQ3p27iyitAhn1tx; 1.10 date 2009.09.27.22.27.23; author apb; state Exp; branches; next 1.9; 1.9 date 2007.03.09.15.38.32; author rillig; state Exp; branches; next 1.8; 1.8 date 2006.01.08.20.16.27; author joerg; state Exp; branches; next 1.7; 1.7 date 2005.10.31.19.24.03; author tv; state Exp; branches; next 1.6; 1.6 date 2005.06.14.03.02.29; author jschauma; state Exp; branches; next 1.5; 1.5 date 2005.04.01.15.33.35; author minskim; state Exp; branches; next 1.4; 1.4 date 2004.09.13.06.07.03; author minskim; state Exp; branches; next 1.3; 1.3 date 2001.05.22.05.48.15; author jlam; state Exp; branches; next 1.2; 1.2 date 99.11.26.13.58.33; author hubertf; state Exp; branches; next 1.1; 1.1 date 99.11.11.12.53.17; author agc; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.11.11.12.53.17; author agc; state Exp; branches; next ; desc @@ 1.13 log @Make build with GCC 14. Include for history definitions. Add dotmpfile_from_string() prototype. Give main() a return type. @ text @$NetBSD: patch-aa,v 1.12 2025/04/21 16:30:45 wiz Exp $ - Don't issue own declarations of malloc, free, exit, perror, errno, getopt. - Use standard headers. - Avoid symbol conflicts with restrict, setprogname, getline. - Fix build with current readline. - Adapt for GCC 14. --- cdecl.c.orig 1996-01-15 19:54:46.000000000 -0800 +++ cdecl.c 2025-09-25 10:40:24.758584770 -0700 @@@@ -59,7 +59,9 @@@@ */ char cdeclsccsid[] = "@@(#)cdecl.c 2.5 1/15/96"; - + +#include + #include #include #if __STDC__ || defined(DOS) @@@@ -71,11 +73,12 @@@@ char cdeclsccsid[] = "@@(#)cdecl.c 2.5 1/ # 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,13 +90,14 @@@@ void free(), exit(), perror(); # endif /* NOVOID */ #endif /* __STDC__ || DOS */ +#include + #ifdef USE_READLINE # include +# include /* prototypes for functions related to readline() */ - char * getline(); - char ** attempt_completion(char *, int, int); - char * keyword_completion(char *, int); - char * command_completion(char *, int); +char * command_completion(const char *, int); +int dotmpfile_from_string(char *s); #endif /* maximum # of chars from progname to display in prompt */ @@@@ -124,7 +128,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__)) int getopt(int,char **,char *); +#endif int main(int, char **); int yywrap(void); int dostdin(void); @@@@ -138,7 +146,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 +156,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(); @@@@ -241,7 +249,7 @@@@ struct /* for unsupported combinations of types. */ void mbcheck() { - register int i, j, restrict; + register int i, j, xrestrict; char *t1, *t2; /* Loop through the types */ @@@@ -258,26 +266,26 @@@@ void mbcheck() if (!(modbits & crosstypes[j].bit)) continue; /* check the type of restriction */ - restrict = crosscheck[i][j]; - if (restrict == ALWAYS) + xrestrict = crosscheck[i][j]; + if (xrestrict == ALWAYS) continue; t1 = crosstypes[i].name; t2 = crosstypes[j].name; - if (restrict == NEVER) + if (xrestrict == NEVER) { notsupported("", t1, t2); } - else if (restrict == RITCHIE) + else if (xrestrict == RITCHIE) { if (RitchieFlag) notsupported(" (Ritchie Compiler)", t1, t2); } - else if (restrict == PREANSI) + else if (xrestrict == PREANSI) { if (PreANSIFlag || RitchieFlag) notsupported(" (Pre-ANSI Compiler)", t1, t2); } - else if (restrict == ANSI) + else if (xrestrict == ANSI) { if (!RitchieFlag && !PreANSIFlag) notsupported(" (ANSI Compiler)", t1, t2); @@@@ -286,7 +294,7 @@@@ void mbcheck() { (void) fprintf (stderr, "%s: Internal error in crosscheck[%d,%d]=%d!\n", - progname, i, j, restrict); + progname, i, j, xrestrict); exit(1); /* NOTREACHED */ } } @@@@ -375,7 +383,7 @@@@ char *options[] = { static char *line_read = NULL; /* Read a string, and return a pointer to it. Returns NULL on EOF. */ -char * getline () +char * get_line () { /* If the buffer has already been allocated, return the memory to the free pool. */ @@@@ -399,12 +407,12 @@@@ char ** attempt_completion(char *text, i { char **matches = NULL; - if (start == 0) matches = completion_matches(text, command_completion); + if (start == 0) matches = rl_completion_matches(text, command_completion); return matches; } -char * command_completion(char *text, int flag) +char * command_completion(const char *text, int flag) { static int index, len; char *command; @@@@ -421,7 +429,7 @@@@ char * command_completion(char *text, in return NULL; } -char * keyword_completion(char *text, int flag) +char * keyword_completion(const char *text, int flag) { static int index, len, set, into; char *keyword, *option; @@@@ -803,7 +811,7 @@@@ void prompt() } /* Save away the name of the program from argv[0] */ -void setprogname(argv0) +void mysetprogname(argv0) char *argv0; { #ifdef DOS @@@@ -887,7 +895,7 @@@@ int dostdin() if (!quiet) (void) printf("Type `help' or `?' for help\n"); ret = 0; - while ((line = getline())) { + while ((line = get_line())) { if (!strcmp(line, "quit") || !strcmp(line, "exit")) { free(line); return ret; @@@@ -1244,18 +1252,17 @@@@ void versions() exit(0); } -int main(argc, argv) -char **argv; +int main(int argc, char **argv) { int c, ret = 0; #ifdef USE_READLINE /* install completion handlers */ - rl_attempted_completion_function = (CPPFunction *)attempt_completion; - rl_completion_entry_function = (Function *)keyword_completion; + rl_attempted_completion_function = (rl_completion_func_t *)attempt_completion; + rl_completion_entry_function = keyword_completion; #endif - setprogname(argv[0]); + mysetprogname(argv[0]); #ifdef DOS if (strcmp(progname, "cppdecl") == 0) #else @ 1.12 log @cdecl: remove Interix support @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.11 2014/03/17 07:07:40 dholland Exp $ d7 1 d9 2 a10 2 --- cdecl.c.orig 1996-01-16 03:54:46.000000000 +0000 +++ cdecl.c d36 1 a36 1 @@@@ -87,13 +90,12 @@@@ void free(), exit(), perror(); d44 1 d51 1 d55 1 a55 1 @@@@ -124,7 +126,11 @@@@ char real_prompt[MAX_NAME+3]; d67 1 a67 1 @@@@ -138,7 +144,7 @@@@ char real_prompt[MAX_NAME+3]; d76 1 a76 1 @@@@ -148,7 +154,7 @@@@ char real_prompt[MAX_NAME+3]; d85 1 a85 1 @@@@ -241,7 +247,7 @@@@ struct d94 1 a94 1 @@@@ -258,26 +264,26 @@@@ void mbcheck() d127 1 a127 1 @@@@ -286,7 +292,7 @@@@ void mbcheck() d136 1 a136 1 @@@@ -375,7 +381,7 @@@@ char *options[] = { d145 1 a145 1 @@@@ -399,12 +405,12 @@@@ char ** attempt_completion(char *text, i d160 1 a160 1 @@@@ -421,7 +427,7 @@@@ char * command_completion(char *text, in d169 1 a169 1 @@@@ -803,7 +809,7 @@@@ void prompt() d178 1 a178 1 @@@@ -887,7 +893,7 @@@@ int dostdin() d187 9 a195 1 @@@@ -1251,11 +1257,11 @@@@ char **argv; @ 1.11 log @Fix build with readline 6.3. Add patch comment. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.10 2009/09/27 22:27:23 apb Exp $ d25 1 a25 1 +#if !(defined(__sun__) && defined(__svr4__)) && !(defined(BSD) && (BSD >= 199306)) && !defined(__INTERIX) d58 1 a58 1 + !(defined(__linux__)) && !(defined(__INTERIX)) @ 1.10 log @Rename getline to get_line to avoid clash with libc function. No need to bump PKGREVISION. @ text @d1 6 a6 1 $NetBSD: patch-aa,v 1.9 2007/03/09 15:38:32 rillig Exp $ d184 2 a185 1 @@@@ -1252,10 +1258,10 @@@@ char **argv; d188 1 a188 1 rl_attempted_completion_function = (CPPFunction *)attempt_completion; d190 1 @ 1.9 log @Don't use "restrict" as an identifier in C code; it is reserved since C99. Fixed PKGMANDIR. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.8 2006/01/08 20:16:27 joerg Exp $ d3 2 a4 2 --- cdecl.c.orig 1996-01-16 04:54:46.000000000 +0100 +++ cdecl.c 2007-03-09 16:36:18.000000000 +0100 d128 9 d170 9 @ 1.8 log @Always include errno.h. Avoid the compat interface and correct prototypes. @ text @d1 1 a1 1 $NetBSD$ d3 2 a4 2 --- cdecl.c.orig 1996-01-16 03:54:46.000000000 +0000 +++ cdecl.c d77 51 @ 1.7 log @Add conditionals to make build on Interix. @ text @d3 1 a3 1 --- cdecl.c.orig 1996-01-15 22:54:46.000000000 -0500 d30 1 a30 1 @@@@ -87,6 +90,10 @@@@ void free(), exit(), perror(); a33 1 +#if (defined(__svr4__) && defined(__sun__)) || defined(__NetBSD__) || defined(__APPLE__) || defined(__sgi) || defined(__INTERIX) a34 1 +#endif d39 9 a47 1 @@@@ -124,7 +131,11 @@@@ char real_prompt[MAX_NAME+3]; d59 1 a59 1 @@@@ -138,7 +149,7 @@@@ char real_prompt[MAX_NAME+3]; d68 1 a68 1 @@@@ -148,7 +159,7 @@@@ char real_prompt[MAX_NAME+3]; d77 25 a101 1 @@@@ -803,7 +814,7 @@@@ void prompt() d110 6 a115 2 @@@@ -1255,7 +1266,7 @@@@ char **argv; rl_completion_entry_function = (Function *)keyword_completion; @ 1.6 log @This patch also needs a sgi-ifdef @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.5 2005/04/01 15:33:35 minskim Exp $ d3 1 a3 1 --- cdecl.c.orig Mon Jan 15 21:54:46 1996 d20 1 a20 1 +#if !(defined(__sun__) && defined(__svr4__)) && !(defined(BSD) && (BSD >= 199306)) d34 1 a34 1 +#if defined(__svr4__) && defined(__sun__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__sgi) d47 1 a47 1 + !(defined(__linux__)) @ 1.5 log @Include errno.h to use errno on Darwin. @ text @d1 1 a1 1 $NetBSD$ d34 1 a34 1 +#if defined(__svr4__) && defined(__sun__) || defined(__NetBSD__) || defined(__APPLE__) @ 1.4 log @Make this package build on Linux. - Do not declare getopt() because the correct declaration is in getopt.h. @ text @d3 1 a3 1 --- cdecl.c.orig 1996-01-15 21:54:46.000000000 -0600 d34 1 a34 1 +#if defined(__svr4__) && defined(__sun__) || defined(__NetBSD__) @ 1.3 log @Use editline readline emulation when available. Move example files to ${PREFIX}/share/examples/cdecl. Also patch sources to rename instances of setprogname() to mysetprogname(), as setprogname() is part of the standard library in NetBSD>1.5. @ text @d3 2 a4 2 --- cdecl.c.orig Mon Jan 15 22:54:46 1996 +++ cdecl.c Tue May 22 01:41:35 2001 d16 1 a16 1 @@@@ -71,11 +73,12 @@@@ d30 1 a30 1 @@@@ -87,6 +90,10 @@@@ d41 1 a41 1 @@@@ -124,7 +131,9 @@@@ d45 3 a47 1 +#if !(defined(BSD) && BSD >= 199306) && !(defined(__sun__) && defined(__svr4__)) d53 1 a53 1 @@@@ -138,7 +147,7 @@@@ d62 1 a62 1 @@@@ -148,7 +157,7 @@@@ d71 1 a71 1 @@@@ -803,7 +812,7 @@@@ d80 1 a80 1 @@@@ -1255,7 +1264,7 @@@@ @ 1.2 log @fix @ text @d3 2 a4 2 --- cdecl.c.orig Tue Jan 16 04:54:46 1996 +++ cdecl.c Fri Nov 26 15:02:00 1999 d51 36 @ 1.1 log @Initial revision @ text @d3 2 a4 4 Minor portability modifications for NetBSD and Solaris --- cdecl.c 1999/11/11 12:16:45 1.1 +++ cdecl.c 1999/11/11 12:25:39 d16 1 a16 1 @@@@ -71,8 +73,10 @@@@ d26 5 a30 2 extern int errno; @@@@ -87,6 +91,10 @@@@ d34 1 a34 1 +#if defined(__svr4__) && defined(__sun__) d41 1 a41 1 @@@@ -124,7 +132,9 @@@@ @ 1.1.1.1 log @Import cdecl-2.5, a utility to explain and compose C and C++ declarations, into the NetBSD packages collection. The master sites were taken from the FreeBSD port, nothing else. @ text @@