Get chaiscript compiling with -pedantic. Closes issue #9

This commit is contained in:
Jason Turner
2011-09-09 13:40:50 -06:00
parent a85423869f
commit a386142fa6
4 changed files with 27 additions and 6 deletions

View File

@@ -76,7 +76,7 @@ namespace chaiscript
struct DLSym
{
DLSym(DLModule &t_mod, const std::string &t_symbol)
: m_symbol(reinterpret_cast<T>(dlsym(t_mod.m_data, t_symbol.c_str())))
: m_symbol(cast_symbol(dlsym(t_mod.m_data, t_symbol.c_str())))
{
if (!m_symbol)
{
@@ -84,6 +84,19 @@ namespace chaiscript
}
}
static T cast_symbol(void *p)
{
union cast_union
{
T func_ptr;
void *in_ptr;
};
cast_union c;
c.in_ptr = p;
return c.func_ptr;
}
T m_symbol;
};