From 8e24eef26596aaf1bf9044dd878a106f7f5cc5f3 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Tue, 15 May 2012 13:56:59 -0600 Subject: [PATCH] Tweaks to clang support and fix for clang/module support --- include/chaiscript/dispatchkit/bootstrap_stl.hpp | 14 ++++++-------- include/chaiscript/language/chaiscript_engine.hpp | 4 ++++ 2 files changed, 10 insertions(+), 8 deletions(-) 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