diff --git a/contrib/codeanalysis/codeanalysis.sh b/contrib/codeanalysis/codeanalysis.sh
index 6a32210..3da80b4 100755
--- a/contrib/codeanalysis/codeanalysis.sh
+++ b/contrib/codeanalysis/codeanalysis.sh
@@ -50,7 +50,7 @@ function run_test
# Run multithreaded tests
echo "****Building multithreaded test"
pushd src
- g++ multithreaded.cpp -lboost_thread-mt -ldl -omultithreaded -I../include -O3
+ g++ multithreaded.cpp -ldl -omultithreaded -I../include -O3
echo "****Testing 1 thread runtime"
/usr/bin/time -p ./multithreaded 1 2> ../../r$1-1threadruntime.out
echo "****Testing 2 thread runtime"
diff --git a/include/chaiscript/chaiscript.hpp b/include/chaiscript/chaiscript.hpp
index 497c9c4..33cf6db 100644
--- a/include/chaiscript/chaiscript.hpp
+++ b/include/chaiscript/chaiscript.hpp
@@ -74,16 +74,16 @@
///
/// \subsection compiling Compiling ChaiScript Applications
///
-/// ChaiScript is a header only library with only two dependecies. boost::threads (optional) and the
+/// ChaiScript is a header only library with only one dependecy: The
/// operating system provided dynamic library loader, which has to be specified on some platforms.
///
/// \subsubsection compilinggcc Compiling with GCC
///
/// To compile the above application on a Unix like operating system (MacOS, Linux) with GCC you need to link
-/// both boost::threads and the dynamic loader. For example:
+/// the dynamic loader. For example:
///
/// \code
-/// gcc main.cpp -I/path/to/chaiscript/headers -ldl -lboost_threads
+/// gcc main.cpp -I/path/to/chaiscript/headers -ldl
/// \endcode
///
/// Alternatively, you may compile without threading support.
@@ -245,7 +245,9 @@
///
/// std::string append_string_int(const std::string &t_lhs, int t_rhs)
/// {
-/// return t_lhs + boost::lexical_cast(t_rhs);
+/// std::stringstream ss;
+/// ss << t_lhs << t_rhs;
+/// return ss.str();
/// }
///
/// chai.add(fun(append_string_int), "+");
@@ -407,7 +409,7 @@
///
/// Thread safety can be disabled by defining CHAISCRIPT_NO_THREADS when using the library.
///
-/// Disabling thread safety increases performance and removes the requirement for boost_threads.
+/// Disabling thread safety increases performance in many cases.
///
///
///
@@ -743,6 +745,8 @@
/// \namespace chaiscript::detail
/// \brief Classes and functions reserved for internal use. Items in this namespace are not supported.
+#include "chaiscript_defines.hpp"
+
#include "dispatchkit/dispatchkit.hpp"
#include "dispatchkit/bootstrap.hpp"
#include "dispatchkit/bootstrap_stl.hpp"
@@ -750,7 +754,7 @@
#include "dispatchkit/dynamic_object.hpp"
#include "dispatchkit/boxed_number.hpp"
-#ifdef BOOST_HAS_DECLSPEC
+#ifdef CHAISCRIPT_HAS_DECLSPEC
#define CHAISCRIPT_MODULE_EXPORT extern "C" __declspec(dllexport)
#else
#define CHAISCRIPT_MODULE_EXPORT extern "C"
diff --git a/include/chaiscript/chaiscript_defines.hpp b/include/chaiscript/chaiscript_defines.hpp
new file mode 100644
index 0000000..38cd72b
--- /dev/null
+++ b/include/chaiscript/chaiscript_defines.hpp
@@ -0,0 +1,20 @@
+// This file is distributed under the BSD License.
+// See "license.txt" for details.
+// Copyright 2009-2011, Jonathan Turner (jonathan@emptycrate.com)
+// and Jason Turner (jason@emptycrate.com)
+// http://www.chaiscript.com
+
+#ifndef CHAISCRIPT_DEFINES_HPP_
+#define CHAISCRIPT_DEFINES_HPP_
+
+#ifdef _MSC_VER
+#define CHAISCRIPT_MSVC _MSC_VER
+#define CHAISCRIPT_HAS_DECLSPEc
+#endif
+
+#ifdef _WIN32
+#define CHAISCRIPT_WINDOWS
+#endif
+
+#endif
+
diff --git a/include/chaiscript/chaiscript_threading.hpp b/include/chaiscript/chaiscript_threading.hpp
index bc7ae3c..bce2c3e 100644
--- a/include/chaiscript/chaiscript_threading.hpp
+++ b/include/chaiscript/chaiscript_threading.hpp
@@ -26,7 +26,7 @@ namespace chaiscript
{
namespace detail
{
- /// If threading is enabled, then this namespace contains boost::thread classes.
+ /// If threading is enabled, then this namespace contains std thread classes.
/// If threading is not enabled, then stubbed in wrappers that do nothing are provided.
/// This allows us to avoid \#ifdef code in the sections that need thread safety.
namespace threading
@@ -64,8 +64,10 @@ namespace chaiscript
- /// Typesafe thread specific storage. If threading is enabled, this class uses boost::thread_specific_ptr. If
+ /// Typesafe thread specific storage. If threading is enabled, this class uses a mutex protected map. If
/// threading is not enabled, the class always returns the same data, regardless of which thread it is called from.
+ ///
+ /// \todo move to thread_local when it exists
template
class Thread_Storage
{
diff --git a/include/chaiscript/dispatchkit/boxed_cast.hpp b/include/chaiscript/dispatchkit/boxed_cast.hpp
index c8b8e76..b75e06f 100644
--- a/include/chaiscript/dispatchkit/boxed_cast.hpp
+++ b/include/chaiscript/dispatchkit/boxed_cast.hpp
@@ -7,6 +7,8 @@
#ifndef CHAISCRIPT_BOXED_CAST_HPP_
#define CHAISCRIPT_BOXED_CAST_HPP_
+#include "../chaiscript_defines.hpp"
+
#include "type_info.hpp"
#include "boxed_value.hpp"
#include "boxed_cast_helper.hpp"
@@ -66,7 +68,7 @@ namespace chaiscript
return detail::Cast_Helper::cast(bv);
} catch (const chaiscript::detail::exception::bad_any_cast &) {
-#ifdef BOOST_MSVC
+#ifdef CHAISCRIPT_MSVC
//Thank you MSVC, yes we know that a constant value is being used in the if
// statment in THIS VERSION of the template instantiation
#pragma warning(push)
@@ -88,7 +90,7 @@ namespace chaiscript
throw exception::bad_boxed_cast(bv.get_type_info(), typeid(Type));
}
-#ifdef BOOST_MSVC
+#ifdef CHAISCRIPT_MSVC
#pragma warning(pop)
#endif
diff --git a/include/chaiscript/dispatchkit/operators.hpp b/include/chaiscript/dispatchkit/operators.hpp
index 343da1e..2686976 100644
--- a/include/chaiscript/dispatchkit/operators.hpp
+++ b/include/chaiscript/dispatchkit/operators.hpp
@@ -7,6 +7,8 @@
#ifndef CHAISCRIPT_OPERATORS_HPP_
#define CHAISCRIPT_OPERATORS_HPP_
+#include "../chaiscript_defines.hpp"
+
namespace chaiscript
{
namespace bootstrap
@@ -154,7 +156,7 @@ namespace chaiscript
template
Ret unary_minus(L l)
{
-#ifdef BOOST_MSVC
+#ifdef CHAISCRIPT_MSVC
#pragma warning(push)
#pragma warning(disable : 4146)
return (-l);
diff --git a/include/chaiscript/language/chaiscript_algebraic.hpp b/include/chaiscript/language/chaiscript_algebraic.hpp
index fe76359..3d363ce 100644
--- a/include/chaiscript/language/chaiscript_algebraic.hpp
+++ b/include/chaiscript/language/chaiscript_algebraic.hpp
@@ -7,7 +7,7 @@
#ifndef CHAISCRIPT_ALGEBRAIC_HPP_
#define CHAISCRIPT_ALGEBRAIC_HPP_
-#include
+#include "../dispatchkit/dispatchkit.hpp"
namespace chaiscript
{
diff --git a/include/chaiscript/language/chaiscript_common.hpp b/include/chaiscript/language/chaiscript_common.hpp
index bc00f5c..5fbb209 100644
--- a/include/chaiscript/language/chaiscript_common.hpp
+++ b/include/chaiscript/language/chaiscript_common.hpp
@@ -7,7 +7,7 @@
#ifndef CHAISCRIPT_COMMON_HPP_
#define CHAISCRIPT_COMMON_HPP_
-#include
+#include "../dispatchkit/dispatchkit.hpp"
namespace chaiscript
{
diff --git a/include/chaiscript/language/chaiscript_engine.hpp b/include/chaiscript/language/chaiscript_engine.hpp
index e0816b7..c7ec0bf 100644
--- a/include/chaiscript/language/chaiscript_engine.hpp
+++ b/include/chaiscript/language/chaiscript_engine.hpp
@@ -10,12 +10,13 @@
#include
#include
-#include
+#include "../chaiscript_defines.hpp"
+#include "chaiscript_common.hpp"
#ifdef _POSIX_VERSION
#include
#else
-#ifdef BOOST_WINDOWS
+#ifdef CHAISCRIPT_WINDOWS
#define VC_EXTRA_LEAN
#define WIN32_LEAN_AND_MEAN
#include
@@ -23,8 +24,8 @@
#endif
-#include
-#include
+#include "chaiscript_prelude.hpp"
+#include "chaiscript_parser.hpp"
#include "../dispatchkit/exception_specification.hpp"
namespace chaiscript
diff --git a/include/chaiscript/language/chaiscript_eval.hpp b/include/chaiscript/language/chaiscript_eval.hpp
index b3b4b0c..2e15afd 100644
--- a/include/chaiscript/language/chaiscript_eval.hpp
+++ b/include/chaiscript/language/chaiscript_eval.hpp
@@ -9,7 +9,7 @@
#include