mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
parent
81912b6dd4
commit
80df3fc915
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
|
@ -40,6 +40,13 @@
|
||||||
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
|
#define SOL_NOEXCEPT_FUNCTION_TYPE 1
|
||||||
#endif // noexcept is part of a function's type
|
#endif // noexcept is part of a function's type
|
||||||
#endif // compiler-specific checks
|
#endif // compiler-specific checks
|
||||||
|
#if defined(__clang__) && defined(__APPLE__)
|
||||||
|
#if __has_include && __has_include(<variant>)
|
||||||
|
#define SOL_STD_VARIANT 1
|
||||||
|
#endif // has include nonsense
|
||||||
|
#else
|
||||||
|
#define SOL_STD_VARIANT 1
|
||||||
|
#endif // Clang screws up variant
|
||||||
#endif // C++17 only
|
#endif // C++17 only
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace sol {
|
||||||
|
|
||||||
template <typename... Ret, typename... Args>
|
template <typename... Ret, typename... Args>
|
||||||
decltype(auto) call(Args&&... args) {
|
decltype(auto) call(Args&&... args) {
|
||||||
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER <= 191326128 && _MSC_FULL_VER >= 191200000
|
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER <= 191326131 && _MSC_FULL_VER >= 191200000
|
||||||
// MSVC is ass sometimes
|
// MSVC is ass sometimes
|
||||||
return get<protected_function>().call<Ret...>(std::forward<Args>(args)...);
|
return get<protected_function>().call<Ret...>(std::forward<Args>(args)...);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -89,6 +89,7 @@ namespace sol {
|
||||||
detail::call_exception_handler(lua_state(), maybe_ex, error);
|
detail::call_exception_handler(lua_state(), maybe_ex, error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
(void)onexcept;
|
||||||
#if !defined(SOL_EXCEPTIONS_SAFE_PROPAGATION) || defined(SOL_LUAJIT)
|
#if !defined(SOL_EXCEPTIONS_SAFE_PROPAGATION) || defined(SOL_LUAJIT)
|
||||||
try {
|
try {
|
||||||
#endif // Safe Exception Propagation
|
#endif // Safe Exception Propagation
|
||||||
|
|
|
@ -126,7 +126,7 @@ namespace sol {
|
||||||
|
|
||||||
template <typename... Ret, typename... Args>
|
template <typename... Ret, typename... Args>
|
||||||
decltype(auto) call(Args&&... args) {
|
decltype(auto) call(Args&&... args) {
|
||||||
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER <= 191326128 && _MSC_FULL_VER >= 191200000
|
#if defined(_MSC_FULL_VER) && _MSC_FULL_VER <= 191326131 && _MSC_FULL_VER >= 191200000
|
||||||
// MSVC is ass sometimes
|
// MSVC is ass sometimes
|
||||||
return get<function>().call<Ret...>(std::forward<Args>(args)...);
|
return get<function>().call<Ret...>(std::forward<Args>(args)...);
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -38,7 +38,9 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#ifdef SOL_CXX17_FEATURES
|
#ifdef SOL_CXX17_FEATURES
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#ifdef SOL_STD_VARIANT
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
#endif // Apple clang screwed up
|
||||||
#endif // C++17
|
#endif // C++17
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
@ -841,6 +843,7 @@ namespace stack {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SOL_CXX17_FEATURES
|
#ifdef SOL_CXX17_FEATURES
|
||||||
|
#ifdef SOL_STD_VARIANT
|
||||||
template <typename... Tn>
|
template <typename... Tn>
|
||||||
struct getter<std::variant<Tn...>> {
|
struct getter<std::variant<Tn...>> {
|
||||||
typedef std::variant<Tn...> V;
|
typedef std::variant<Tn...> V;
|
||||||
|
@ -876,6 +879,7 @@ namespace stack {
|
||||||
return get_one(std::integral_constant<std::size_t, V_size::value>(), L, index, tracking);
|
return get_one(std::integral_constant<std::size_t, V_size::value>(), L, index, tracking);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#endif // Apple Clang screwed up
|
||||||
#endif // C++17-wave
|
#endif // C++17-wave
|
||||||
}
|
}
|
||||||
} // namespace sol::stack
|
} // namespace sol::stack
|
||||||
|
|
|
@ -37,7 +37,9 @@
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#ifdef SOL_CXX17_FEATURES
|
#ifdef SOL_CXX17_FEATURES
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#ifdef SOL_STD_VARIANT
|
||||||
#include <variant>
|
#include <variant>
|
||||||
|
#endif // Can use variant
|
||||||
#endif // C++17
|
#endif // C++17
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
@ -987,6 +989,7 @@ namespace stack {
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef SOL_CXX17_FEATURES
|
#ifdef SOL_CXX17_FEATURES
|
||||||
|
#ifdef SOL_STD_VARIANT
|
||||||
namespace stack_detail {
|
namespace stack_detail {
|
||||||
|
|
||||||
struct push_function {
|
struct push_function {
|
||||||
|
@ -1014,6 +1017,7 @@ namespace stack {
|
||||||
return std::visit(stack_detail::push_function(L), std::move(v));
|
return std::visit(stack_detail::push_function(L), std::move(v));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
#endif // Variant because Clang is terrible
|
||||||
#endif // C++17 Support
|
#endif // C++17 Support
|
||||||
}
|
}
|
||||||
} // namespace sol::stack
|
} // namespace sol::stack
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# # # # sol2
|
# # # # sol2
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2017 Rapptz, ThePhD, and contributors
|
# Copyright (c) 2013-2018 Rapptz, ThePhD, and contributors
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
# this software and associated documentation files (the "Software"), to deal in
|
# this software and associated documentation files (the "Software"), to deal in
|
||||||
|
|
Loading…
Reference in New Issue
Block a user