Use static const true/false on platforms with magic statics

This commit is contained in:
Jason Turner
2015-05-02 15:27:51 -06:00
parent 45baf6f8e9
commit c0dd0a3041
2 changed files with 6 additions and 1 deletions

View File

@@ -15,6 +15,10 @@
#endif #endif
#endif #endif
#ifndef CHAISCRIPT_MSVC_12
#define CHAISCRIPT_HAS_MAGIC_STATICS
#endif
#include <vector> #include <vector>
#if defined( _LIBCPP_VERSION ) #if defined( _LIBCPP_VERSION )

View File

@@ -409,6 +409,7 @@ namespace chaiscript
return detail::const_var_impl(t); return detail::const_var_impl(t);
} }
#ifdef CHAISCRIPT_HAS_MAGIC_STATICS
inline Boxed_Value const_var(bool b) { inline Boxed_Value const_var(bool b) {
static auto t = detail::const_var_impl(true); static auto t = detail::const_var_impl(true);
static auto f = detail::const_var_impl(false); static auto f = detail::const_var_impl(false);
@@ -419,7 +420,7 @@ namespace chaiscript
return f; return f;
} }
} }
#endif
} }