svn commit: r448596 - in head/devel/rhtvision: . files

Tobias C. Berner tcberner at FreeBSD.org
Wed Aug 23 10:51:53 UTC 2017


Author: tcberner
Date: Wed Aug 23 10:51:51 2017
New Revision: 448596
URL: https://svnweb.freebsd.org/changeset/ports/448596

Log:
  Add patches to fix build with gcc6
  
  - Add patches to work around abs() amibguity.
  - Explicitly pass -std=gnu++03 to the compiler.
  
  PR:		219275

Added:
  head/devel/rhtvision/files/patch-classes_tdesktop.cc   (contents, props changed)
  head/devel/rhtvision/files/patch-classes_tdisplay.cc   (contents, props changed)
Modified:
  head/devel/rhtvision/Makefile

Modified: head/devel/rhtvision/Makefile
==============================================================================
--- head/devel/rhtvision/Makefile	Wed Aug 23 10:46:51 2017	(r448595)
+++ head/devel/rhtvision/Makefile	Wed Aug 23 10:51:51 2017	(r448596)
@@ -3,7 +3,7 @@
 
 PORTNAME=	rhtvision
 PORTVERSION=	2.2.1.1
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	devel
 MASTER_SITES=	SF/tvision/UNIX/${PORTVERSION:R}%20CVS20100714%20Source%20and%20Debian%205.0
 DISTNAME=	${PORTNAME}_${PORTVERSION:R}-${PORTVERSION:E}
@@ -27,6 +27,9 @@ USE_LDCONFIG=	yes
 
 CFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
+
+# The port does not build with C++11 or later (bug 219275).
+USE_CXXSTD=     gnu++03
 
 PLIST_SUB=	VERSION="${PORTVERSION:R}"
 

Added: head/devel/rhtvision/files/patch-classes_tdesktop.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/rhtvision/files/patch-classes_tdesktop.cc	Wed Aug 23 10:51:51 2017	(r448596)
@@ -0,0 +1,23 @@
+--- classes/tdesktop.cc.orig	2017-08-18 14:40:03 UTC
++++ classes/tdesktop.cc
+@@ -26,6 +26,11 @@ Modified cursor behavior while desktop locked by Salva
+ #define Uses_TVCodePage
+ #include <tv.h>
+ 
++inline unsigned int absdiff(unsigned int a, unsigned int b)
++{
++    return (a>=b)?a-b:b-a;
++}
++
+ TDeskInit::TDeskInit( TBackground *(*cBackground)( TRect ) ) :
+     createBackground( cBackground )
+ {
+@@ -144,7 +149,7 @@ unsigned iSqr( unsigned i )
+ {
+     unsigned res1 = 2;
+     unsigned res2 = i/res1;
+-    while( abs( res1 - res2 ) > 1 )
++    while( absdiff(res1,res2) > 1 )
+         {
+         res1 = (res1 + res2)/2;
+         res2 = i/res1;

Added: head/devel/rhtvision/files/patch-classes_tdisplay.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/rhtvision/files/patch-classes_tdisplay.cc	Wed Aug 23 10:51:51 2017	(r448596)
@@ -0,0 +1,41 @@
+--- classes/tdisplay.cc.orig	2017-08-18 14:39:55 UTC
++++ classes/tdisplay.cc
+@@ -22,6 +22,11 @@ same used in original Turbo Vision for compatibility p
+ #define Uses_TVCodePage
+ #include <tv.h>
+ 
++inline unsigned int absdiff(unsigned int a, unsigned int b)
++{
++    return (a>=b)?a-b:b-a;
++}
++
+ // Remove me please!
+ int TDisplay::dual_display=0;
+ 
+@@ -381,10 +386,10 @@ Boolean TDisplay::searchClosestRes(TScreenResolution *
+  if (firstXMatch!=-1)
+    {// Return the closest y that match x
+     i=indexMin=firstXMatch;
+-    minDif=abs(res[i].y-y);
++    minDif=absdiff(res[i].y,y);
+     while (++i<cant && res[i].x==x)
+       {
+-       dif=abs(res[i].y-y);
++       dif=absdiff(res[i].y,y);
+        if (dif<minDif)
+          {
+           minDif=dif;
+@@ -396,11 +401,11 @@ Boolean TDisplay::searchClosestRes(TScreenResolution *
+    }
+  // No x match, looks the one with minimum differences
+  indexMin=0;
+- minDif=abs(res[0].y-y)+abs(res[0].x-x);
++ minDif=absdiff(res[0].y,y)+absdiff(res[0].x,x);
+  i=1;
+  while (i<cant)
+    {
+-    dif=abs(res[i].y-y)+abs(res[i].x-x);
++    dif=absdiff(res[i].y,y)+absdiff(res[i].x,x);
+     if (dif<minDif)
+       {
+        minDif=dif;


More information about the svn-ports-all mailing list