mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
fix multiply-declared forward declaration values
transition to CATCH2 (no changes really) fix diagnostic printout for single.py update ignores update CMake to download CATCH single update single
This commit is contained in:
parent
cf81d815a9
commit
c0660b454c
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -89,3 +89,4 @@ main_aux.cpp
|
||||||
main.hpp
|
main.hpp
|
||||||
tmp_thingy_user.lua
|
tmp_thingy_user.lua
|
||||||
tmp_thingy.lua
|
tmp_thingy.lua
|
||||||
|
external/
|
||||||
|
|
|
@ -77,11 +77,16 @@ if (EXAMPLES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (TESTS)
|
if (TESTS)
|
||||||
|
# Catch now has a single header: pull it in directly using CMake's download
|
||||||
|
# catch requires C++ files when built out of its tree now, so we cannot 'just get the git repository' anymore
|
||||||
|
# which sort of sucks, but MEH
|
||||||
|
# this is easiest for now
|
||||||
|
file(download https://github.com/catchorg/Catch2/releases/download/v2.0.1/catch.hpp ${CMAKE_BINARY_DIR}/Catch/include/catch.hpp)
|
||||||
file(GLOB TEST_SRC tests/test*.cpp)
|
file(GLOB TEST_SRC tests/test*.cpp)
|
||||||
source_group(tests FILES ${TEST_SRC})
|
source_group(tests FILES ${TEST_SRC})
|
||||||
|
|
||||||
add_executable(tests ${TEST_SRC} ${HEADER_SRCS})
|
add_executable(tests ${TEST_SRC} ${HEADER_SRCS})
|
||||||
target_include_directories(tests PRIVATE ${CMAKE_SOURCE_DIR}/Catch/include/)
|
target_include_directories(tests PRIVATE ${CMAKE_BINARY_DIR}/Catch/include/)
|
||||||
add_test(Tests tests)
|
add_test(Tests tests)
|
||||||
|
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
|
|
@ -197,5 +197,5 @@ with open(single_file, 'w', encoding='utf-8') as f:
|
||||||
|
|
||||||
with open(forward_single_file, 'w', encoding='utf-8') as f:
|
with open(forward_single_file, 'w', encoding='utf-8') as f:
|
||||||
if not args.quiet:
|
if not args.quiet:
|
||||||
print('writing {}...'.format(single_file))
|
print('writing {}...'.format(forward_single_file))
|
||||||
f.write(forward_result)
|
f.write(forward_result)
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// This file was generated with a script.
|
// This file was generated with a script.
|
||||||
// Generated 2017-12-10 20:56:35.224200 UTC
|
// Generated 2017-12-11 17:29:42.822392 UTC
|
||||||
// This header was generated with sol v2.19.0 (revision c3c7f42)
|
// This header was generated with sol v2.19.0 (revision cf81d81)
|
||||||
// https://github.com/ThePhD/sol2
|
// https://github.com/ThePhD/sol2
|
||||||
|
|
||||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||||
|
@ -72,6 +72,7 @@
|
||||||
|
|
||||||
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)))
|
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)))
|
||||||
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
|
#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
|
#endif
|
||||||
|
|
||||||
|
@ -186,17 +187,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif // avoiding nil defines / keywords
|
#endif // avoiding nil defines / keywords
|
||||||
|
|
||||||
namespace sol {
|
|
||||||
namespace detail {
|
|
||||||
const bool default_safe_function_calls =
|
|
||||||
#ifdef SOL_SAFE_FUNCTION_CALLS
|
|
||||||
true;
|
|
||||||
#else
|
|
||||||
false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
} // namespace sol::detail
|
|
||||||
|
|
||||||
// end of sol/feature_test.hpp
|
// end of sol/feature_test.hpp
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
@ -4108,6 +4098,15 @@ namespace sol {
|
||||||
// beginning of sol/forward_detail.hpp
|
// beginning of sol/forward_detail.hpp
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
namespace detail {
|
||||||
|
const bool default_safe_function_calls =
|
||||||
|
#ifdef SOL_SAFE_FUNCTION_CALLS
|
||||||
|
true;
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
namespace meta {
|
namespace meta {
|
||||||
namespace meta_detail {
|
namespace meta_detail {
|
||||||
}
|
}
|
||||||
|
@ -4425,6 +4424,8 @@ namespace sol {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
typedef int (*lua_CFunction_noexcept)(lua_State* L) noexcept;
|
typedef int (*lua_CFunction_noexcept)(lua_State* L) noexcept;
|
||||||
|
#else
|
||||||
|
typedef int(*lua_CFunction_noexcept)(lua_State* L);
|
||||||
#endif // noexcept function type for lua_CFunction
|
#endif // noexcept function type for lua_CFunction
|
||||||
|
|
||||||
#ifdef SOL_NO_EXCEPTIONS
|
#ifdef SOL_NO_EXCEPTIONS
|
||||||
|
@ -12540,12 +12541,12 @@ namespace sol {
|
||||||
template <typename F, F fx>
|
template <typename F, F fx>
|
||||||
inline int c_call(lua_State* L) {
|
inline int c_call(lua_State* L) {
|
||||||
typedef meta::unqualified_t<F> Fu;
|
typedef meta::unqualified_t<F> Fu;
|
||||||
return function_detail::c_call_raw<F, fx>(std::integral_constant < bool, std::is_same<Fu, lua_CFunction>::value
|
typedef std::integral_constant<bool, std::is_same<Fu, lua_CFunction>::value
|
||||||
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
|| std::is_same<Fu, detail::lua_CFunction_noexcept>::value
|
|| std::is_same<Fu, detail::lua_CFunction_noexcept>::value
|
||||||
#endif
|
#endif
|
||||||
> (),
|
> is_raw;
|
||||||
L);
|
return function_detail::c_call_raw<F, fx>(is_raw(), L);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename F, F f>
|
template <typename F, F f>
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// This file was generated with a script.
|
// This file was generated with a script.
|
||||||
// Generated 2017-12-10 20:56:35.410742 UTC
|
// Generated 2017-12-11 17:29:42.995868 UTC
|
||||||
// This header was generated with sol v2.19.0 (revision c3c7f42)
|
// This header was generated with sol v2.19.0 (revision cf81d81)
|
||||||
// https://github.com/ThePhD/sol2
|
// https://github.com/ThePhD/sol2
|
||||||
|
|
||||||
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP
|
||||||
|
@ -39,6 +39,7 @@
|
||||||
|
|
||||||
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)))
|
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)))
|
||||||
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
|
#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
|
#endif
|
||||||
|
|
||||||
|
@ -153,17 +154,6 @@
|
||||||
#endif
|
#endif
|
||||||
#endif // avoiding nil defines / keywords
|
#endif // avoiding nil defines / keywords
|
||||||
|
|
||||||
namespace sol {
|
|
||||||
namespace detail {
|
|
||||||
const bool default_safe_function_calls =
|
|
||||||
#ifdef SOL_SAFE_FUNCTION_CALLS
|
|
||||||
true;
|
|
||||||
#else
|
|
||||||
false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
} // namespace sol::detail
|
|
||||||
|
|
||||||
// end of sol/feature_test.hpp
|
// end of sol/feature_test.hpp
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)))
|
#if defined(__cpp_noexcept_function_type) || ((defined(_MSC_VER) && _MSC_VER > 1911) && ((defined(_HAS_CXX17) && _HAS_CXX17 == 1) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)))
|
||||||
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifndef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
//#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
|
#endif
|
||||||
|
|
||||||
|
@ -173,15 +173,4 @@
|
||||||
#endif
|
#endif
|
||||||
#endif // avoiding nil defines / keywords
|
#endif // avoiding nil defines / keywords
|
||||||
|
|
||||||
namespace sol {
|
|
||||||
namespace detail {
|
|
||||||
const bool default_safe_function_calls =
|
|
||||||
#ifdef SOL_SAFE_FUNCTION_CALLS
|
|
||||||
true;
|
|
||||||
#else
|
|
||||||
false;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
} // namespace sol::detail
|
|
||||||
|
|
||||||
#endif // SOL_FEATURE_TEST_HPP
|
#endif // SOL_FEATURE_TEST_HPP
|
||||||
|
|
|
@ -27,6 +27,16 @@
|
||||||
#include "traits.hpp"
|
#include "traits.hpp"
|
||||||
|
|
||||||
namespace sol {
|
namespace sol {
|
||||||
|
namespace detail {
|
||||||
|
const bool default_safe_function_calls =
|
||||||
|
#ifdef SOL_SAFE_FUNCTION_CALLS
|
||||||
|
true;
|
||||||
|
#else
|
||||||
|
false;
|
||||||
|
#endif
|
||||||
|
} // namespace detail
|
||||||
|
|
||||||
|
|
||||||
namespace meta {
|
namespace meta {
|
||||||
namespace meta_detail {
|
namespace meta_detail {
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,12 +117,12 @@ namespace sol {
|
||||||
template <typename F, F fx>
|
template <typename F, F fx>
|
||||||
inline int c_call(lua_State* L) {
|
inline int c_call(lua_State* L) {
|
||||||
typedef meta::unqualified_t<F> Fu;
|
typedef meta::unqualified_t<F> Fu;
|
||||||
return function_detail::c_call_raw<F, fx>(std::integral_constant < bool, std::is_same<Fu, lua_CFunction>::value
|
typedef std::integral_constant<bool, std::is_same<Fu, lua_CFunction>::value
|
||||||
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
|| std::is_same<Fu, detail::lua_CFunction_noexcept>::value
|
|| std::is_same<Fu, detail::lua_CFunction_noexcept>::value
|
||||||
#endif
|
#endif
|
||||||
> (),
|
> is_raw;
|
||||||
L);
|
return function_detail::c_call_raw<F, fx>(is_raw(), L);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename F, F f>
|
template <typename F, F f>
|
||||||
|
|
|
@ -44,6 +44,8 @@ namespace sol {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
#ifdef SOL_NOEXCEPT_FUNCTION_TYPE
|
||||||
typedef int (*lua_CFunction_noexcept)(lua_State* L) noexcept;
|
typedef int (*lua_CFunction_noexcept)(lua_State* L) noexcept;
|
||||||
|
#else
|
||||||
|
typedef int(*lua_CFunction_noexcept)(lua_State* L);
|
||||||
#endif // noexcept function type for lua_CFunction
|
#endif // noexcept function type for lua_CFunction
|
||||||
|
|
||||||
#ifdef SOL_NO_EXCEPTIONS
|
#ifdef SOL_NO_EXCEPTIONS
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
TEST_CASE("gc/destructors", "test if destructors are fired properly through gc of unbound usertypes") {
|
TEST_CASE("gc/destructors", "test if destructors are fired properly through gc of unbound usertypes") {
|
||||||
struct test;
|
struct test;
|
||||||
|
|
|
@ -1801,7 +1801,7 @@ TEST_CASE("usertype/meta-key-retrievals", "allow for special meta keys (__index,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE("usertype/noexcept-methods", "make sure noexcept functinos and methods can be bound to usertypes without issues") {
|
TEST_CASE("usertype/noexcept-methods", "make sure noexcept functions and methods can be bound to usertypes without issues") {
|
||||||
struct T {
|
struct T {
|
||||||
static int noexcept_function() noexcept {
|
static int noexcept_function() noexcept {
|
||||||
return 0x61;
|
return 0x61;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define CATCH_CONFIG_MAIN
|
#define CATCH_CONFIG_MAIN 1
|
||||||
#define SOL_CHECK_ARGUMENTS 1
|
#define SOL_CHECK_ARGUMENTS 1
|
||||||
#define SOL_ENABLE_INTEROP 1
|
#define SOL_ENABLE_INTEROP 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user