[Click] [PATCH] Fix '--disable-int64' build error.
Joonwoo Park
joonwpark81 at gmail.com
Tue Sep 18 12:35:13 EDT 2007
Eddie,
make with --disable-int64 says that
../elements/userlevel/fromfile.cc: In static member function 'static
String FromFile::filesize_handler(Element*, void*)':
../elements/userlevel/fromfile.cc:546: error: call of overloaded
'String(__off64_t&)' is ambiguous
../include/click/string.hh:41: note: candidates are: String::String(double)
../include/click/string.hh:31: note:
String::String(long unsigned int)
../include/click/string.hh:30: note: String::String(long int)
../include/click/string.hh:29: note:
String::String(unsigned int)
../include/click/string.hh:28: note: String::String(int)
../include/click/string.hh:286: note:
String::String(unsigned char)
../include/click/string.hh:277: note: String::String(char)
../include/click/string.hh:267: note: String::String(bool)
../include/click/string.hh:225: note:
String::String(const char*) <near match>
../include/click/string.hh:295: note:
String::String(const String&) <near match>
../elements/userlevel/fromfile.cc: In static member function 'static
String FromFile::filepos_handler(Element*, void*)':
../elements/userlevel/fromfile.cc:555: error: call of overloaded
'String(long long int)' is ambiguous
../include/click/string.hh:41: note: candidates are: String::String(double)
../include/click/string.hh:31: note:
String::String(long unsigned int)
../include/click/string.hh:30: note: String::String(long int)
../include/click/string.hh:29: note:
String::String(unsigned int)
../include/click/string.hh:28: note: String::String(int)
../include/click/string.hh:286: note:
String::String(unsigned char)
../include/click/string.hh:277: note: String::String(char)
../include/click/string.hh:267: note: String::String(bool)
../include/click/string.hh:225: note:
String::String(const char*) <near match>
../include/click/string.hh:295: note:
String::String(const String&) <near match>
and
../elements/userlevel/fromdump.cc: In static member function 'static
String FromDump::read_handler(Element*, void*)':
../elements/userlevel/fromdump.cc:519: error: call of overloaded
'String(off_t&)' is ambiguous
../include/click/string.hh:41: note: candidates are: String::String(double)
../include/click/string.hh:31: note:
String::String(long unsigned int)
../include/click/string.hh:30: note: String::String(long int)
../include/click/string.hh:29: note:
String::String(unsigned int)
../include/click/string.hh:28: note: String::String(int)
../include/click/string.hh:286: note:
String::String(unsigned char)
../include/click/string.hh:277: note: String::String(char)
../include/click/string.hh:267: note: String::String(bool)
../include/click/string.hh:225: note:
String::String(const char*) <near match>
../include/click/string.hh:295: note:
String::String(const String&) <near match>
Thanks.
Joonwoo Park (Jason Park)
2007/9/19, Eddie Kohler <kohler at cs.ucla.edu>:
> Thanks Joonwoo, I checked in a variant of this patch that uses
> ELEMENT_REQUIRES instead. Try make elemlist to test it.
>
> Which elements don't work right under !HAVE_INT64_TYPES at userlevel?
>
> Eddie
>
>
> Joonwoo Park wrote:
> > Hi,
> > There is a yet another build error with !HAVE_INT64_TYPES.
> > My patch fixes only 'linuxmodule' build error.
> > ** We have same problem at userlevel but to solve that we need
> > compromise some functionality or enable String's int64 stuff always.
> > **
> > I couldn't work for it because of I can't sure what is the best solution.
> >
> > -
> > Signed-off-by: Joonwoo Park <joonwpark81 at gmail.com>
> >
> > elements/linuxmodule/perfcountaccum.cc | 2 ++
> > elements/linuxmodule/perfcountaccum.hh | 9 +++++++--
> > elements/linuxmodule/setperfcount.cc | 2 ++
> > 3 files changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/elements/linuxmodule/perfcountaccum.cc
> > b/elements/linuxmodule/perfcountaccum.cc
> > index dd1367a..b9d92f0 100644
> > --- a/elements/linuxmodule/perfcountaccum.cc
> > +++ b/elements/linuxmodule/perfcountaccum.cc
> > @@ -65,6 +65,7 @@ PerfCountAccum::initialize(ErrorHandler *errh)
> > inline void
> > PerfCountAccum::smaction(Packet *p)
> > {
> > +#if HAVE_INT64_TYPES
> > #if __i386__
> > unsigned l, h;
> > rdpmc(_which, l, h);
> > @@ -74,6 +75,7 @@ PerfCountAccum::smaction(Packet *p)
> > #else
> > // add other architectures here
> > #endif
> > +#endif
> > _count++;
> > }
> >
> > diff --git a/elements/linuxmodule/perfcountaccum.hh
> > b/elements/linuxmodule/perfcountaccum.hh
> > index be8e430..c86111d 100644
> > --- a/elements/linuxmodule/perfcountaccum.hh
> > +++ b/elements/linuxmodule/perfcountaccum.hh
> > @@ -54,8 +54,13 @@ class PerfCountAccum : public PerfCountUser { public:
> > private:
> >
> > int _which;
> > - uint64_t _accum;
> > - uint64_t _count;
> > +#if HAVE_INT64_TYPES
> > + typedef uint64_t counter_t;
> > +#else
> > + typedef uint32_t counter_t;
> > +#endif
> > + counter_t _accum;
> > + counter_t _count;
> >
> > static String read_handler(Element *, void *);
> > static int reset_handler(const String &, Element *, void *, ErrorHandler *);
> > diff --git a/elements/linuxmodule/setperfcount.cc
> > b/elements/linuxmodule/setperfcount.cc
> > index e991e18..95c5183 100644
> > --- a/elements/linuxmodule/setperfcount.cc
> > +++ b/elements/linuxmodule/setperfcount.cc
> > @@ -58,6 +58,7 @@ SetPerfCount::configure(Vector<String> &conf,
> > ErrorHandler *errh)
> > inline void
> > SetPerfCount::smaction(Packet *p)
> > {
> > +#if HAVE_INT64_TYPES
> > #if __i386__
> > unsigned l, h;
> > rdpmc(_which, l, h);
> > @@ -66,6 +67,7 @@ SetPerfCount::smaction(Packet *p)
> > #else
> > // code for other architectures
> > #endif
> > +#endif
> > }
> >
> > void
> > -
> >
> > Joonwoo Park (Jason Park)
>
More information about the click
mailing list