summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
Diffstat (limited to 'base')
-rw-r--r--base/callback.hh13
-rw-r--r--base/intmath.hh2
2 files changed, 14 insertions, 1 deletions
diff --git a/base/callback.hh b/base/callback.hh
index eee629cf5..342ab7e0f 100644
--- a/base/callback.hh
+++ b/base/callback.hh
@@ -103,4 +103,17 @@ class CallbackQueue
}
};
+template <class T, void (T::* F)()>
+class MakeCallback : public Callback
+{
+ private:
+ T *object;
+
+ public:
+ MakeCallback(T *o)
+ : object(o)
+ { }
+ void process() { (object->*F)(); }
+};
+
#endif // __CALLBACK_HH__
diff --git a/base/intmath.hh b/base/intmath.hh
index 821514668..5ffe27103 100644
--- a/base/intmath.hh
+++ b/base/intmath.hh
@@ -120,7 +120,7 @@ FloorLog2(int64_t x)
}
#if defined(__APPLE__)
-int
+inline int
FloorLog2(size_t x)
{
assert(x > 0);