Windows build fix.

This commit is contained in:
Gunnar Beutner 2013-03-15 11:51:35 +01:00
parent ee46731f41
commit 9a05e2b269
5 changed files with 20 additions and 14 deletions

View File

@ -91,20 +91,14 @@ public:
return m_Items; /* Makes a copy of the map. */
}
static signals2::signal<void (const String&, const T&)> OnRegistered;
static signals2::signal<void (const String&)> OnUnregistered;
signals2::signal<void (const String&, const T&)> OnRegistered;
signals2::signal<void (const String&)> OnUnregistered;
private:
mutable boost::mutex m_Mutex;
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 */

View File

@ -89,8 +89,8 @@ public:
}
};
#define REGISTER_CONFIG_FRAGMENT(name, fragment) \
static icinga::RegisterConfigFragmentHelper g_RegisterCF_ ## type(name, fragment)
#define REGISTER_CONFIG_FRAGMENT(id, name, fragment) \
static icinga::RegisterConfigFragmentHelper g_RegisterCF_ ## id(name, fragment)
}

View File

@ -60,12 +60,12 @@ void PythonLanguage::InitializeOnce(void)
PyEval_ReleaseLock();
String name;
BOOST_FOREACH(tie(name, tuples::ignore), ScriptFunction::GetFunctions()) {
BOOST_FOREACH(tie(name, tuples::ignore), ScriptFunctionRegistry::GetInstance()->GetItems()) {
RegisterNativeFunction(name);
}
ScriptFunction::OnRegistered.connect(boost::bind(&PythonLanguage::RegisterNativeFunction, this, _1));
ScriptFunction::OnUnregistered.connect(boost::bind(&PythonLanguage::UnregisterNativeFunction, this, _1));
ScriptFunctionRegistry::GetInstance()->OnRegistered.connect(boost::bind(&PythonLanguage::RegisterNativeFunction, this, _1));
ScriptFunctionRegistry::GetInstance()->OnUnregistered.connect(boost::bind(&PythonLanguage::UnregisterNativeFunction, this, _1));
m_Initialized = true;
}

1
tools/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
mkembedconfig

View File

@ -19,11 +19,13 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
int cols;
FILE *infp, *outfp;
int i;
if (argc < 3) {
fprintf(stderr, "Syntax: %s <in-file> <out-file>\n", argv[0]);
@ -65,7 +67,16 @@ int main(int argc, char **argv)
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(infp);