From owner-freebsd-ports@FreeBSD.ORG Sat May 17 06:18:35 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D0A737B401 for ; Sat, 17 May 2003 06:18:35 -0700 (PDT) Received: from falcon.midgard.homeip.net (h76n3fls20o913.telia.com [213.67.148.76]) by mx1.FreeBSD.org (Postfix) with SMTP id 22E3B43FEA for ; Sat, 17 May 2003 06:18:31 -0700 (PDT) (envelope-from ertr1013@student.uu.se) Received: (qmail 78177 invoked by uid 1001); 17 May 2003 13:18:17 -0000 Date: Sat, 17 May 2003 15:18:17 +0200 From: Erik Trulsson To: Jonathan Belson , Kris Kennaway , ports@FreeBSD.org Message-ID: <20030517131817.GA69768@falcon.midgard.homeip.net> Mail-Followup-To: Jonathan Belson , Kris Kennaway , ports@FreeBSD.org References: <3EC53C6C.1040904@witchspace.com> <20030517121908.GA67369@rot13.obsecurity.org> <3EC62CC2.6090209@witchspace.com> <20030517130549.GA44928@falcon.midgard.homeip.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" Content-Disposition: inline In-Reply-To: <20030517130549.GA44928@falcon.midgard.homeip.net> User-Agent: Mutt/1.5.4i Subject: Re: FreeBSD Port: pornview-0.2.0.p.1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 May 2003 13:18:35 -0000 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, May 17, 2003 at 03:05:49PM +0200, Erik Trulsson wrote: > On Sat, May 17, 2003 at 01:36:18PM +0100, Jonathan Belson wrote: > > Kris Kennaway wrote: > > >The package builds currently fail on 4.x: > > > > > >http://bento.freebsd.org/errorlogs/i386-4-latest/pornview-0.2.0.p.1_1.log > > > > > >Your workaround does not sound like a solution though. stdin et al > > >are defined for a reason ;-) > > > > The problem is in the following structure: > > > > struct ChildContext_Tag > > { > > ...blah... > > int stdout_fd; > > int stderr_fd; > > int stdin_fd; > > That part of the structure is not the problem. The next part of this > structure is the problem. > > gchar stdout[GTK_MPLAYER_BUF_SIZE]; > gint stdout_size; > gchar stderr[GTK_MPLAYER_BUF_SIZE]; > gint stderr_size; > > This code is faulty since stdin/stdout/stderr *are* macros and > therefore *will* mess up this declaration. > > > ...blah... > > }; > > > > The author's (perfectly legitimate) members are being mangled by > > Not legitimate. The C standard itself says that stdin/stdout/stderr are > supposed to be macros and therefore this behaviour is expected. > > > the preprocessor. It seems a little unfair to ask the author to > > change them, the only other alternative I can see is to s/// every > > The bug is in the application, not in FreeBSD, so, unfair or not, it > isn't FreeBSD that should be changed. > > > reference to something that doesn't clash with the FreeBSD stdio.h. > > > > Ugly :-( And until the author of pornview fixes his code the attached patch for the port should fix things. -- Erik Trulsson ertr1013@student.uu.se --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=patch Index: files/patch-src::support::widgets::gtkmplayer.c =================================================================== RCS file: /ncvs/ports/graphics/pornview/files/patch-src::support::widgets::gtkmplayer.c,v retrieving revision 1.1 diff -u -r1.1 patch-src::support::widgets::gtkmplayer.c --- files/patch-src::support::widgets::gtkmplayer.c 5 Apr 2003 17:30:51 -0000 1.1 +++ files/patch-src::support::widgets::gtkmplayer.c 17 May 2003 13:10:56 -0000 @@ -1,5 +1,5 @@ ---- src/support/widgets/gtkmplayer.c.orig Sat Apr 5 18:54:40 2003 -+++ src/support/widgets/gtkmplayer.c Sat Apr 5 18:55:27 2003 +--- src/support/widgets/gtkmplayer.c.orig Fri Dec 13 12:15:21 2002 ++++ src/support/widgets/gtkmplayer.c Sat May 17 15:04:45 2003 @@ -30,6 +30,7 @@ #include #include @@ -8,3 +8,67 @@ #include #include +@@ -72,9 +73,9 @@ + int stderr_fd; + int stdin_fd; + +- gchar stdout[GTK_MPLAYER_BUF_SIZE]; ++ gchar stdoutb[GTK_MPLAYER_BUF_SIZE]; + gint stdout_size; +- gchar stderr[GTK_MPLAYER_BUF_SIZE]; ++ gchar stderrb[GTK_MPLAYER_BUF_SIZE]; + gint stderr_size; + + ProcessLineFunc process_line_fn; +@@ -1049,13 +1050,13 @@ + context->stdout_fd = out_fd[0]; + fcntl (context->stdout_fd, F_SETFL, O_NONBLOCK); + close (out_fd[1]); +- context->stdout[0] = '\0'; ++ context->stdoutb[0] = '\0'; + context->stdout_size = 0; + + context->stderr_fd = err_fd[0]; + fcntl (context->stderr_fd, F_SETFL, O_NONBLOCK); + close (err_fd[1]); +- context->stderr[0] = '\0'; ++ context->stderrb[0] = '\0'; + context->stderr_size = 0; + + context->stdin_fd = in_fd[1]; +@@ -1193,7 +1194,7 @@ + + if (size > 0 && size < GTK_MPLAYER_BUF_SIZE) + { +- memcpy (buf, context->stderr, size); ++ memcpy (buf, context->stderrb, size); + next = buf + size; + } + else +@@ -1211,7 +1212,7 @@ + size += MIN (GTK_MPLAYER_BUF_SIZE - 1, n); + + process_lines (context, buf, size, +- context->stderr, &context->stderr_size, TRUE); ++ context->stderrb, &context->stderr_size, TRUE); + } + + /* +@@ -1221,7 +1222,7 @@ + + if (size > 0 && size < GTK_MPLAYER_BUF_SIZE) + { +- memcpy (buf, context->stdout, size); ++ memcpy (buf, context->stdoutb, size); + next = buf + size; + } + else +@@ -1240,7 +1241,7 @@ + pos = context->player->pos; + + process_lines (context, buf, size, +- context->stdout, &context->stdout_size, FALSE); ++ context->stdoutb, &context->stdout_size, FALSE); + + if (fabs (context->player->pos - pos) > 0.1) + gtk_signal_emit (GTK_OBJECT (context->player), --MGYHOYXEY6WxJCY8--