From bdd0a12bb71cd5dd3ac47152e9ec5ffb44f1dca4 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 31 May 2017 14:09:07 -0600 Subject: [PATCH] ChaiScript can only support static in non-threading mode --- cheatsheet.md | 3 +++ include/chaiscript/chaiscript_threading.hpp | 2 +- unittests/static_chaiscript.cpp | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cheatsheet.md b/cheatsheet.md index 2e2c218f..8cf3d3f4 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -15,6 +15,9 @@ chaiscript::ChaiScript chai; // loads stdlib from loadable module on file system chaiscript::ChaiScript chai(chaiscript::Std_Lib::library()); // compiles in stdlib ``` +Note that ChaiScript cannot be used as a global / static object unless it is being compiled with `CHAISCRIPT_NO_THREADS`. + + # Adding Things To The Engine ## Adding a Function / Method / Member diff --git a/include/chaiscript/chaiscript_threading.hpp b/include/chaiscript/chaiscript_threading.hpp index 01bda2bb..79feaa1e 100644 --- a/include/chaiscript/chaiscript_threading.hpp +++ b/include/chaiscript/chaiscript_threading.hpp @@ -144,7 +144,7 @@ namespace chaiscript class Thread_Storage { public: - explicit Thread_Storage(void *) + explicit Thread_Storage() { } diff --git a/unittests/static_chaiscript.cpp b/unittests/static_chaiscript.cpp index fb003044..beeac2d1 100644 --- a/unittests/static_chaiscript.cpp +++ b/unittests/static_chaiscript.cpp @@ -1,3 +1,9 @@ + +#define CHAISCRIPT_NO_THREADS + +/// ChaiScript as a static is unsupported with thread support enabled +/// + #include static chaiscript::ChaiScript chai;