mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
Use static const true/false on platforms with magic statics
This commit is contained in:
parent
45baf6f8e9
commit
c0dd0a3041
@ -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 )
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user