diff --git a/include/chaiscript/dispatchkit/bootstrap_stl.hpp b/include/chaiscript/dispatchkit/bootstrap_stl.hpp index 03c56f1..9bfc66a 100644 --- a/include/chaiscript/dispatchkit/bootstrap_stl.hpp +++ b/include/chaiscript/dispatchkit/bootstrap_stl.hpp @@ -512,16 +512,14 @@ namespace chaiscript } m->add(fun(&String::push_back), push_back_name); - typedef typename String::size_type (String::*find_func_ptr)(const String &, typename String::size_type) const; - typedef std::function find_func; - m->add(fun( std::function( [](const String *s, const String &f, int pos) { return s->find(f, pos); } ) ), "find"); - m->add(fun( std::function( [](const String *s, const String &f, int pos) { return s->rfind(f, pos); } ) ), "rfind"); - m->add(fun( std::function( [](const String *s, const String &f, int pos) { return s->find_first_of(f, pos); } ) ), "find_first_of"); - m->add(fun( std::function( [](const String *s, const String &f, int pos) { return s->find_last_of(f, pos); } ) ), "find_last_of"); - m->add(fun( std::function( [](const String *s, const String &f, int pos) { return s->find_last_not_of(f, pos); } ) ), "find_last_not_of"); - m->add(fun( std::function( [](const String *s, const String &f, int pos) { return s->find_first_not_of(f, pos); } ) ), "find_first_not_of"); + m->add(fun(find_func( [](const String *s, const String &f, int pos) { return s->find(f, pos); } )), "find"); + m->add(fun(find_func( [](const String *s, const String &f, int pos) { return s->rfind(f, pos); } ) ), "rfind"); + m->add(fun(find_func( [](const String *s, const String &f, int pos) { return s->find_first_of(f, pos); } ) ), "find_first_of"); + m->add(fun(find_func( [](const String *s, const String &f, int pos) { return s->find_last_of(f, pos); } ) ), "find_last_of"); + m->add(fun(find_func( [](const String *s, const String &f, int pos) { return s->find_last_not_of(f, pos); } ) ), "find_last_not_of"); + m->add(fun(find_func( [](const String *s, const String &f, int pos) { return s->find_first_not_of(f, pos); } ) ), "find_first_not_of"); m->add(fun( std::function( [](const String *s) { return s->c_str(); } ) ), "c_str"); m->add(fun( std::function( [](const String *s) { return s->data(); } ) ), "data"); diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index 8d0cd0e..26faa16 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -13,6 +13,10 @@ #include "../chaiscript_defines.hpp" #include "chaiscript_common.hpp" +#if defined(__linux__) || defined(__unix__) || defined(__APPLE__) +#include +#endif + #ifdef _POSIX_VERSION #include #else