mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
- Fix build with gcc 4.2
PR: 117789 Submitted by: Pietro Cerutti <gahr@gahr.ch> Approved by: portmgr (pav)
This commit is contained in:
parent
9fe1834c7a
commit
9e988e2e8e
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=202507
12 changed files with 221 additions and 16 deletions
|
@ -10,8 +10,7 @@ PORTNAME= clint
|
|||
PORTVERSION= 0.1.2
|
||||
PORTREVISION= 4
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
MASTER_SITE_SUBDIR= ${PORTNAME}
|
||||
MASTER_SITES= SF
|
||||
|
||||
MAINTAINER= ports@FreeBSD.org
|
||||
COMMENT= A static source code checker for C++
|
||||
|
@ -25,16 +24,10 @@ USE_LDCONFIG= yes
|
|||
|
||||
INFO= clint
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OSVERSION} >= 700042
|
||||
BROKEN= Broken with gcc 4.2
|
||||
.endif
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
|
||||
@${FIND} ${WRKSRC} -name "Makefile.in" | ${XARGS} ${REINPLACE_CMD} -e \
|
||||
's|-pedantic||g ; \
|
||||
s|-ldl||g'
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
|
160
devel/clint/files/patch-lib-python-mapbase.cc
Normal file
160
devel/clint/files/patch-lib-python-mapbase.cc
Normal file
|
@ -0,0 +1,160 @@
|
|||
--- lib/python/mapbase.cc.orig 2007-11-03 16:17:47.000000000 +0100
|
||||
+++ lib/python/mapbase.cc 2007-11-03 16:18:22.000000000 +0100
|
||||
@@ -2,30 +2,30 @@
|
||||
#include "python.h"
|
||||
|
||||
namespace python {
|
||||
-export template<class T>
|
||||
- MapBase<T>::MapBase<T> (PyObject *pyob, bool owned): Object(pyob, owned) {
|
||||
+ template<class T>
|
||||
+ MapBase<T>::MapBase (PyObject *pyob, bool owned): Object(pyob, owned) {
|
||||
validate();
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
- MapBase<T>::MapBase<T> (const MapBase<T>& ob): Object(ob) {
|
||||
+ template<class T>
|
||||
+ MapBase<T>::MapBase (const MapBase<T>& ob): Object(ob) {
|
||||
validate();
|
||||
}
|
||||
// Assignment acquires new ownership of pointer
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
MapBase<T>& MapBase<T>::operator= (const Object& rhs) {
|
||||
return (*this = *rhs);
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
MapBase<T>& MapBase<T>::operator= (PyObject* rhsp) {
|
||||
if(ptr() == rhsp) return *this;
|
||||
set (rhsp);
|
||||
return *this;
|
||||
}
|
||||
// Membership
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
bool MapBase<T>::accepts (PyObject *pyob) const {
|
||||
return pyob && PyMapping_Check(pyob);
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
// Clear -- PyMapping Clear is missing
|
||||
//
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
void MapBase<T>::clear () {
|
||||
List k = keys();
|
||||
for(List::iterator i = k.begin(); i != k.end(); i++) {
|
||||
@@ -42,54 +42,54 @@
|
||||
}
|
||||
|
||||
// Element Access
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
T MapBase<T>::operator[](const std::string& key) const {
|
||||
return get_item(key);
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
T MapBase<T>::operator[](const Object& key) const {
|
||||
return get_item(key);
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
mapref<T> MapBase<T>::operator[](const std::string& key) {
|
||||
return mapref<T>(*this, key);
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
mapref<T> MapBase<T>::operator[](const Object& key) {
|
||||
return mapref<T>(*this, key);
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
int MapBase<T>::length () const {
|
||||
return PyMapping_Length (ptr());
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
int MapBase<T>::has_key (const std::string& s) const {
|
||||
return PyMapping_HasKeyString (ptr(),const_cast<char*>(s.c_str()));
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
int MapBase<T>::has_key (const Object& s) const {
|
||||
return PyMapping_HasKey (ptr(), s.ptr());
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
T MapBase<T>::get_item (const std::string& s) const {
|
||||
PyObject * tmp = (PyMapping_GetItemString (ptr(),const_cast<char*>(s.c_str())));
|
||||
if ( tmp == NULL ) { throw KeyError(s + " does not exist in " + this->as_string()); }
|
||||
return T( asObject(tmp));
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
T MapBase<T>::get_item (const Object& s) const {
|
||||
return T( asObject(PyObject_GetItem (ptr(), s.ptr())));
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
void MapBase<T>::set_item (const std::string& s, const Object& ob) {
|
||||
if (PyMapping_SetItemString (ptr(), const_cast<char*>(s.c_str()), *ob)
|
||||
== -1)
|
||||
@@ -98,7 +98,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
void MapBase<T>::set_item (const Object& s, const Object& ob) {
|
||||
if (PyObject_SetItem (ptr(), s.ptr(), ob.ptr())
|
||||
== -1)
|
||||
@@ -107,31 +107,31 @@
|
||||
}
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
void MapBase<T>::del_item (const std::string& s) {
|
||||
if (PyMapping_DelItemString (ptr(), const_cast<char*>(s.c_str())) == -1){
|
||||
throw Exception();
|
||||
}
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
void MapBase<T>::del_item (const Object& s) {
|
||||
if (PyMapping_DelItem (ptr(), *s) == -1){
|
||||
throw Exception();
|
||||
}
|
||||
}
|
||||
// Queries
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
List MapBase<T>::keys () const {
|
||||
return List(PyMapping_Keys(ptr()), true);
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
List MapBase<T>::values () const { // each returned item is a (key, value) pair
|
||||
return List(PyMapping_Values(ptr()), true);
|
||||
}
|
||||
|
||||
- export template<class T>
|
||||
+ template<class T>
|
||||
List MapBase<T>::items () const {
|
||||
return List(PyMapping_Items(ptr()), true);
|
||||
}
|
20
devel/clint/files/patch-lib-python-mapref.cc
Normal file
20
devel/clint/files/patch-lib-python-mapref.cc
Normal file
|
@ -0,0 +1,20 @@
|
|||
--- lib/python/mapref.cc.orig 2007-11-03 16:16:58.000000000 +0100
|
||||
+++ lib/python/mapref.cc 2007-11-03 16:17:25.000000000 +0100
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace python {
|
||||
template <class T>
|
||||
- mapref<T>::mapref<T> (MapBase<T>& map, const std::string& k)
|
||||
+ mapref<T>::mapref (MapBase<T>& map, const std::string& k)
|
||||
: s(map), the_item()
|
||||
{
|
||||
key = String(k);
|
||||
@@ -10,7 +10,7 @@
|
||||
};
|
||||
|
||||
template <class T>
|
||||
- mapref<T>::mapref<T> (MapBase<T>& map, const Object& k)
|
||||
+ mapref<T>::mapref (MapBase<T>& map, const Object& k)
|
||||
: s(map), key(k), the_item()
|
||||
{
|
||||
if(map.hasKey(key)) the_item = map.getItem(key);
|
11
devel/clint/files/patch-lib-python-python.cc
Normal file
11
devel/clint/files/patch-lib-python-python.cc
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- lib/python/python.cc.orig 2007-11-03 16:32:34.000000000 +0100
|
||||
+++ lib/python/python.cc 2007-11-03 16:33:48.000000000 +0100
|
||||
@@ -115,6 +115,8 @@
|
||||
} else {
|
||||
return import_module(modname);
|
||||
}
|
||||
+
|
||||
+ return (NULL);
|
||||
}
|
||||
|
||||
// }}}
|
|
@ -1,6 +1,6 @@
|
|||
--- lib/python/python.h.orig Mon Apr 16 12:53:21 2001
|
||||
+++ lib/python/python.h Thu Nov 30 22:25:14 2006
|
||||
@@ -3,6 +3,22 @@
|
||||
--- lib/python/python.h.orig 2001-04-16 21:53:21.000000000 +0200
|
||||
+++ lib/python/python.h 2007-11-03 16:31:32.000000000 +0100
|
||||
@@ -3,22 +3,42 @@
|
||||
|
||||
#pragma interface
|
||||
|
||||
|
@ -23,7 +23,10 @@
|
|||
#include <Python.h>
|
||||
#include <string>
|
||||
#include <iterator>
|
||||
@@ -12,13 +28,17 @@
|
||||
#include <utility>
|
||||
-#include <strstream>
|
||||
+#include <sstream>
|
||||
#include "exceptions.h"
|
||||
#include "debug.h"
|
||||
|
||||
// I hate #define macros, seee if I can remove this
|
|
@ -1,5 +1,5 @@
|
|||
--- lib/python/seqbase_iter.cc.orig Mon Apr 16 12:53:23 2001
|
||||
+++ lib/python/seqbase_iter.cc Thu Nov 30 22:09:39 2006
|
||||
--- lib/python/seqbase_iter.cc.orig 2001-04-16 21:53:23.000000000 +0200
|
||||
+++ lib/python/seqbase_iter.cc 2007-11-03 16:39:31.000000000 +0100
|
||||
@@ -61,7 +61,7 @@
|
||||
return seqref<T>(*seq, count + i);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
|||
SeqBase<T>::iterator& SeqBase<T>::iterator::operator-=(int n) {
|
||||
count = count - n;
|
||||
return *this;
|
||||
@@ -99,16 +99,16 @@
|
||||
@@ -99,21 +99,22 @@
|
||||
}
|
||||
|
||||
// prefix ++
|
||||
|
@ -58,3 +58,10 @@
|
|||
SeqBase<T>::iterator SeqBase<T>::iterator::operator-- (int) { return iterator(seq, count--);}
|
||||
|
||||
template<class T>
|
||||
std::string SeqBase<T>::iterator::diagnose() const {
|
||||
- std::ostrstream oss;
|
||||
+ std::ostringstream oss;
|
||||
+ //std::ostrstream oss;
|
||||
oss << "iterator diagnosis " << seq << ", " << count << std::ends;
|
||||
return std::string(oss.str());
|
||||
}
|
11
devel/clint/files/patch-src-clint.cc
Normal file
11
devel/clint/files/patch-src-clint.cc
Normal file
|
@ -0,0 +1,11 @@
|
|||
--- src/clint.cc.orig 2007-11-03 16:42:29.000000000 +0100
|
||||
+++ src/clint.cc 2007-11-03 16:42:48.000000000 +0100
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "plugin.h"
|
||||
#include <stdexcept>
|
||||
#include "rule.h"
|
||||
-#include <iostream.h>
|
||||
+#include <iostream>
|
||||
#include <fstream>
|
||||
#include "utility.h"
|
||||
#include <debug.h>
|
Loading…
Add table
Reference in a new issue