Bump SOL2 to v2.15.5 to fix OSX compilation problems.

This commit is contained in:
Daniel Patterson 2016-12-15 21:55:59 -08:00 committed by Moritz Kobitzsch
parent 9832825abd
commit d3ef993d5f
2 changed files with 13094 additions and 12935 deletions

View File

@ -19,7 +19,7 @@ MASON_REPO="https://github.com/mapbox/mason.git"
MASON_TAG=v0.3.0
SOL_REPO="https://github.com/ThePhD/sol2.git"
SOL_TAG=v2.15.4
SOL_TAG=v2.15.5
VARIANT_LATEST=$(curl "https://api.github.com/repos/mapbox/variant/releases/latest" | jq ".tag_name")
OSMIUM_LATEST=$(curl "https://api.github.com/repos/osmcode/libosmium/releases/latest" | jq ".tag_name")

View File

@ -20,13 +20,35 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2016-12-05 17:03:03.298778 UTC
// This header was generated with sol v2.15.3 (revision 9c2c27f)
// Generated 2016-12-16 05:28:22.940422 UTC
// This header was generated with sol v2.15.5 (revision bbcbd41)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP
#define SOL_SINGLE_INCLUDE_HPP
// beginning of sol.hpp
#ifndef SOL_HPP
#define SOL_HPP
#if defined(UE_BUILD_DEBUG) || defined(UE_BUILD_DEVELOPMENT) || defined(UE_BUILD_TEST) || defined(UE_BUILD_SHIPPING) || defined(UE_SERVER)
#define SOL_INSIDE_UNREAL
#endif // Unreal Engine 4 bullshit
#ifdef SOL_INSIDE_UNREAL
#ifdef check
#define SOL_INSIDE_UNREAL_REMOVED_CHECK
#undef check
#endif
#endif // Unreal Engine 4 Bullshit
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#pragma GCC diagnostic ignored "-Wconversion"
#endif // g++
// beginning of sol/state.hpp
// beginning of sol/state_view.hpp
@ -1388,7 +1410,7 @@ inline int luaL_fileresult(lua_State *L, int stat, const char *fname) {
}
else {
char buf[1024];
#ifdef __GLIBC__
#if defined(__GLIBC__) || defined(_POSIX_VERSION)
strerror_r(en, buf, 1024);
#else
strerror_s(buf, 1024, en);
@ -2067,18 +2089,17 @@ namespace sol {
};
template <class T>
struct optional_base
{
struct optional_base {
char storage_[sizeof(T) + (sizeof(T) % alignof(T))];
bool init_;
char storage_[sizeof(T)];
constexpr optional_base() noexcept : init_(false), storage_() {};
constexpr optional_base() noexcept : storage_(), init_(false) {};
explicit optional_base(const T& v) : init_(true), storage_() {
explicit optional_base(const T& v) : storage_(), init_(true) {
new (&storage())T(v);
}
explicit optional_base(T&& v) : init_(true), storage_() {
explicit optional_base(T&& v) : storage_(), init_(true) {
new (&storage())T(constexpr_move(v));
}
@ -2116,17 +2137,16 @@ namespace sol {
using constexpr_optional_base = optional_base<T>;
#else
template <class T>
struct constexpr_optional_base
{
struct constexpr_optional_base {
char storage_[sizeof(T) + (sizeof(T) % alignof(T))];
bool init_;
char storage_[sizeof(T)];
constexpr constexpr_optional_base() noexcept : init_(false), storage_() {}
constexpr constexpr_optional_base() noexcept : storage_(), init_(false) {}
explicit constexpr constexpr_optional_base(const T& v) : init_(true), storage_() {
explicit constexpr constexpr_optional_base(const T& v) : storage_(), init_(true) {
new (&storage())T(v);
}
explicit constexpr constexpr_optional_base(T&& v) : init_(true), storage_() {
explicit constexpr constexpr_optional_base(T&& v) : storage_(), init_(true) {
new (&storage())T(constexpr_move(v));
}
@ -2917,8 +2937,6 @@ namespace sol {
// beginning of sol/string_shim.hpp
#pragma once
namespace sol {
namespace string_detail {
struct string_shim {
@ -2977,7 +2995,9 @@ namespace sol {
}
};
}
}// end of sol/string_shim.hpp
}
// end of sol/string_shim.hpp
#include <array>
@ -3146,6 +3166,12 @@ namespace sol {
operator int() const { return index; }
};
struct ref_index {
int index;
ref_index(int idx) : index(idx) {}
operator int() const { return index; }
};
struct lightuserdata_value {
void* value;
lightuserdata_value(void* data) : value(data) {}
@ -3753,18 +3779,27 @@ namespace sol {
stack_reference(lua_State* L, int i) noexcept : L(L), index(lua_absindex(L, i)) {}
stack_reference(lua_State* L, absolute_index i) noexcept : L(L), index(i) {}
stack_reference(lua_State* L, raw_index i) noexcept : L(L), index(i) {}
stack_reference(lua_State* L, ref_index i) noexcept = delete;
stack_reference(stack_reference&& o) noexcept = default;
stack_reference& operator=(stack_reference&&) noexcept = default;
stack_reference(const stack_reference&) noexcept = default;
stack_reference& operator=(const stack_reference&) noexcept = default;
int push() const noexcept {
lua_pushvalue(L, index);
return push(lua_state());
}
int push(lua_State* Ls) const noexcept {
lua_pushvalue(Ls, index);
return 1;
}
void pop(int n = 1) const noexcept {
lua_pop(lua_state(), n);
void pop() const noexcept {
pop(lua_state());
}
void pop(lua_State* Ls, int n = 1) const noexcept {
lua_pop(Ls, n);
}
int stack_index() const noexcept {
@ -3870,6 +3905,10 @@ namespace sol {
lua_pushvalue(lua_state(), index);
ref = luaL_ref(lua_state(), LUA_REGISTRYINDEX);
}
reference(lua_State* L, ref_index index) noexcept : luastate(L) {
lua_rawgeti(L, LUA_REGISTRYINDEX, index.index);
ref = luaL_ref(lua_state(), LUA_REGISTRYINDEX);
}
~reference() noexcept {
deref();
@ -3906,12 +3945,20 @@ namespace sol {
}
int push() const noexcept {
lua_rawgeti(lua_state(), LUA_REGISTRYINDEX, ref);
return push(lua_state());
}
int push(lua_State* Ls) const noexcept {
lua_rawgeti(Ls, LUA_REGISTRYINDEX, ref);
return 1;
}
void pop(int n = 1) const noexcept {
lua_pop(lua_state(), n);
void pop() const noexcept {
pop(lua_state());
}
void pop(lua_State* Ls, int n = 1) const noexcept {
lua_pop(Ls, n);
}
int registry_index() const noexcept {
@ -3976,9 +4023,17 @@ namespace sol {
basic_userdata& operator=(basic_userdata&&) = default;
basic_userdata(const stack_reference& r) : basic_userdata(r.lua_state(), r.stack_index()) {}
basic_userdata(stack_reference&& r) : basic_userdata(r.lua_state(), r.stack_index()) {}
template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler>
basic_userdata(lua_State* L, T&& r) : basic_userdata(L, sol::ref_index(r.registry_index())) {}
basic_userdata(lua_State* L, int index = -1) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
type_assert(L, index, type::userdata);
#endif // Safety
}
basic_userdata(lua_State* L, ref_index index) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
auto pp = stack::push_pop(*this);
type_assert(L, -1, type::userdata);
#endif // Safety
}
};
@ -4002,9 +4057,17 @@ namespace sol {
basic_lightuserdata& operator=(basic_lightuserdata&&) = default;
basic_lightuserdata(const stack_reference& r) : basic_lightuserdata(r.lua_state(), r.stack_index()) {}
basic_lightuserdata(stack_reference&& r) : basic_lightuserdata(r.lua_state(), r.stack_index()) {}
template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler>
basic_lightuserdata(lua_State* L, T&& r) : basic_lightuserdata(L, sol::ref_index(r.registry_index())) {}
basic_lightuserdata(lua_State* L, int index = -1) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
type_assert(L, index, type::lightuserdata);
#endif // Safety
}
basic_lightuserdata(lua_State* L, ref_index index) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
auto pp = stack::push_pop(*this);
type_assert(L, -1, type::lightuserdata);
#endif // Safety
}
};
@ -6089,12 +6152,12 @@ namespace sol {
template<typename T>
struct pusher<T, std::enable_if_t<std::is_base_of<reference, T>::value || std::is_base_of<stack_reference, T>::value>> {
static int push(lua_State*, const T& ref) {
return ref.push();
static int push(lua_State* L, const T& ref) {
return ref.push(L);
}
static int push(lua_State*, T&& ref) {
return ref.push();
static int push(lua_State* L, T&& ref) {
return ref.push(L);
}
};
@ -8969,11 +9032,19 @@ namespace sol {
basic_function& operator=(basic_function&&) = default;
basic_function(const stack_reference& r) : basic_function(r.lua_state(), r.stack_index()) {}
basic_function(stack_reference&& r) : basic_function(r.lua_state(), r.stack_index()) {}
template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler>
basic_function(lua_State* L, T&& r) : basic_function(L, sol::ref_index(r.registry_index())) {}
basic_function(lua_State* L, int index = -1) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
stack::check<basic_function>(L, index, type_panic);
#endif // Safety
}
basic_function(lua_State* L, ref_index index) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
auto pp = stack::push_pop(*this);
stack::check<basic_function>(L, -1, type_panic);
#endif // Safety
}
template<typename... Args>
function_result operator()(Args&&... args) const {
@ -9278,11 +9349,19 @@ namespace sol {
basic_protected_function(proxy_base<Super>&& p, reference eh = get_default_handler()) : basic_protected_function(p.operator basic_function<base_t>(), std::move(eh)) {}
template <typename Super>
basic_protected_function(const proxy_base<Super>& p, reference eh = get_default_handler()) : basic_protected_function(static_cast<basic_function<base_t>>(p), std::move(eh)) {}
template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler>
basic_protected_function(lua_State* L, T&& r, reference eh) : basic_protected_function(L, sol::ref_index(r.registry_index()), std::move(eh)) {}
basic_protected_function(lua_State* L, int index = -1, reference eh = get_default_handler()) : base_t(L, index), error_handler(std::move(eh)) {
#ifdef SOL_CHECK_ARGUMENTS
stack::check<basic_protected_function>(L, index, type_panic);
#endif // Safety
}
basic_protected_function(lua_State* L, ref_index index, reference eh = get_default_handler()) : base_t(L, index), error_handler(std::move(eh)) {
#ifdef SOL_CHECK_ARGUMENTS
auto pp = stack::push_pop(*this);
stack::check<basic_protected_function>(L, -1, type_panic);
#endif // Safety
}
template<typename... Args>
protected_function_result operator()(Args&&... args) const {
@ -9322,7 +9401,11 @@ namespace sol {
}
int push() const {
lua_pushvalue(L, index);
return push(L);
}
int push(lua_State* Ls) const {
lua_pushvalue(Ls, index);
return 1;
}
@ -9674,25 +9757,26 @@ namespace sol {
basic_object(lua_nil_t r) : base_t(r) {}
basic_object(const basic_object&) = default;
basic_object(basic_object&&) = default;
basic_object& operator=(const basic_object&) = default;
basic_object& operator=(basic_object&&) = default;
basic_object& operator=(const base_t& b) { base_t::operator=(b); return *this; }
basic_object& operator=(base_t&& b) { base_t::operator=(std::move(b)); return *this; }
basic_object(const stack_reference& r) noexcept : basic_object(r.lua_state(), r.stack_index()) {}
basic_object(stack_reference&& r) noexcept : basic_object(r.lua_state(), r.stack_index()) {}
template <typename Super>
basic_object(const proxy_base<Super>& r) noexcept : basic_object(r.operator basic_object()) {}
template <typename Super>
basic_object(proxy_base<Super>&& r) noexcept : basic_object(r.operator basic_object()) {}
template <typename Super>
basic_object& operator=(const proxy_base<Super>& r) { this->operator=(r.operator basic_object()); return *this; }
template <typename Super>
basic_object& operator=(proxy_base<Super>&& r) { this->operator=(r.operator basic_object()); return *this; }
basic_object(lua_State* L, int index = -1) noexcept : base_t(L, index) {}
basic_object(lua_State* L, ref_index index) noexcept : base_t(L, index) {}
template <typename T, typename... Args>
basic_object(lua_State* L, in_place_type_t<T>, Args&&... args) noexcept : basic_object(std::integral_constant<bool, !std::is_base_of<stack_reference, base_t>::value>(), L, -stack::push<T>(L, std::forward<Args>(args)...)) {}
template <typename T, typename... Args>
basic_object(lua_State* L, in_place_t, T&& arg, Args&&... args) noexcept : basic_object(L, in_place<T>, std::forward<T>(arg), std::forward<Args>(args)...) {}
basic_object& operator=(const basic_object&) = default;
basic_object& operator=(basic_object&&) = default;
basic_object& operator=(const base_t& b) { base_t::operator=(b); return *this; }
basic_object& operator=(base_t&& b) { base_t::operator=(std::move(b)); return *this; }
template <typename Super>
basic_object& operator=(const proxy_base<Super>& r) { this->operator=(r.operator basic_object()); return *this; }
template <typename Super>
basic_object& operator=(proxy_base<Super>&& r) { this->operator=(r.operator basic_object()); return *this; }
template<typename T>
decltype(auto) as() const {
@ -9876,9 +9960,9 @@ namespace sol {
namespace stack {
template <typename Table, typename Key>
struct pusher<proxy<Table, Key>> {
static int push(lua_State*, const proxy<Table, Key>& p) {
static int push(lua_State* L, const proxy<Table, Key>& p) {
sol::reference r = p;
return r.push();
return r.push(L);
}
};
} // stack
@ -11813,11 +11897,19 @@ namespace sol {
basic_table_core& operator=(basic_table_core&&) = default;
basic_table_core(const stack_reference& r) : basic_table_core(r.lua_state(), r.stack_index()) {}
basic_table_core(stack_reference&& r) : basic_table_core(r.lua_state(), r.stack_index()) {}
template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler>
basic_table_core(lua_State* L, T&& r) : basic_table_core(L, sol::ref_index(r.registry_index())) {}
basic_table_core(lua_State* L, int index = -1) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
stack::check<basic_table_core>(L, index, type_panic);
#endif // Safety
}
basic_table_core(lua_State* L, ref_index index) : base_t(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
auto pp = stack::push_pop(*this);
stack::check<basic_table_core>(L, -1, type_panic);
#endif // Safety
}
iterator begin() const {
return iterator(*this);
@ -12242,6 +12334,13 @@ namespace sol {
count
};
inline std::size_t total_memory_used(lua_State* L) {
std::size_t kb = lua_gc(L, LUA_GCCOUNT, 0);
kb *= 1024;
kb += lua_gc(L, LUA_GCCOUNTB, 0);
return kb;
}
class state_view {
private:
lua_State* L;
@ -12488,6 +12587,14 @@ namespace sol {
return reg;
}
std::size_t memory_used() const {
return total_memory_used(lua_state());
}
void collect_garbage() {
lua_gc(lua_state(), LUA_GCCOLLECT, 0);
}
operator lua_State* () const {
return lua_state();
}
@ -12755,7 +12862,8 @@ namespace sol {
template <>
struct getter<lua_thread_state> {
lua_thread_state get(lua_State* L, int index = -1) {
lua_thread_state get(lua_State* L, int index, record& tracking) {
tracking.use(1);
lua_thread_state lts{ lua_tothread(L, index) };
return lts;
}
@ -12764,30 +12872,53 @@ namespace sol {
template <>
struct check_getter<lua_thread_state> {
template <typename Handler>
optional<lua_thread_state> get(lua_State* L, int index, Handler&& handler) {
optional<lua_thread_state> get(lua_State* L, int index, Handler&& handler, record& tracking) {
lua_thread_state lts{ lua_tothread(L, index) };
if (lts.L == nullptr) {
handler(L, index, type::thread, type_of(L, index));
return nullopt;
}
tracking.use(1);
return lts;
}
};
}
#if SOL_LUA_VERSION < 502
inline lua_State* main_thread(lua_State*, lua_State* backup_if_unsupported = nullptr) {
return backup_if_unsupported;
}
#else
inline lua_State* main_thread(lua_State* L, lua_State* = nullptr) {
lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_MAINTHREAD);
lua_thread_state s = stack::pop<lua_thread_state>(L);
return s.L;
}
#endif // Lua 5.2+ has the main thread getter
class thread : public reference {
public:
thread() noexcept = default;
thread(const thread&) = default;
thread(thread&&) = default;
template <typename T, meta::enable<meta::neg<std::is_same<meta::unqualified_t<T>, thread>>, std::is_base_of<reference, meta::unqualified_t<T>>> = meta::enabler>
thread(T&& r) : reference(std::forward<T>(r)) {}
thread(const stack_reference& r) : thread(r.lua_state(), r.stack_index()) {};
thread(stack_reference&& r) : thread(r.lua_state(), r.stack_index()) {};
thread& operator=(const thread&) = default;
thread& operator=(thread&&) = default;
template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler>
thread(lua_State* L, T&& r) : thread(L, sol::ref_index(r.registry_index())) {}
thread(lua_State* L, int index = -1) : reference(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
type_assert(L, index, type::thread);
#endif // Safety
}
thread(lua_State* L, ref_index index) : reference(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
auto pp = stack::push_pop(*this);
type_assert(L, -1, type::thread);
#endif // Safety
}
thread(lua_State* L, lua_State* actualthread) : thread(L, lua_thread_state{ actualthread }) {}
@ -12885,12 +13016,27 @@ namespace sol {
public:
coroutine() noexcept = default;
coroutine(const coroutine&) noexcept = default;
coroutine(coroutine&&) noexcept = default;
coroutine& operator=(const coroutine&) noexcept = default;
coroutine& operator=(coroutine&&) noexcept = default;
template <typename T, meta::enable<meta::neg<std::is_same<meta::unqualified_t<T>, coroutine>>, std::is_base_of<reference, meta::unqualified_t<T>>> = meta::enabler>
coroutine(T&& r) : reference(std::forward<T>(r)) {}
coroutine(lua_nil_t r) : reference(r) {}
coroutine(const stack_reference& r) noexcept : coroutine(r.lua_state(), r.stack_index()) {}
coroutine(stack_reference&& r) noexcept : coroutine(r.lua_state(), r.stack_index()) {}
template <typename T, meta::enable<meta::neg<std::is_integral<meta::unqualified_t<T>>>, meta::neg<std::is_same<T, ref_index>>> = meta::enabler>
coroutine(lua_State* L, T&& r) : coroutine(L, sol::ref_index(r.registry_index())) {}
coroutine(lua_State* L, int index = -1) : reference(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
stack::check<coroutine>(L, index, type_panic);
#endif // Safety
}
coroutine(lua_State* L, ref_index index) : reference(L, index) {
#ifdef SOL_CHECK_ARGUMENTS
auto pp = stack::push_pop(*this);
stack::check<coroutine>(L, -1, type_panic);
#endif // Safety
}
call_status status() const noexcept {
return stats;
@ -12931,4 +13077,17 @@ namespace sol {
// end of sol/coroutine.hpp
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // g++
#ifdef SOL_INSIDE_UNREAL
#ifdef SOL_INSIDE_UNREAL_REMOVED_CHECK
#define check(expr) { if(UNLIKELY(!(expr))) { FDebug::LogAssertFailedMessage( #expr, __FILE__, __LINE__ ); _DebugBreakAndPromptForRemote(); FDebug::AssertFailed( #expr, __FILE__, __LINE__ ); CA_ASSUME(false); } }}
#endif
#endif // Unreal Engine 4 Bullshit
#endif // SOL_HPP
// end of sol.hpp
#endif // SOL_SINGLE_INCLUDE_HPP