ports/71460: [PATCH] net/socks5: Fix build with gcc-3.4
KIMURA Yasuhiro
yasu at utahime.org
Tue Sep 7 12:40:25 UTC 2004
>Number: 71460
>Category: ports
>Synopsis: [PATCH] net/socks5: Fix build with gcc-3.4
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Sep 07 12:40:21 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: KIMURA Yasuhiro
>Release: FreeBSD 5.3-BETA3 i386
>Organization:
>Environment:
System: FreeBSD angel-vm-freebsd.home.utahime.org 5.3-BETA3 FreeBSD 5.3-BETA3 #0: Sat Sep 4 12:07:48 UTC 2004 root at harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
Net/socks5 is broken on 5.3-BETA3 because gcc-3.4 doesn't support
old <varargs.h>. This patch should fix it.
>How-To-Repeat:
>Fix:
--- socks5.patch begins here ---
diff -ruN net/socks5.dist/files/patch-clients::ftp::ftp.c net/socks5/files/patch-clients::ftp::ftp.c
--- net/socks5.dist/files/patch-clients::ftp::ftp.c Thu Jan 1 09:00:00 1970
+++ net/socks5/files/patch-clients::ftp::ftp.c Tue Sep 7 20:45:07 2004
@@ -0,0 +1,49 @@
+--- clients/ftp/ftp.c.orig Thu Aug 17 00:38:44 2000
++++ clients/ftp/ftp.c Tue Sep 7 20:41:35 2004
+@@ -48,7 +48,15 @@
+ #include <fcntl.h>
+ #endif
+
++#ifdef HAVE_STDARG_H
++#include <stdarg.h>
++#define VA_START(a, b) va_start((a), (b))
++#define va_alist ...
++#define va_dcl
++#else
+ #include <varargs.h>
++#define VA_START(a, b) va_start((a))
++#endif
+
+ #ifdef FASCIST
+ #include <syslog.h>
+@@ -241,9 +249,8 @@
+ }
+
+ /*VARARGS*/
+-int command(va_alist) va_dcl {
++int command(char *fmt, va_alist) va_dcl {
+ va_list ap;
+- char *fmt;
+ int r;
+ Sig_t oldintr;
+
+@@ -251,8 +258,7 @@
+ if (debug) {
+ printf("---> ");
+
+- va_start(ap);
+- fmt = va_arg(ap, char *);
++ VA_START(ap, fmt);
+ if (strncmp("PASS ", fmt, 5) == 0)
+ printf("PASS XXXX");
+ else
+@@ -271,8 +277,7 @@
+
+ oldintr = Signal(SIGINT, cmdabort);
+
+- va_start(ap);
+- fmt = va_arg(ap, char *);
++ VA_START(ap, fmt);
+ vfprintf(cout, fmt, ap);
+ va_end(ap);
+
diff -ruN net/socks5.dist/files/patch-clients::telnet::commands.c net/socks5/files/patch-clients::telnet::commands.c
--- net/socks5.dist/files/patch-clients::telnet::commands.c Thu Jan 1 09:00:00 1970
+++ net/socks5/files/patch-clients::telnet::commands.c Tue Sep 7 20:46:45 2004
@@ -0,0 +1,51 @@
+--- clients/telnet/commands.c.orig Thu Aug 17 00:38:46 2000
++++ clients/telnet/commands.c Tue Sep 7 20:39:04 2004
+@@ -83,7 +83,17 @@
+ #include <signal.h>
+ #include <ctype.h>
+ #include <pwd.h>
++
++#ifdef HAVE_STDARG_H
++#include <stdarg.h>
++#define VA_START(a, b) va_start((a), (b))
++#define va_alist ...
++#define va_dcl
++#else
+ #include <varargs.h>
++#define VA_START(a, b) va_start((a))
++#endif
++
+ #include <errno.h>
+
+ #include <arpa/telnet.h>
+@@ -122,7 +132,9 @@
+ extern int Ambiguous();
+ extern void herror();
+
+-static int call();
++typedef int (*intrtn_t)();
++
++static int call(intrtn_t routine, va_alist);
+
+ typedef struct {
+ char *name; /* command name */
+@@ -2092,17 +2104,14 @@
+
+ /*VARARGS1*/
+ static int
+-call(va_alist)
++call(intrtn_t routine, va_alist)
+ va_dcl
+ {
+ va_list ap;
+- typedef int (*intrtn_t)();
+- intrtn_t routine;
+ char *args[100];
+ int argno = 0;
+
+- va_start(ap);
+- routine = (va_arg(ap, intrtn_t));
++ VA_START(ap, routine);
+ while ((args[argno++] = va_arg(ap, char *)) != 0) {
+ ;
+ }
--- socks5.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list