diff --git a/lib/base/initialize.cpp b/lib/base/initialize.cpp index 23373cc23..e1dbec547 100644 --- a/lib/base/initialize.cpp +++ b/lib/base/initialize.cpp @@ -5,7 +5,7 @@ using namespace icinga; -bool icinga::InitializeOnceHelper(void (*func)(), int priority) +bool icinga::InitializeOnceHelper(const std::function& func, int priority) { Loader::AddDeferredInitializer(func, priority); return true; diff --git a/lib/base/initialize.hpp b/lib/base/initialize.hpp index 0629abe68..446ad69af 100644 --- a/lib/base/initialize.hpp +++ b/lib/base/initialize.hpp @@ -4,6 +4,7 @@ #define INITIALIZE_H #include "base/i2-base.hpp" +#include namespace icinga { @@ -13,7 +14,7 @@ namespace icinga #define I2_UNIQUE_NAME(prefix) I2_TOKENPASTE2(prefix, __COUNTER__) -bool InitializeOnceHelper(void (*func)(), int priority = 0); +bool InitializeOnceHelper(const std::function& func, int priority = 0); #define INITIALIZE_ONCE(func) \ namespace { namespace I2_UNIQUE_NAME(io) { \