[Click] [PATCH] Fix '--disable-int64' build error.

Joonwoo Park joonwpark81 at gmail.com
Tue Sep 18 04:16:01 EDT 2007


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