mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 14:44:32 +02:00
Windows build fix.
This commit is contained in:
parent
ee46731f41
commit
9a05e2b269
@ -91,20 +91,14 @@ public:
|
|||||||
return m_Items; /* Makes a copy of the map. */
|
return m_Items; /* Makes a copy of the map. */
|
||||||
}
|
}
|
||||||
|
|
||||||
static signals2::signal<void (const String&, const T&)> OnRegistered;
|
signals2::signal<void (const String&, const T&)> OnRegistered;
|
||||||
static signals2::signal<void (const String&)> OnUnregistered;
|
signals2::signal<void (const String&)> OnUnregistered;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mutable boost::mutex m_Mutex;
|
mutable boost::mutex m_Mutex;
|
||||||
typename Registry<T>::ItemMap m_Items;
|
typename Registry<T>::ItemMap m_Items;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
signals2::signal<void (const String&, const T&)> Registry<T>::OnRegistered;
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
signals2::signal<void (const String&)> Registry<T>::OnUnregistered;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* REGISTRY_H */
|
#endif /* REGISTRY_H */
|
||||||
|
@ -89,8 +89,8 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define REGISTER_CONFIG_FRAGMENT(name, fragment) \
|
#define REGISTER_CONFIG_FRAGMENT(id, name, fragment) \
|
||||||
static icinga::RegisterConfigFragmentHelper g_RegisterCF_ ## type(name, fragment)
|
static icinga::RegisterConfigFragmentHelper g_RegisterCF_ ## id(name, fragment)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,12 +60,12 @@ void PythonLanguage::InitializeOnce(void)
|
|||||||
PyEval_ReleaseLock();
|
PyEval_ReleaseLock();
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
BOOST_FOREACH(tie(name, tuples::ignore), ScriptFunction::GetFunctions()) {
|
BOOST_FOREACH(tie(name, tuples::ignore), ScriptFunctionRegistry::GetInstance()->GetItems()) {
|
||||||
RegisterNativeFunction(name);
|
RegisterNativeFunction(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScriptFunction::OnRegistered.connect(boost::bind(&PythonLanguage::RegisterNativeFunction, this, _1));
|
ScriptFunctionRegistry::GetInstance()->OnRegistered.connect(boost::bind(&PythonLanguage::RegisterNativeFunction, this, _1));
|
||||||
ScriptFunction::OnUnregistered.connect(boost::bind(&PythonLanguage::UnregisterNativeFunction, this, _1));
|
ScriptFunctionRegistry::GetInstance()->OnUnregistered.connect(boost::bind(&PythonLanguage::UnregisterNativeFunction, this, _1));
|
||||||
|
|
||||||
m_Initialized = true;
|
m_Initialized = true;
|
||||||
}
|
}
|
||||||
|
1
tools/.gitignore
vendored
Normal file
1
tools/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
mkembedconfig
|
@ -19,11 +19,13 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int cols;
|
int cols;
|
||||||
FILE *infp, *outfp;
|
FILE *infp, *outfp;
|
||||||
|
int i;
|
||||||
|
|
||||||
if (argc < 3) {
|
if (argc < 3) {
|
||||||
fprintf(stderr, "Syntax: %s <in-file> <out-file>\n", argv[0]);
|
fprintf(stderr, "Syntax: %s <in-file> <out-file>\n", argv[0]);
|
||||||
@ -65,7 +67,16 @@ int main(int argc, char **argv)
|
|||||||
cols++;
|
cols++;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(outfp, "0\n};\n\nREGISTER_CONFIG_FRAGMENT(\"%s\", g_ConfigFragment);\n", argv[1]);
|
char id[32];
|
||||||
|
strncpy(id, argv[1], sizeof(id));
|
||||||
|
id[sizeof(id) - 1] = '\0';
|
||||||
|
|
||||||
|
for (i = 0; i < sizeof(id) - 1; i++) {
|
||||||
|
if ((id[i] < 'a' || id[i] > 'z') && (id[i] < 'A' || id[i] > 'Z'))
|
||||||
|
id[i] = '_';
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(outfp, "0\n};\n\nREGISTER_CONFIG_FRAGMENT(%s, \"%s\", g_ConfigFragment);\n", id, argv[1]);
|
||||||
|
|
||||||
fclose(outfp);
|
fclose(outfp);
|
||||||
fclose(infp);
|
fclose(infp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user