Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jun 2007 18:09:00 +0900 (JST)
From:      NAKAJI Hiroyuki <nakaji@jp.freebsd.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        mita@FreeBSD.org
Subject:   ports/113318: japanese/vflib cannot compile with gcc 4.2
Message-ID:  <200706040909.l54990vi047838@roddy.4407.kankyo-u.ac.jp>
Resent-Message-ID: <200706040910.l549A42O023600@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         113318
>Category:       ports
>Synopsis:       japanese/vflib cannot compile with gcc 4.2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jun 04 09:10:03 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     NAKAJI Hiroyuki
>Release:        FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD roddy.4407.kankyo-u.ac.jp 7.0-CURRENT FreeBSD 7.0-CURRENT #82: Tue May 29 13:50:01 JST 2007 root@roddy.4407.kankyo-u.ac.jp:/usr/obj/usr/src/sys/RODDY i386


>Description:
	Gcc 4.2 cannot compile some files in VFlib. The order of
function's prototypes is the problem, I think.

>How-To-Repeat:
	Update your system to the latest 7.0-current, or install
lang/gcc42 and set CC to gcc42.
	
	cd /usr/ports/japanese/vflib
	make all
>Fix:

	Here is a diff from ports-current. Two files, files/VF_FNTWV.c and
files/patch-fman.c, are added.

diff -urN -x CVS -x work /usr/ports/japanese/vflib/Makefile ./Makefile
--- /usr/ports/japanese/vflib/Makefile	Sun May 20 08:23:06 2007
+++ ./Makefile	Mon Jun  4 18:01:31 2007
@@ -7,7 +7,7 @@
 
 PORTNAME=	vflib
 PORTVERSION=	${VFLIB_VERSION}
-PORTREVISION=	7
+PORTREVISION=	8
 CATEGORIES=	japanese print
 MASTER_SITES=	ftp://gull.se.hiroshima-u.ac.jp/pub/TypeHack/
 DISTNAME=	VFlib2-${PORTVERSION}
diff -urN -x CVS -x work /usr/ports/japanese/vflib/files/patch-VF_FNTWV.c ./files/patch-VF_FNTWV.c
--- /usr/ports/japanese/vflib/files/patch-VF_FNTWV.c	Thu Jan  1 09:00:00 1970
+++ ./files/patch-VF_FNTWV.c	Mon Jun  4 16:12:38 2007
@@ -0,0 +1,42 @@
+--- src/VF_FNTWV.c.orig	Wed May 30 13:03:47 2001
++++ src/VF_FNTWV.c	Mon Jun  4 16:11:58 2007
+@@ -177,13 +177,13 @@
+ 
+ 
+ 
++Private int  ReadCapa();
+ Public FontObj*
+ CreateFont_FontWave(ent)
+   char *ent;
+ {
+   Font     *font;
+   FontObj  *fobj;
+-  Private int  ReadCapa();
+ 
+   if ((font = (Font*) malloc(sizeof(Font))) == NULL){
+     printf("in CreateFont malloc() Error!\n");
+@@ -217,22 +217,20 @@
+ }
+        
+ 
++Private int   FNTWVOpenFont();
+ Private int
+ OpenFont(obj)
+   FontObj *obj;
+ {
+-  Private int   FNTWVOpenFont();
+-
+   return FNTWVOpenFont((Font*) obj->Locals);
+ }
+ 
+ 
++Private int   FNTWVCloseFont();
+ Private int
+ CloseFont(obj)
+   FontObj  *obj;
+ {
+-  Private int   FNTWVCloseFont();
+-
+   return FNTWVCloseFont((Font*) obj->Locals);
+ }
+ 
diff -urN -x CVS -x work /usr/ports/japanese/vflib/files/patch-fman.c ./files/patch-fman.c
--- /usr/ports/japanese/vflib/files/patch-fman.c	Thu Jan  1 09:00:00 1970
+++ ./files/patch-fman.c	Mon Jun  4 16:09:49 2007
@@ -0,0 +1,115 @@
+--- src/fman.c.orig	Mon May 10 17:05:20 1999
++++ src/fman.c	Mon Jun  4 16:08:50 2007
+@@ -471,6 +471,14 @@
+ }
+ 
+ 
++Private void
++ReturnCache(cptr)
++  CACHE  *cptr;
++{
++  CDR_FREE_LIST(cptr) = FREE_LIST();
++  FREE_LIST() = cptr;
++}
++
+ /*
+  * CacheIt() --- cache it.  The cache slot is moved into
+  *   the head of the LRU list.
+@@ -480,7 +488,6 @@
+      int port;
+ {
+   CACHE         *cptr;
+-  Private void  ReturnCache();
+ 
+   if ((cptr = RequireCache()) == (CACHE*)NULL){
+     fprintf(stderr, "VFlib: CacheIt() - error\n");
+@@ -521,19 +528,36 @@
+   return cptr;
+ }
+ 
+-Private void
+-ReturnCache(cptr)
+-  CACHE  *cptr;
+-{
+-  CDR_FREE_LIST(cptr) = FREE_LIST();
+-  FREE_LIST() = cptr;
+-}
+-
+ 
+ /**
+  ** LRU LIST  
+  **/
+ 
++Private int
++LRUPutTop2(cptr, f)
++     CACHE  *cptr;
++     int    f;
++{
++  CACHE       *cptr_f;
++  FILE_Port   port;
++  int         val;
++
++  cptr_f              = CacheLRUList.l_forw;
++  cptr->l_forw        = cptr_f;
++  cptr_f->l_back      = cptr;
++  cptr->l_back        = &CacheLRUList;
++  CacheLRUList.l_forw = cptr;
++
++  val = 0;
++  if (f == TRUE){
++    port = cptr->port;
++    if (VFFM_Internal_Open(port) < 0)
++      val = -1;
++  }
++
++  return val; 
++}
++
+ /* LRUMoveTop()  - moves a cache block into the top of LRU list.
+  *   THE CACHE *MUST* BE IN LRU LIST.
+  */
+@@ -542,7 +566,6 @@
+   CACHE  *cptr;
+ {
+   CACHE       *cptr_b, *cptr_f;
+-  Private int LRUPutTop2();
+ 
+   cptr_b         = cptr->l_back;
+   cptr_f         = cptr->l_forw;
+@@ -558,36 +581,9 @@
+ LRUPutTop(cptr)
+   CACHE  *cptr;
+ {
+-  Private int LRUPutTop2();
+-
+   return LRUPutTop2(cptr, TRUE);
+ }
+   
+-Private int
+-LRUPutTop2(cptr, f)
+-     CACHE  *cptr;
+-     int    f;
+-{
+-  CACHE       *cptr_f;
+-  FILE_Port   port;
+-  int         val;
+-
+-  cptr_f              = CacheLRUList.l_forw;
+-  cptr->l_forw        = cptr_f;
+-  cptr_f->l_back      = cptr;
+-  cptr->l_back        = &CacheLRUList;
+-  CacheLRUList.l_forw = cptr;
+-
+-  val = 0;
+-  if (f == TRUE){
+-    port = cptr->port;
+-    if (VFFM_Internal_Open(port) < 0)
+-      val = -1;
+-  }
+-
+-  return val; 
+-}
+-
+ 
+ Private int 
+ LRUDeleteTail()



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706040909.l54990vi047838>