Skip site navigation (1)Skip section navigation (2)
Date:      Fri,  1 Dec 2006 20:08:30 -0800 (PST)
From:      Peter Johnson <johnson.peter@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/106197: [PATCH] devel/ixlib: Fix C++ BROKENness
Message-ID:  <20061202040830.ADB9918E0F@cvs.tortall.net>
Resent-Message-ID: <200612020410.kB24A15U073629@freefall.freebsd.org>

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

>Number:         106197
>Category:       ports
>Synopsis:       [PATCH] devel/ixlib: Fix C++ BROKENness
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 02 04:10:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Peter Johnson
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD 6.1-RELEASE
>Description:
Fix bad C++, which currently has the port marked as BROKEN on >= 5.x
(>= gcc 3.4.2).
>How-To-Repeat:
Marked BROKEN on >= 5.x (due to bad C++)
>Fix:
Patch attached.  I didn't completely mark unbroken, as I don't have a
non-i386 machine to test on.  Now that the C++ code is fixed this will
be easier to test.

--- unbreak-ixlib.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/devel/ixlib/Makefile,v
retrieving revision 1.23
diff -u -r1.23 Makefile
--- Makefile	5 Nov 2006 08:14:47 -0000	1.23
+++ Makefile	2 Dec 2006 04:02:51 -0000
@@ -8,7 +8,7 @@
 
 PORTNAME=	ixlib
 PORTVERSION=	0.96.2
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
@@ -27,8 +27,8 @@
 
 .include <bsd.port.pre.mk>
 
-.if ${ARCH} != "i386" || ${OSVERSION} >= 500000
-BROKEN=		Does not compile on !i386 or on FreeBSD >= 5.x
+.if ${ARCH} != "i386"
+BROKEN=		Does not compile on !i386
 .endif
 
 pre-configure:
