Package: swish++
Version: 5.15.3-3
Severity: normal
Tags: patch
When building 'swish++' on amd64/unstable with gcc-4.0,
I get the following error:
pattern_map.h:114: error: ISO C++ forbids declaration of 'result_type' with no
type
pattern_map.h:114: error: expected ';' before 'operator'
pattern_map.h:117: error: expected `;' before 'private'
pattern_map.h: In member function 'typename std::map<const char*, T,
std::less<const char*>, std::allocator<std::pair<const char* const, T> >
>::iterator pattern_map<T>::find(const char*)':
pattern_map.h:90: error: there are no arguments to 'begin' that depend on a
template parameter, so a declaration of 'begin' must be available
pattern_map.h:90: error: (if you use '-fpermissive', G++ will accept your code,
but allowing the use of an undeclared name is deprecated)
pattern_map.h:90: error: there are no arguments to 'end' that depend on a
template parameter, so a declaration of 'end' must be available
pattern_map.h: In member function 'typename std::map<const char*, T,
std::less<const char*>, std::allocator<std::pair<const char* const, T> >
>::const_iterator pattern_map<T>::find(const char*) const':
pattern_map.h:95: error: there are no arguments to 'begin' that depend on a
template parameter, so a declaration of 'begin' must be available
pattern_map.h:95: error: there are no arguments to 'end' that depend on a
template parameter, so a declaration of 'end' must be available
pattern_map.h: In member function 'bool pattern_map<T>::matches(const char*)
const':
pattern_map.h:100: error: there are no arguments to 'end' that depend on a
template parameter, so a declaration of 'end' must be available
/usr/lib/gcc/x86_64-linux/4.0.0/../../../../include/c++/4.0.0/bits/stl_algo.h:
In function '_InputIterator std::find_if(_InputIterator, _InputIterator,
_Predicate, std::input_iterator_tag) [with _InputIterator =
std::_Rb_tree_const_iterator<std::pair<const char* const, filter> >, _Predicate
= pattern_map<filter>::pattern_match]':
/usr/lib/gcc/x86_64-linux/4.0.0/../../../../include/c++/4.0.0/bits/stl_algo.h:337:
instantiated from '_InputIterator std::find_if(_InputIterator,
_InputIterator, _Predicate) [with _InputIterator =
std::_Rb_tree_const_iterator<std::pair<const char* const, filter> >, _Predicate
= pattern_map<filter>::pattern_match]'
pattern_map.h:96: instantiated from 'typename std::map<const char*, T,
std::less<const char*>, std::allocator<std::pair<const char* const, T> >
>::const_iterator pattern_map<T>::find(const char*) const [with T = filter]'
conf_filter.h:53: instantiated from here
/usr/lib/gcc/x86_64-linux/4.0.0/../../../../include/c++/4.0.0/bits/stl_algo.h:187:
error: no match for call to '(pattern_map<filter>::pattern_match) (const
std::pair<const char* const, filter>&)'
make[1]: *** [conf_filter.o] Error 1
make[1]: Leaving directory `/swish++-5.15.3'
make: *** [build-stamp] Error 2
With the attached patch 'swish++' can be compiled
on amd64 using gcc-4.0.
Regards
Andreas Jochens
diff -urN ../tmp-orig/swish++-5.15.3/mod/html/elements.c ./mod/html/elements.c
--- ../tmp-orig/swish++-5.15.3/mod/html/elements.c 2002-10-16
09:11:32.000000000 +0200
+++ ./mod/html/elements.c 2005-04-01 14:50:26.026466690 +0200
@@ -296,7 +296,7 @@
// C++ has become overly pedantic about casting to enums.
//
element::end_tag_value const
- v = (element::end_tag_value const)(int const)(p[1]);
+ v = (element::end_tag_value const)(long const)(p[1]);
element &e = insert(
value_type( *p++, element( v ) )
).first->second;
diff -urN ../tmp-orig/swish++-5.15.3/my_set.h ./my_set.h
--- ../tmp-orig/swish++-5.15.3/my_set.h 2001-07-03 09:39:13.000000000 +0200
+++ ./my_set.h 2005-04-01 14:48:57.007157353 +0200
@@ -52,7 +52,7 @@
//*****************************************************************************
{
public:
- bool contains( T const &s ) const { return find( s ) != end(); }
+ bool contains( T const &s ) const { return find( s ) != this->end(); }
};
//*****************************************************************************
diff -urN ../tmp-orig/swish++-5.15.3/pattern_map.h ./pattern_map.h
--- ../tmp-orig/swish++-5.15.3/pattern_map.h 2002-05-29 17:41:38.000000000
+0200
+++ ./pattern_map.h 2005-04-01 15:02:22.121202604 +0200
@@ -87,17 +87,17 @@
// insertion, however.
//
return std::find_if(
- begin(), end(), pattern_match( file_name )
+ this->begin(), this->end(), pattern_match( file_name )
);
}
const_iterator find( char const *file_name ) const {
return std::find_if(
- begin(), end(), pattern_match( file_name )
+ this->begin(), this->end(), pattern_match( file_name )
);
}
bool matches( char const *file_name ) const {
- return find( file_name ) != end();
+ return find( file_name ) != this->end();
}
void insert( char const *pattern, T const &t ) { (*this)[pattern] = t; }
void insert( value_type const &n ) { map_type::insert( n ); }
@@ -111,7 +111,7 @@
public:
pattern_match( char const *file_name ) :
file_name_( file_name ) { }
- result_type operator()( argument_type map_node ) const {
+ bool operator()( value_type const &map_node ) const {
return !::fnmatch( map_node.first, file_name_, 0 );
}
private:
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]