diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp index 5d8b6f0..27b4698 100644 --- a/include/chaiscript/language/chaiscript_engine.hpp +++ b/include/chaiscript/language/chaiscript_engine.hpp @@ -36,12 +36,13 @@ #include #endif -#if defined(_POSIX_VERSION) && !defined(__CYGWIN__) +#if !defined(CHAISCRIPT_NO_DYNLOAD) && defined(_POSIX_VERSION) && !defined(__CYGWIN__) #include #endif - -#ifdef CHAISCRIPT_WINDOWS +#if defined(CHAISCRIPT_NO_DYNLOAD) +#include "chaiscript_unknown.hpp" +#elif defined(CHAISCRIPT_WINDOWS) #include "chaiscript_windows.hpp" #elif _POSIX_VERSION #include "chaiscript_posix.hpp" diff --git a/include/chaiscript/language/chaiscript_unknown.hpp b/include/chaiscript/language/chaiscript_unknown.hpp index 9e1d7af..8fc1d49 100644 --- a/include/chaiscript/language/chaiscript_unknown.hpp +++ b/include/chaiscript/language/chaiscript_unknown.hpp @@ -16,7 +16,11 @@ namespace chaiscript { Loadable_Module(const std::string &, const std::string &) { +#ifdef CHAISCRIPT_NO_DYNLOAD + throw chaiscript::exception::load_module_error("Loadable module support was disabled (CHAISCRIPT_NO_DYNLOAD)"); +#else throw chaiscript::exception::load_module_error("Loadable module support not available for your platform"); +#endif } ModulePtr m_moduleptr;