Index: files/patch-src::ixlib_garbage.hh
===================================================================
RCS file: files/patch-src::ixlib_garbage.hh
diff -N files/patch-src::ixlib_garbage.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src::ixlib_garbage.hh	2 Dec 2006 04:02:51 -0000
@@ -0,0 +1,227 @@
+--- src/ixlib_garbage.hh.orig	Tue Jun 19 16:16:29 2001
++++ src/ixlib_garbage.hh	Fri Dec  1 19:56:04 2006
+@@ -126,24 +126,24 @@
+       // compiler generates one, which is *ahem* - fatal
+       ref(ref const &src)
+         : ref_base<T>(src) {
+-	reference_manager_keeper<T_Managed>::Manager.addReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance);
+ 	}
+       template<class T2>
+       ref(ref<T2,T_Managed> const &src)
+         : ref_base<T>(src.get()) {
+-	reference_manager_keeper<T_Managed>::Manager.addReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance);
+ 	}
+       template<class T2>
+       ref(no_free_ref<T2,T_Managed> const &src)
+         : ref_base<T>(src.get()) {
+-	reference_manager_keeper<T_Managed>::Manager.addReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance);
+ 	}
+       ref(T *instance = NULL)
+         : ref_base<T>(instance) {
+-	reference_manager_keeper<T_Managed>::Manager.addReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance);
+ 	}
+       ~ref() {
+-        reference_manager_keeper<T_Managed>::Manager.freeReference(Instance);
++        reference_manager_keeper<T_Managed>::Manager.freeReference(this->Instance);
+ 	}
+ 	
+       ref &operator=(ref const &src) {
+@@ -157,20 +157,20 @@
+       
+       // methods
+       void release() {
+-	reference_manager_keeper<T_Managed>::Manager.freeReference(Instance);
+-	Instance = NULL;
++	reference_manager_keeper<T_Managed>::Manager.freeReference(this->Instance);
++	this->Instance = NULL;
+ 	}
+       void set(T *instance) {
+-        if (instance == Instance) return;
++        if (instance == this->Instance) return;
+ 	
+-	reference_manager_keeper<T_Managed>::Manager.freeReference(Instance);
+-	Instance = instance;
+-	reference_manager_keeper<T_Managed>::Manager.addReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.freeReference(this->Instance);
++	this->Instance = instance;
++	reference_manager_keeper<T_Managed>::Manager.addReference(this->Instance);
+         }
+       T *releaseFromGCArena() {
+-        T *oldinst = Instance;
+-	reference_manager_keeper<T_Managed>::Manager.forgetReference(Instance);
+-	Instance = NULL;
++        T *oldinst = this->Instance;
++	reference_manager_keeper<T_Managed>::Manager.forgetReference(this->Instance);
++	this->Instance = NULL;
+ 	return oldinst;
+         }
+     };
+@@ -200,24 +200,24 @@
+       // compiler generates one, which is *ahem* - fatal
+       no_free_ref(no_free_ref const &src)
+         : ref_base<T>(src) {
+-	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance);
+ 	}
+       template<class T2>
+       no_free_ref(ref<T2,T_Managed> const &src)
+         : ref_base<T>(src.get()) {
+-	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance);
+ 	}
+       template<class T2>
+       no_free_ref(no_free_ref<T2,T_Managed> const &src)
+         : ref_base<T>(src.get()) {
+-	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance);
+ 	}
+       no_free_ref(T *instance = NULL)
+         : ref_base<T>(instance) {
+-	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance);
+ 	}
+       ~no_free_ref() {
+-        reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(Instance);
++        reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(this->Instance);
+ 	}
+ 	
+       // assignment
+@@ -232,20 +232,20 @@
+       
+       // methods
+       void release() {
+-	reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(Instance);
+-	Instance = NULL;
++	reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(this->Instance);
++	this->Instance = NULL;
+ 	}
+       void set(T *instance) {
+-        if (instance == Instance) return;
++        if (instance == this->Instance) return;
+ 	
+-	reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(Instance);
+-	Instance = instance;
+-	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(Instance);
++	reference_manager_keeper<T_Managed>::Manager.removeNoFreeReference(this->Instance);
++	this->Instance = instance;
++	reference_manager_keeper<T_Managed>::Manager.addNoFreeReference(this->Instance);
+         }
+       T *releaseFromGCArena() {
+-        T *oldinst = Instance;
+-	reference_manager_keeper<T_Managed>::Manager.forgetReference(Instance);
+-	Instance = NULL;
++        T *oldinst = this->Instance;
++	reference_manager_keeper<T_Managed>::Manager.forgetReference(this->Instance);
++	this->Instance = NULL;
+ 	return oldinst;
+         }
+     };
+@@ -265,14 +265,14 @@
+     public:
+       dynamic_ref(dynamic_ref const &src)
+         : ref_base<T>(src),Manager(src.Manager) {
+-	Manager.addReference(Instance);
++	Manager.addReference(this->Instance);
+ 	}
+       dynamic_ref(reference_manager<T> &mgr,T *instance = NULL)
+         : ref_base<T>(instance),Manager(mgr) {
+-	Manager.addReference(Instance);
++	Manager.addReference(this->Instance);
+ 	}
+       ~dynamic_ref() {
+-        Manager.freeReference(Instance);
++        Manager.freeReference(this->Instance);
+ 	}
+       
+       // assignment
+@@ -287,20 +287,20 @@
+ 
+       // methods
+       void release() {
+-	Manager.freeReference(Instance);
+-	Instance = NULL;
++	Manager.freeReference(this->Instance);
++	this->Instance = NULL;
+ 	}
+       void set(T *instance) {
+-        if (instance == Instance) return;
++        if (instance == this->Instance) return;
+ 	
+-	Manager.freeReference(Instance);
+-	Instance = instance;
+-	Manager.addReference(Instance);
++	Manager.freeReference(this->Instance);
++	this->Instance = instance;
++	Manager.addReference(this->Instance);
+         }
+       T *releaseFromGCArena() {
+-        T *oldinst = Instance;
+-	Manager.forgetReference(Instance);
+-	Instance = NULL;
++        T *oldinst = this->Instance;
++	Manager.forgetReference(this->Instance);
++	this->Instance = NULL;
+ 	return oldinst;
+         }
+     };
+@@ -330,14 +330,14 @@
+     public:
+       no_free_dynamic_ref(no_free_dynamic_ref const &src)
+         : ref_base<T>(src),Manager(src.Manager) {
+-	Manager.addNoFreeReference(Instance);
++	Manager.addNoFreeReference(this->Instance);
+ 	}
+       no_free_dynamic_ref(reference_manager<T> &mgr,T *instance = NULL)
+         : ref_base<T>(instance),Manager(mgr) {
+-	Manager.addNoFreeReference(Instance);
++	Manager.addNoFreeReference(this->Instance);
+ 	}
+       ~no_free_dynamic_ref() {
+-        Manager.removeNoFreeReference(Instance);
++        Manager.removeNoFreeReference(this->Instance);
+ 	}
+       
+       // assignment
+@@ -352,20 +352,20 @@
+ 
+       // methods
+       void release() {
+-	Manager.removeNoFreeReference(Instance);
+-	Instance = NULL;
++	Manager.removeNoFreeReference(this->Instance);
++	this->Instance = NULL;
+ 	}
+       void set(T *instance) {
+-        if (instance == Instance) return;
++        if (instance == this->Instance) return;
+ 	
+-	Manager.removeNoFreeReference(Instance);
+-	Instance = instance;
+-	Manager.addNoFreeReference(Instance);
++	Manager.removeNoFreeReference(this->Instance);
++	this->Instance = instance;
++	Manager.addNoFreeReference(this->Instance);
+         }
+       T *releaseFromGCArena() {
+-        T *oldinst = Instance;
+-	Manager.forgetReference(Instance);
+-	Instance = NULL;
++        T *oldinst = this->Instance;
++	Manager.forgetReference(this->Instance);
++	this->Instance = NULL;
+ 	return oldinst;
+         }
+     };
+@@ -482,7 +482,7 @@
+ 
+ 
+   #define IXLIB_GARBAGE_DECLARE_MANAGER(TYPE) \
+-    ixion::reference_manager<TYPE> ixion::reference_manager_keeper<TYPE>::Manager;
++    template <> ixion::reference_manager<TYPE> ixion::reference_manager_keeper<TYPE>::Manager = ixion::reference_manager<TYPE>();
+   }
+ 
+ 
Index: files/patch-src::ixlib_numeric.hh
===================================================================
RCS file: files/patch-src::ixlib_numeric.hh
diff -N files/patch-src::ixlib_numeric.hh
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src::ixlib_numeric.hh	2 Dec 2006 04:02:51 -0000
@@ -0,0 +1,67 @@
+--- src/ixlib_numeric.hh.orig	Thu Mar 22 16:16:25 2001
++++ src/ixlib_numeric.hh	Thu Nov 30 23:11:52 2006
+@@ -67,56 +67,56 @@
+ 
+ 
+ // Primitive inlines ---------------------------------------------------------
+-  inline signed short ixion::sgn(signed long value) {
++  inline signed short sgn(signed long value) {
+     return (value<0) ? -1 : ( (value>0) ? 1 : 0);
+     }
+   
+   
+   
+   
+-  inline bool ixion::getBit(unsigned long value,char bit) {
++  inline bool getBit(unsigned long value,char bit) {
+     return (value >> bit) & 1;
+     }
+   
+   
+   
+   
+-  inline TUnsigned8 ixion::hiByte(TUnsigned16 value) {
++  inline TUnsigned8 hiByte(TUnsigned16 value) {
+     return value >> 8;
+     }
+   
+   
+   
+   
+-  inline TUnsigned16 ixion::hiWord(TUnsigned32 value) {
++  inline TUnsigned16 hiWord(TUnsigned32 value) {
+     return value >> 16;
+     }
+   
+   
+   
+   
+-  inline TUnsigned8 ixion::loByte(TUnsigned16 value) {
++  inline TUnsigned8 loByte(TUnsigned16 value) {
+     return value & 0xff;
+     }
+   
+   
+   
+   
+-  inline TUnsigned16 ixion::loWord(TUnsigned32 value) {
++  inline TUnsigned16 loWord(TUnsigned32 value) {
+     return value & 0xffff;
+     }
+   
+   
+   
+   
+-  inline TUnsigned16 ixion::makeWord(TUnsigned8 hi,TUnsigned8 lo) {
++  inline TUnsigned16 makeWord(TUnsigned8 hi,TUnsigned8 lo) {
+     return (TUnsigned16) hi << 8 | lo;
+     }
+   
+   
+   
+   
+-  inline TUnsigned32 ixion::makeDWord(TUnsigned16 hi,TUnsigned16 lo) {
++  inline TUnsigned32 makeDWord(TUnsigned16 hi,TUnsigned16 lo) {
+     return (TUnsigned32) hi << 16 | lo;
+     }
+   }
Index: files/patch-src::ixlib_re.hh
===================================================================
RCS file: /home/ncvs/ports/devel/ixlib/files/patch-src::ixlib_re.hh,v
retrieving revision 1.1
diff -u -r1.1 patch-src::ixlib_re.hh
--- files/patch-src::ixlib_re.hh	30 Nov 2003 18:11:13 -0000	1.1
+++ files/patch-src::ixlib_re.hh	2 Dec 2006 04:02:51 -0000
@@ -1,5 +1,5 @@
---- src/ixlib_re.hh.orig	Fri Nov 28 11:46:14 2003
-+++ src/ixlib_re.hh	Fri Nov 28 11:53:24 2003
+--- src/ixlib_re.hh.orig	Tue Jun 19 16:16:29 2001
++++ src/ixlib_re.hh	Fri Dec  1 18:36:04 2006
 @@ -163,7 +163,7 @@
      
          struct backtrack_stack_entry {
@@ -9,3 +9,48 @@
            };
    
          public:
+@@ -210,7 +210,7 @@
+       class any_matcher : public matcher {
+         public:
+           any_matcher() { 
+-            MatchLength = 1; 
++            this->MatchLength = 1; 
+             }
+ 
+ 	  matcher *duplicate() const;
+@@ -229,7 +229,7 @@
+       class start_matcher : public matcher {
+         public:
+           start_matcher() { 
+-            MatchLength = 0; 
++            this->MatchLength = 0; 
+             }
+ 
+ 	  matcher *duplicate() const;
+@@ -246,7 +246,7 @@
+       class end_matcher : public matcher {
+         public:
+           end_matcher() { 
+-            MatchLength = 0;
++            this->MatchLength = 0;
+             }
+ 
+ 	  matcher *duplicate() const;
+@@ -263,7 +263,7 @@
+       class backref_open_matcher : public matcher {
+         public:
+           backref_open_matcher() { 
+-            MatchLength = 0; 
++            this->MatchLength = 0; 
+             }
+ 
+ 	  matcher *duplicate() const;
+@@ -280,7 +280,7 @@
+       class backref_close_matcher : public matcher {
+         public:
+           backref_close_matcher() { 
+-            MatchLength = 0; 
++            this->MatchLength = 0; 
+             }
+ 
+ 	  matcher *duplicate() const;
Index: files/patch-src::ixlib_re_impl.hh
===================================================================
RCS file: /home/ncvs/ports/devel/ixlib/files/patch-src::ixlib_re_impl.hh,v
retrieving revision 1.1
diff -u -r1.1 patch-src::ixlib_re_impl.hh
--- files/patch-src::ixlib_re_impl.hh	30 Nov 2003 18:11:13 -0000	1.1
+++ files/patch-src::ixlib_re_impl.hh	2 Dec 2006 04:02:51 -0000
@@ -1,5 +1,5 @@
---- src/ixlib_re_impl.hh.orig	Fri Nov 28 11:43:40 2003
-+++ src/ixlib_re_impl.hh	Fri Nov 28 12:55:23 2003
+--- src/ixlib_re_impl.hh.orig	Tue Jun 19 16:16:29 2001
++++ src/ixlib_re_impl.hh	Fri Dec  1 18:38:10 2006
 @@ -38,7 +38,7 @@
  
  
@@ -36,7 +36,42 @@
    quantifier *dupe = new quantifier();
    dupe->copy(this);
    return dupe;
-@@ -328,7 +328,7 @@
+@@ -239,7 +239,7 @@
+   if (quant_min == 0) quant_min = 1;
+   
+   TSize max_count = candidate.size() - at;
+-  if (Next) max_count -= Next->minimumSubsequentMatchLength();
++  if (this->Next) max_count -= this->Next->minimumSubsequentMatchLength();
+   max_count = max_count/quant_min + 1;
+   
+   if (MaxValid) max_count = NUM_MIN(max_count,MaxCount);
+@@ -278,7 +278,7 @@
+       }
+     
+     if (successful_indices.size()) {
+-      MatchLength = successful_indices.top().Index - at;
++      this->MatchLength = successful_indices.top().Index - at;
+       return true;
+       }
+     else return false;
+@@ -286,7 +286,7 @@
+   else {
+     for (TSize c = 0;c <= remcount;c++) {
+       if (matchNext(brstack,candidate,idx)) {
+-        MatchLength = idx-at;
++        this->MatchLength = idx-at;
+         return true;
+         }
+       // following part runs once too much, effectively: 
+@@ -321,14 +321,14 @@
+ template<class T>
+ ixion::regex<T>::sequence_matcher::sequence_matcher(T const &matchstr)
+   : MatchStr(matchstr) { 
+-  MatchLength = MatchStr.size(); 
++  this->MatchLength = MatchStr.size(); 
+   }
+ 
+ 
  
  
  template<class T>
@@ -135,7 +170,7 @@
    matcher::setNext(next);
    Connector.setNext(next,false);
    }
-@@ -524,7 +524,7 @@
+@@ -524,13 +524,13 @@
  
  template<class T>
  bool ixion::regex<T>::alternative_matcher::match(backref_stack &brstack,T const &candidate,TIndex at) {
@@ -143,10 +178,21 @@
 +  typename std::vector<matcher *>::iterator first = AltList.begin(),last = AltList.end();
    while (first != last) {
      if ((*first)->match(brstack,candidate,at)) {
-       MatchLength = 0;
-@@ -548,7 +548,7 @@
+-      MatchLength = 0;
++      this->MatchLength = 0;
+       matcher const *object = *first;
+       while (object != &Connector) {
+-        MatchLength += object->getMatchLength();
++        this->MatchLength += object->getMatchLength();
+         object = object->getNext();
+         }
+       return true;
+@@ -546,9 +546,9 @@
+ template<class T>
+ void ixion::regex<T>::alternative_matcher::copy(alternative_matcher const *src) {
    super::copy(src);
-   Connector.setNext(Next,false);
+-  Connector.setNext(Next,false);
++  Connector.setNext(this->Next,false);
    
 -  FOREACH_CONST(first,src->AltList,alt_list)
 +  FOREACH_CONST_T(first,src->AltList,alt_list)
@@ -162,3 +208,12 @@
    backref_matcher *dupe = new backref_matcher(Backref);
    dupe->copy(this);
    return dupe;
+@@ -577,7 +577,7 @@
+ template<class T>
+ bool ixion::regex<T>::backref_matcher::match(backref_stack &brstack,T const &candidate,TIndex at) {
+   T matchstr = brstack.get(Backref,candidate);
+-  MatchLength = matchstr.size();
++  this->MatchLength = matchstr.size();
+ 
+   if (at+matchstr.size() > candidate.size()) return false;
+   return (T(candidate.begin()+at,candidate.begin()+at+matchstr.size()) == matchstr) &&
Index: files/patch-src::lex.xml.cc
===================================================================
RCS file: files/patch-src::lex.xml.cc
diff -N files/patch-src::lex.xml.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src::lex.xml.cc	2 Dec 2006 04:02:51 -0000
@@ -0,0 +1,16 @@
+--- src/lex.xml.cc.orig	Tue Oct 23 12:24:43 2001
++++ src/lex.xml.cc	Fri Dec  1 18:57:06 2006
+@@ -24,9 +24,12 @@
+ #ifdef __cplusplus
+ 
+ #include <stdlib.h>
+-#include <fstream>
++#include <iostream>
+ using std::istream;
+ using std::ostream;
++using std::cin;
++using std::cout;
++using std::cerr;
+ #include <unistd.h>
+ 
+ /* Use prototypes in function declarations. */
Index: files/patch-src::re.cc
===================================================================
RCS file: files/patch-src::re.cc
diff -N files/patch-src::re.cc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-src::re.cc	2 Dec 2006 04:02:51 -0000
@@ -0,0 +1,11 @@
+--- src/re.cc.orig	Tue Jun 19 16:16:29 2001
++++ src/re.cc	Fri Dec  1 18:37:32 2006
+@@ -26,7 +26,7 @@
+ 
+ 
+ // Template instantiations ----------------------------------------------------
+-template regex<string>;
++template class regex<string>;
+ 
+ 
+ 
--- unbreak-ixlib.patch ends here ---


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



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