From a9259637084afb5e6446e37b53cf1fce2a726897 Mon Sep 17 00:00:00 2001 From: ThePhD Date: Sat, 23 Mar 2019 12:09:51 -0400 Subject: [PATCH] appveyor.yml updates to try and more properly capture constraints travis.yml updates to try and more properly capture constraints I truly dislike MSVC's inability to handle lots of using statements. --- .travis.yml | 66 ++++++------ appveyor.yml | 42 +++++--- cmake/Modules/FindLuaBuild.cmake | 2 +- cmake/Modules/FindLuaBuild/LuaJIT.cmake | 128 ++++++++++++----------- include/sol/reference.hpp | 1 + include/sol/sol.hpp | 6 +- include/sol/table_core.hpp | 22 ++-- include/sol/traits.hpp | 4 +- scripts/push.linux.sh | 6 +- scripts/run.linux.sh | 2 +- scripts/run.osx.sh | 4 +- single/include/sol/forward.hpp | 4 +- single/include/sol/sol.hpp | 63 +++++------ tests/runtime_tests/source/basic.cpp | 4 +- tests/runtime_tests/source/functions.cpp | 10 +- 15 files changed, 199 insertions(+), 165 deletions(-) diff --git a/.travis.yml b/.travis.yml index ef7f2168..d76c2f99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,15 +37,6 @@ script: - sudo docker image pull thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} - sudo docker run --rm --interactive --tty --name "sol2.test" -v "${SOL2_DIR}:/root/sol2" --env "SOL2_CI=${SOL2_CI}" --env "SOL2_PLATFORM=${SOL2_PLATFORM}" --env "SOL2_LUA_VERSION=${SOL2_LUA_VERSION}" --env "SOL2_TEST_SINGLE=${SOL2_TEST_SINGLE}" --env "SOL2_TEST_INTEROP=${SOL2_TEST_INTEROP}" --env "GCC_VERSION=${GCC_VERSION}" --env "LLVM_VERSION=${LLVM_VERSION}" thephd/sol2:gcc-${GCC_VERSION}_llvm-${LLVM_VERSION} -after_success: -- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh -- chmod +x send.sh -- ./send.sh success ${DISORD_WEBHOOK_URL} -after_failure: -- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh -- chmod +x send.sh -- ./send.sh failure ${DISORD_WEBHOOK_URL} - matrix: fast_finish: true allow_failures: @@ -66,24 +57,18 @@ matrix: SOL2_CI=true - env: - - LLVM_VERSION=7.0.1 - SOL2_LUA_VERSION=5.3.5 + - SOL2_LUA_VERSION=5.3.5 + LLVM_VERSION=7.0.1 SOL2_PLATFORM=x64 SOL2_CI=true - env: - - LLVM_VERSION=8.0.0 - SOL2_LUA_VERSION=5.3.5 + - SOL2_LUA_VERSION=5.3.5 + LLVM_VERSION=8.0.0 SOL2_PLATFORM=x64 SOL2_CI=true # GCC 7.x, 8.x - - env: - - SOL2_LUA_VERSION=5.3.5 - GCC_VERSION=8 - SOL2_PLATFORM=i686 - SOL2_CI=true - - env: - SOL2_LUA_VERSION=5.3.5 GCC_VERSION=7 @@ -121,6 +106,19 @@ matrix: SOL2_PLATFORM=x64 SOL2_CI=true + # x86 builds + - env: + - SOL2_LUA_VERSION=5.3.5 + GCC_VERSION=8 + SOL2_PLATFORM=i686 + SOL2_CI=true + + - env: + - SOL2_LUA_VERSION=5.3.5 + LLVM_VERSION=8.0.0 + SOL2_PLATFORM=i686 + SOL2_CI=true + - env: - SOL2_LUA_VERSION=luajit-2.0.5 GCC_VERSION=8 @@ -135,26 +133,25 @@ matrix: # Test Single, Interop, Etc. - env: - - LLVM_VERSION=7.0.0 - SOL2_LUA_VERSION=5.3.5 - SOL2_PLATFORM=x64 - SOL2_CI=true + - SOL2_LUA_VERSION=5.3.5 SOL2_TEST_SINGLE=true SOL2_TEST_INTEROP=true + LLVM_VERSION=8.0.0 + SOL2_PLATFORM=x64 + SOL2_CI=true - env: - SOL2_LUA_VERSION=5.3.5 + SOL2_TEST_SINGLE=true + SOL2_TEST_INTEROP=true GCC_VERSION=8 SOL2_PLATFORM=x64 SOL2_CI=true - SOL2_TEST_SINGLE=true - SOL2_TEST_INTEROP=true - os: osx - osx_image: xcode9.0 + osx_image: xcode10.1 env: - SOL2_LUA_VERSION=lua-5.3.5 - LLVM_VERSION=5.0.2 before_install: - chmod +x ./scripts/run.osx.sh - chmod +x ./scripts/preparation.osx.sh @@ -163,10 +160,20 @@ matrix: - ./scripts/run.osx.sh - os: osx - osx_image: xcode9.1 + osx_image: xcode9.4 + env: + - SOL2_LUA_VERSION=lua-5.3.5 + before_install: + - chmod +x ./scripts/run.osx.sh + - chmod +x ./scripts/preparation.osx.sh + - ./scripts/preparation.osx.sh + script: + - ./scripts/run.osx.sh + + - os: osx + osx_image: xcode9.3 env: - SOL2_LUA_VERSION=lua-5.3.5 - LLVM_VERSION=5.0.2 before_install: - chmod +x ./scripts/run.osx.sh - chmod +x ./scripts/preparation.osx.sh @@ -178,7 +185,6 @@ matrix: osx_image: xcode9.2 env: - SOL2_LUA_VERSION=lua-5.3.5 - LLVM_VERSION=5.0.2 before_install: - chmod +x ./scripts/run.osx.sh - chmod +x ./scripts/preparation.osx.sh diff --git a/appveyor.yml b/appveyor.yml index 7923b2b3..e44568f3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -45,19 +45,24 @@ platform: environment: matrix: # apparently, I can't quite make LLVM work right now... - - LUA_VERSION: 5.3.5 + - SOL2_LUA_VERSION: 5.3.5 MINGW_VERSION: 7.3.0 - - LUA_VERSION: 5.3.5 + - SOL2_LUA_VERSION: 5.3.5 MINGW_VERSION: 8.1.0 - - LUA_VERSION: luajit-2.0.5 + - SOL2_LUA_VERSION: luajit-2.0.5 MINGW_VERSION: 8.1.0 - - LUA_VERSION: luajit-2.1.0-beta3 + - SOL2_LUA_VERSION: luajit-2.1.0-beta3 MINGW_VERSION: 8.1.0 - - LUA_VERSION: 5.3.5 - - LUA_VERSION: 5.2.4 - - LUA_VERSION: 5.1.5 - - LUA_VERSION: luajit-2.0.5 - - LUA_VERSION: luajit-2.1.0-beta3 + - SOL2_LUA_VERSION: 5.3.5 + SOL2_NO_2015: true + - SOL2_LUA_VERSION: 5.2.4 + SOL2_NO_2015: true + - SOL2_LUA_VERSION: 5.1.5 + SOL2_NO_2015: true + - SOL2_LUA_VERSION: luajit-2.0.5 + SOL2_NO_2015: true + - SOL2_LUA_VERSION: luajit-2.1.0-beta3 + SOL2_NO_2015: true matrix: allow_failures: @@ -74,11 +79,20 @@ matrix: platform: x86 - MINGW_VERSION: 8.1.0 platform: x86 + # Get rid of Visual Studio 2015 builds (unsupported) + - image: Visual Studio 2015 + SOL_NO_2015: true + - platform: x86 + SOL2_LUA_VERSION: 5.2.4 + - platform: x86 + SOL2_LUA_VERSION: 5.1.5 # Get rid of x86 builds for non-latest (no reason to redo that work) - platform: x86 - LUA_VERSION: 5.2.4 + SOL2_LUA_VERSION: 5.3.5 - platform: x86 - LUA_VERSION: 5.1.5 + SOL2_LUA_VERSION: 5.2.4 + - platform: x86 + SOL2_LUA_VERSION: 5.1.5 init: # # Ninja @@ -131,9 +145,9 @@ before_build: - md buid-sol2\Debug - md buid-sol2\Release - cd build-sol2 -- if not defined %MINGW_VERSION% (cmake .. -G "%CMAKE_GENERATOR%" %build_compiler% -DSOL2_LUA_VERSION="%LUA_VERSION%" -DSOL2_CI=ON -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=%lua_build_type% -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON) -- if defined %MINGW_VERSION% (cmake ..\.. -G "%CMAKE_GENERATOR%" %build_compiler% -DSOL2_LUA_VERSION="%LUA_VERSION%" -DSOL2_CI=ON -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=%lua_build_type% -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON) -- if defined %MINGW_VERSION% (cmake ..\.. -G "%CMAKE_GENERATOR%" %build_compiler% -DSOL2_LUA_VERSION="%LUA_VERSION%" -DSOL2_CI=ON -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=%lua_build_type% -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON) +- if not defined %MINGW_VERSION% (cmake .. -G "%CMAKE_GENERATOR%" %build_compiler% -DSOL2_LUA_VERSION="%SOL2_LUA_VERSION%" -DSOL2_CI=ON -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=%lua_build_type% -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON) +- if defined %MINGW_VERSION% (cmake ..\.. -G "%CMAKE_GENERATOR%" %build_compiler% -DSOL2_LUA_VERSION="%SOL2_LUA_VERSION%" -DSOL2_CI=ON -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=%lua_build_type% -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON) +- if defined %MINGW_VERSION% (cmake ..\.. -G "%CMAKE_GENERATOR%" %build_compiler% -DSOL2_LUA_VERSION="%SOL2_LUA_VERSION%" -DSOL2_CI=ON -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=%lua_build_type% -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON) # We do not build the debug versions because the compiler # generates too much debug info for MinGW to handle diff --git a/cmake/Modules/FindLuaBuild.cmake b/cmake/Modules/FindLuaBuild.cmake index b0d3c60c..6ed229a7 100644 --- a/cmake/Modules/FindLuaBuild.cmake +++ b/cmake/Modules/FindLuaBuild.cmake @@ -116,5 +116,5 @@ unset(find_lua_build) # all listed variables are TRUE FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaBuild FOUND_VAR LUABUILD_FOUND - REQUIRED_VARS LUA_LIBRARIES LUA_INTERPRETER LUA_INCLUDE_DIRS + REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIRS VERSION_VAR LUA_VERSION_STRING) diff --git a/cmake/Modules/FindLuaBuild/LuaJIT.cmake b/cmake/Modules/FindLuaBuild/LuaJIT.cmake index c1e88d42..0240fb43 100644 --- a/cmake/Modules/FindLuaBuild/LuaJIT.cmake +++ b/cmake/Modules/FindLuaBuild/LuaJIT.cmake @@ -145,6 +145,7 @@ endif() set(LUA_JIT_SOURCE_DIR "${LUA_BUILD_TOPLEVEL}/src") set(LUA_JIT_INSTALL_DIR "${LUA_BUILD_TOPLEVEL}/install") +set(LUA_JIT_INCLUDE_DIRS "${LUA_JIT_SOURCE_DIR}") file(MAKE_DIRECTORY ${LUA_JIT_SOURCE_DIR}) file(MAKE_DIRECTORY ${LUA_JIT_INSTALL_DIR}) @@ -165,9 +166,9 @@ if (MSVC) # Visual C++ is predicated off running msvcbuild.bat # which requires a Visual Studio Command Prompt if (BUILD_LUA_AS_DLL) - set(LUA_JIT_BUILD_COMMAND BUILD_COMMAND cd src && msvcbuild.bat) + set(LUA_JIT_MAKE_COMMAND cd src && msvcbuild.bat) else() - set(LUA_JIT_BUILD_COMMAND BUILD_COMMAND cd src && msvcbuild.bat static) + set(LUA_JIT_MAKE_COMMAND cd src && msvcbuild.bat static) endif() set(LUA_JIT_PREBUILT_LIB "lua51.lib") set(LUA_JIT_PREBUILT_IMP_LIB "lua51.lib") @@ -189,13 +190,12 @@ else () list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "LUAJIT_A=${LUA_JIT_LIB_FILENAME}") set(LUA_JIT_MAKE_CFLAGS_MODIFICATIONS "") set(LUA_JIT_MAKE_HOST_CFLAGS_MODIFICATIONS "") - set(LUA_JIT_MAKE_TARGET_CFLAGS_MODIFICATIONS "") + set(LUA_JIT_MAKE_TARGET_CFLAGS_MODIFICATIONS "-fPIC") if (BUILD_LUA_AS_DLL) list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "LUAJIT_SO=${LUA_JIT_DLL_FILENAME}" "TARGET_SONAME=${LUA_JIT_DLL_FILENAME}" "TARGET_DYLIBNAME=${LUA_JIT_DLL_FILENAME}" "TARGET_DLLNAME=${LUA_JIT_DLL_FILENAME}") list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "BUILDMODE=dynamic") else() list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "BUILDMODE=static") - set(LUA_JIT_MAKE_TARGET_CFLAGS_MODIFICATIONS "${LUA_JIT_MAKE_TARGET_CFLAGS_MODIFICATIONS} -fPIC") endif() if (IS_X86) list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "CC=${CMAKE_C_COMPILER} -m32") @@ -217,10 +217,11 @@ else () list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "CFLAGS=${LUA_JIT_MAKE_CFLAGS_MODIFICATIONS}") list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "TARGET_CFLAGS=${LUA_JIT_MAKE_TARGET_CFLAGS_MODIFICATIONS}") list(APPEND LUA_JIT_MAKE_BUILD_MODIFICATIONS "HOST_CFLAGS=${LUA_JIT_MAKE_HOST_CFLAGS_MODIFICATIONS}") - - set(LUA_JIT_BUILD_COMMAND BUILD_COMMAND "${MAKE_PROGRAM}" ${LUA_JIT_MAKE_BUILD_MODIFICATIONS}) + set(LUA_JIT_MAKE_COMMAND "${MAKE_PROGRAM}" ${LUA_JIT_MAKE_BUILD_MODIFICATIONS}) endif() +set(LUA_JIT_BUILD_COMMAND BUILD_COMMAND ${LUA_JIT_MAKE_COMMAND}) + set(lualib luajit_lib_${LUA_JIT_VERSION}) set(luainterpreter luajit_${LUA_JIT_VERSION}) @@ -247,15 +248,20 @@ elseif(LUA_JIT_NORMALIZED_LUA_VERSION MATCHES "latest") set(LUA_JIT_PULL_LATEST TRUE) endif() -set(LUA_JIT_BYPRODUCTS "${LUA_JIT_SOURCE_LUA_LIB}" "${LUA_JIT_SOURCE_LUA_LIB_EXP}" - "${LUA_JIT_SOURCE_LUA_DLL}" "${LUA_JIT_SOURCE_LUA_INTERPRETER}") +set(LUA_JIT_BYPRODUCTS "${LUA_JIT_SOURCE_LUA_DLL}" "${LUA_JIT_SOURCE_LUA_INTERPRETER}") +set(LUA_JIT_INSTALL_BYPRODUCTS "${LUA_JIT_DESTINATION_LUA_DLL}" "${LUA_JIT_DESTINATION_LUA_INTERPRETER}") -set(LUA_JIT_INSTALL_BYPRODUCTS "${LUA_JIT_DESTINATION_LUA_LIB}" "${LUA_JIT_DESTINATION_LUA_LIB_EXP}" - "${LUA_JIT_DESTINATION_LUA_DLL}" "${LUA_JIT_DESTINATION_LUA_INTERPRETER}") +if (BUILD_LUA_AS_DLL AND MSVC) + set(LUA_JIT_BYPRODUCTS ${LUA_JIT_BYPRODUCTS} "${LUA_JIT_SOURCE_LUA_LIB_EXP}") + set(LUA_JIT_INSTALL_BYPRODUCTS ${LUA_JIT_INSTALL_BYPRODUCTS} "${LUA_JIT_DESTINATION_LUA_LIB_EXP}") +endif() -if (CMAKE_IMPORT_LIBRARY_SUFFIX) - set(LUA_JIT_BYPRODUCTS "${LUA_JIT_BYPRODUCTS}" "${LUA_JIT_SOURCE_LUA_IMP_LIB}") +if (CMAKE_IMPORT_LIBRARY_SUFFIX AND BUILD_LUA_AS_DLL) + set(LUA_JIT_BYPRODUCTS ${LUA_JIT_BYPRODUCTS} "${LUA_JIT_SOURCE_LUA_IMP_LIB}") set(LUA_JIT_INSTALL_BYPRODUCTS "${LUA_JIT_INSTALL_BYPRODUCTS}" "${LUA_JIT_DESTINATION_LUA_IMP_LIB}") +else() + set(LUA_JIT_BYPRODUCTS ${LUA_JIT_BYPRODUCTS} "${LUA_JIT_SOURCE_LUA_LIB}") + set(LUA_JIT_INSTALL_BYPRODUCTS ${LUA_JIT_INSTALL_BYPRODUCTS} "${LUA_JIT_DESTINATION_LUA_LIB}") endif() # # Post-Build moving steps for necessary items @@ -277,7 +283,24 @@ else() set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_LIB}" "${LUA_JIT_DESTINATION_LUA_LIB}") endif() -if (LUA_JIT_GIT_COMMIT OR LUA_JIT_PULL_LATEST) +if (LUA_LOCAL_DIR) + file(COPY "${LUA_LOCAL_DIR}/" + DESTINATION "${LUA_BUILD_TOPLEVEL}" + FILES_MATCHING REGEX ".*" + ) + add_custom_command(OUTPUT ${LUA_JIT_BYPRODUCTS} + COMMAND ${LUA_JIT_MAKE_COMMAND} + WORKING_DIRECTORY "${LUA_BUILD_TOPLEVEL}" + DEPENDS "${LUA_BUILD_TOPLEVEL}/Makefile" "${LUA_BUILD_TOPLEVEL}/src/msvcbuild.bat" + COMMENT "Building LuaJIT ${LUA_JIT_VERSION}..." + ) + add_custom_target(LUA_JIT-move + ${LUA_JIT_POSTBUILD_COMMANDS} + COMMENT ${LUA_JIT_POSTBUILD_COMMENTS} + BYPRODUCTS ${LUA_JIT_INSTALL_BYPRODUCTS} + DEPENDS ${LUA_JIT_BYPRODUCTS} + ) +elseif (LUA_JIT_GIT_COMMIT OR LUA_JIT_PULL_LATEST) if (LUA_JIT_PULL_LATEST) MESSAGE(STATUS "Latest LuaJIT has been requested: pulling from git...") elseif (LUA_JIT_GIT_COMMIT) @@ -300,11 +323,11 @@ if (LUA_JIT_GIT_COMMIT OR LUA_JIT_PULL_LATEST) ${LUA_JIT_BUILD_COMMAND} INSTALL_COMMAND "" TEST_COMMAND "" - BUILD_BYPRODUCTS "${LUA_JIT_BYPRODUCTS}" "${LUA_JIT_BYPRODUCTS}") + BUILD_BYPRODUCTS ${LUA_JIT_BYPRODUCTS}) else() ExternalProject_Add(LUA_JIT BUILD_IN_SOURCE TRUE - BUILD_ALWAYS FALSE + BUILD_ALWAYS TRUE # LuaJIT does not offer a TLS/SSL port TLS_VERIFY FALSE PREFIX "${LUA_BUILD_TOPLEVEL}" @@ -319,63 +342,50 @@ else() CONFIGURE_COMMAND "" ${LUA_JIT_BUILD_COMMAND} INSTALL_COMMAND "" - TEST_COMMAND "") + TEST_COMMAND "" + BUILD_BYPRODUCTS ${LUA_JIT_BYPRODUCTS}) endif() -# # MAYBE?: -# Add additional post-build step to move all necessary headers/lua files -# for now, we just point directly to the `src` directory... - -ExternalProject_Add_Step(LUA_JIT move - ${LUA_JIT_POSTBUILD_COMMANDS} - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - COMMENT ${LUA_JIT_POSTBUILD_COMMENTS} - DEPENDS build - ALWAYS TRUE) -ExternalProject_Add_StepTargets(LUA_JIT move) +if (NOT LUA_LOCAL_DIR) + ExternalProject_Add_Step(LUA_JIT move + ALWAYS TRUE + ${LUA_JIT_POSTBUILD_COMMANDS} + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + COMMENT ${LUA_JIT_POSTBUILD_COMMENTS} + DEPENDEES build + DEPENDS ${LUA_JIT_BYPRODUCTS} + BYPRODUCTS ${LUA_JIT_INSTALL_BYPRODUCTS}) + ExternalProject_Add_StepTargets(LUA_JIT move) +endif() # # Lua Library -add_library(${lualib} ${LUA_BUILD_LIBRARY_TYPE} IMPORTED) -# make sure the library we export really does depend on Lua JIT's external project +add_library(${lualib} INTERFACE) add_dependencies(${lualib} LUA_JIT-move) -# Configure properties +target_include_directories(${lualib} + INTERFACE "${LUA_JIT_SOURCE_DIR}") if (BUILD_LUA_AS_DLL) if (MSVC) - set_target_properties(${lualib} - PROPERTIES - IMPORTED_IMPLIB "${LUA_JIT_DESTINATION_LUA_IMP_LIB}") + target_link_libraries(${lualib} + INTERFACE "${LUA_JIT_DESTINATION_LUA_LIB}") + else() + target_link_libraries(${lualib} + INTERFACE "${LUA_JIT_DESTINATION_LUA_DLL}") endif() - set_target_properties(${lualib} - PROPERTIES - IMPORTED_LOCATION "${LUA_JIT_DESTINATION_LUA_DLL}") -else () - set_target_properties(${lualib} - PROPERTIES - IMPORTED_LOCATION "${LUA_JIT_DESTINATION_LUA_LIB}") +else() + target_link_libraries(${lualib} + INTERFACE "${LUA_JIT_DESTINATION_LUA_LIB}") endif() -set_target_properties(${lualib} - PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES C - INTERFACE_INCLUDE_DIRECTORIES "${LUA_JIT_SOURCE_DIR}") + if (CMAKE_DL_LIBS) - set_target_properties(${lualib} - PROPERTIES - INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}) + target_link_libraries(${lualib} + INTERFACE ${CMAKE_DL_LIBS}) endif() if (XCODE) target_compile_options(${lualib} - PUBLIC -pagezero_size 10000 -image_base 100000000) + INTERFACE -pagezero_size 10000 -image_base 100000000) endif () - -# # Lua Executable -add_executable(${luainterpreter} IMPORTED) -# Add location pointing to executable -set_target_properties(${luainterpreter} - PROPERTIES - IMPORTED_LOCATION "${LUA_JIT_DESTINATION_LUA_INTERPRETER}") -add_dependencies(${luainterpreter} LUA_JIT-move) - + # # set externally-visible target indicator set(LUA_LIBRARIES ${lualib}) -set(LUA_INTERPRETER ${luainterpreter}) -set(LUA_INCLUDE_DIRS "${LUA_JIT_SOURCE_DIR}") +set(LUA_INTERPRETER "") +set(LUA_INCLUDE_DIRS "${LUA_JIT_INCLUDE_DIRS}") diff --git a/include/sol/reference.hpp b/include/sol/reference.hpp index 7f851a9e..8e6f00b7 100644 --- a/include/sol/reference.hpp +++ b/include/sol/reference.hpp @@ -132,6 +132,7 @@ namespace sol { ~push_popper() { } }; + template struct push_popper>::value>> { using Tu = meta::unqualified_t; diff --git a/include/sol/sol.hpp b/include/sol/sol.hpp index b491b001..70153dae 100644 --- a/include/sol/sol.hpp +++ b/include/sol/sol.hpp @@ -41,11 +41,7 @@ // we'll just let this alone for now #elif defined _MSC_VER #pragma warning(push) -//#pragma warning(disable : 4324) // structure was padded due to alignment specifier -//#pragma warning(disable : 4503) // decorated name horse shit -//#pragma warning(disable : 4702) // unreachable code -//#pragma warning(disable : 4127) // 'conditional expression is constant' yeah that's the point your old compilers don't have `if constexpr` you jerk -//#pragma warning(disable : 4505) // some other nonsense warning +#pragma warning(disable : 4505) // unreferenced local function has been removed GEE THANKS #endif // clang++ vs. g++ vs. VC++ #include "forward.hpp" diff --git a/include/sol/table_core.hpp b/include/sol/table_core.hpp index cd262428..74309d50 100644 --- a/include/sol/table_core.hpp +++ b/include/sol/table_core.hpp @@ -59,12 +59,6 @@ namespace sol { return luaL_error(L, "sol: cannot modify the elements of an enumeration table"); } - template - using is_global = meta::all, meta::is_c_str...>; - - template - constexpr inline bool is_global_v = is_global::value; - } // namespace detail template @@ -104,7 +98,7 @@ namespace sol { template decltype(auto) traverse_get_single(int table_index, Keys&&... keys) const { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; if constexpr (meta::is_optional_v>) { int popcount = 0; detail::ref_clean c(base_t::lua_state(), popcount); @@ -118,7 +112,7 @@ namespace sol { template void tuple_set(std::index_sequence, Pairs&& pairs) { - constexpr bool global = detail::is_global(std::forward(pairs)))...>::value; + constexpr bool global = meta::all, meta::is_c_str(std::forward(pairs)))>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); lua_State* L = base_t::lua_state(); @@ -309,7 +303,7 @@ namespace sol { template decltype(auto) get(Keys&&... keys) const { static_assert(sizeof...(Keys) == sizeof...(Ret), "number of keys and number of return types do not match"); - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return tuple_get(table_index, std::forward(keys)...); @@ -336,7 +330,7 @@ namespace sol { template decltype(auto) traverse_get(Keys&&... keys) const { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return traverse_get_single(table_index, std::forward(keys)...); @@ -344,7 +338,7 @@ namespace sol { template basic_table_core& traverse_set(Keys&&... keys) { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); lua_State* L = base_t::lua_state(); @@ -367,7 +361,7 @@ namespace sol { template decltype(auto) raw_get(Keys&&... keys) const { static_assert(sizeof...(Keys) == sizeof...(Ret), "number of keys and number of return types do not match"); - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return tuple_get(table_index, std::forward(keys)...); @@ -394,7 +388,7 @@ namespace sol { template decltype(auto) traverse_raw_get(Keys&&... keys) const { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return traverse_get_single(table_index, std::forward(keys)...); @@ -402,7 +396,7 @@ namespace sol { template basic_table_core& traverse_raw_set(Keys&&... keys) { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); lua_State* L = base_t::lua_state(); auto pn = stack::pop_n(L, static_cast(sizeof...(Keys) - 2)); diff --git a/include/sol/traits.hpp b/include/sol/traits.hpp index 7db51e6a..b87fff92 100644 --- a/include/sol/traits.hpp +++ b/include/sol/traits.hpp @@ -106,13 +106,13 @@ namespace sol { struct all : boolean {}; template - struct all : conditional_t, boolean> {}; + struct all : std::conditional_t, boolean> {}; template struct any : boolean {}; template - struct any : conditional_t, any> {}; + struct any : std::conditional_t, any> {}; template constexpr inline bool all_v = all::value; diff --git a/scripts/push.linux.sh b/scripts/push.linux.sh index 316d9d3f..08ea716f 100644 --- a/scripts/push.linux.sh +++ b/scripts/push.linux.sh @@ -26,13 +26,15 @@ CI=true declare -a gcc_versions gcc_versions=( - 7 - 8 +# 7 +# 8 ) declare -r gcc_versions declare -a llvm_versions llvm_versions=( + 3.9.1 + 4.0.0 # 5.0.2 # 6.0.1 # 7.0.1 diff --git a/scripts/run.linux.sh b/scripts/run.linux.sh index 08c40b3f..f459c905 100644 --- a/scripts/run.linux.sh +++ b/scripts/run.linux.sh @@ -73,7 +73,7 @@ echo -e "travis_fold:start:build_preparation.1\r" SOL2_CMAKE_DEFINES+=("-DSOL2_PLATFORM=${SOL2_PLATFORM}") SOL2_CMAKE_DEFINES+=('-DSOL2_CI=ON') SOL2_CMAKE_DEFINES+=('-DSOL2_BUILD_LUA=ON') - SOL2_CMAKE_DEFINES+=('-DBUILD_LUA_AS_DLL=OFF') + SOL2_CMAKE_DEFINES+=('-DBUILD_LUA_AS_DLL=ON') SOL2_CMAKE_DEFINES+=('-DSOL2_TESTS=ON') SOL2_CMAKE_DEFINES+=('-DSOL2_EXAMPLES=ON') SOL2_CMAKE_DEFINES+=('-DSOL2_TESTS_EXAMPLES=ON') diff --git a/scripts/run.osx.sh b/scripts/run.osx.sh index dbdd253f..743fbe9c 100644 --- a/scripts/run.osx.sh +++ b/scripts/run.osx.sh @@ -32,13 +32,13 @@ ninja --version cmake --version cd Debug - cmake ${SOL2_DIR} -G Xcode -DCMAKE_BUILD_TYPE=Debug -DSOL2_LUA_VERSION="${SOL2_LUA_VERSION}" -DSOL2_CI=ON -DSOL2_PLATFORM=${SOL2_PLATFORM} -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON + cmake "${SOL2_DIR}" -G Xcode -DCMAKE_BUILD_TYPE=Debug -DSOL2_LUA_VERSION="${SOL2_LUA_VERSION}" -DSOL2_CI=ON -DSOL2_PLATFORM=${SOL2_PLATFORM} -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE_GENERATED=ON -DSOL2_TESTS_SINGLE_GENERATED=ON cmake --build . --config Debug ctest --build-config Debug --output-on-failure cd .. cd Release - cmake ${SOL2_DIR} -G Xcode -DCMAKE_BUILD_TYPE=Release -DSOL2_LUA_VERSION="${SOL2_LUA_VERSION}" -DSOL2_CI=ON -DSOL2_PLATFORM=${SOL2_PLATFORM} -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE=ON -DSOL2_TESTS_SINGLE_GENERATED=ON + cmake "${SOL2_DIR}" -G Xcode -DCMAKE_BUILD_TYPE=Release -DSOL2_LUA_VERSION="${SOL2_LUA_VERSION}" -DSOL2_CI=ON -DSOL2_PLATFORM=${SOL2_PLATFORM} -DSOL2_BUILD_LUA=ON -DBUILD_LUA_AS_DLL=OFF -DSOL2_TESTS=ON -DSOL2_EXAMPLES=ON -DSOL2_GENERATE_SINGLE=ON -DSOL2_TESTS_EXAMPLES=ON -DSOL2_EXAMPLES_SINGLE=ON -DSOL2_TESTS_SINGLE_GENERATED=ON cmake --build . --config Release ctest --build-config Release --output-on-failure cd .. diff --git a/single/include/sol/forward.hpp b/single/include/sol/forward.hpp index 626232f6..ef91961f 100644 --- a/single/include/sol/forward.hpp +++ b/single/include/sol/forward.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2019-03-21 16:10:16.440886 UTC -// This header was generated with sol v3.0.0-beta (revision 04b36f1) +// Generated 2019-03-23 16:07:48.139041 UTC +// This header was generated with sol v3.0.0-beta (revision e846733) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP diff --git a/single/include/sol/sol.hpp b/single/include/sol/sol.hpp index e835a900..530f9984 100644 --- a/single/include/sol/sol.hpp +++ b/single/include/sol/sol.hpp @@ -20,8 +20,8 @@ // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. -// Generated 2019-03-21 16:10:16.112045 UTC -// This header was generated with sol v3.0.0-beta (revision 04b36f1) +// Generated 2019-03-23 16:07:47.653951 UTC +// This header was generated with sol v3.0.0-beta (revision e846733) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_HPP @@ -50,6 +50,7 @@ #elif defined(__clang__) #elif defined _MSC_VER #pragma warning(push) +#pragma warning(disable : 4505) // unreferenced local function has been removed GEE THANKS #endif // clang++ vs. g++ vs. VC++ // beginning of sol/forward.hpp @@ -1395,13 +1396,13 @@ namespace sol { struct all : boolean {}; template - struct all : conditional_t, boolean> {}; + struct all : std::conditional_t, boolean> {}; template struct any : boolean {}; template - struct any : conditional_t, any> {}; + struct any : std::conditional_t, any> {}; template constexpr inline bool all_v = all::value; @@ -1919,8 +1920,7 @@ namespace sol { struct is_pair> : std::true_type {}; template - using is_c_str = any>, const char*>, std::is_same>, char*>, - std::is_same, std::string>>; + using is_c_str = any, std::is_same, std::is_same, is_string_of, is_string_literal_array_of>; template constexpr inline bool is_c_str_v = is_c_str::value; @@ -8471,6 +8471,7 @@ namespace sol { ~push_popper() { } }; + template struct push_popper>::value>> { using Tu = meta::unqualified_t; @@ -10013,7 +10014,7 @@ namespace sol { } template - bool check_usertype(lua_State* L, int index, type index_type, Handler&& handler, record& tracking) { + bool check_usertype(lua_State* L, int index, type, Handler&& handler, record& tracking) { using Tu = meta::unqualified_t; using detail_t = meta::conditional_t, detail::as_pointer_tag, detail::as_value_tag>; return check(L, index, std::forward(handler), tracking); @@ -13933,7 +13934,7 @@ namespace stack { template struct field_setter { - static constexpr int default_table_index = meta::conditional_t < meta::is_c_str_v || (std::is_integral_v && !std::is_same_v) + static constexpr int default_table_index = meta::conditional_t<(meta::is_c_str_v || meta::is_string_of_v) || (std::is_integral_v && !std::is_same_v) || (std::is_integral_v && !std::is_same_v) || (raw && std::is_void_v>), std::integral_constant, std::integral_constant> ::value; @@ -13968,7 +13969,7 @@ namespace stack { } } else { - if constexpr (meta::is_c_str_v) { + if constexpr (meta::is_c_str_v || meta::is_string_of_v) { if constexpr (global) { push(L, std::forward(value)); lua_setglobal(L, &key[0]); @@ -20899,6 +20900,12 @@ namespace sol { namespace u_detail { stack::clear(gc_names_table); } if (named_metatable.valid()) { + lua_State* L = named_metatable.lua_state(); + auto pp = stack::push_pop(named_metatable); + int named_metatable_index = pp.index_of(named_metatable); + if (lua_getmetatable(L, named_metatable_index) == 1) { + stack::clear(L, absolute_index(L, -1)); + } stack::clear(named_metatable); } @@ -20911,7 +20918,7 @@ namespace sol { namespace u_detail { type_table = lua_nil; gc_names_table = lua_nil; named_metatable = lua_nil; - + storage.clear(); string_keys.clear(); auxiliary_keys.clear(); @@ -20981,7 +20988,7 @@ namespace sol { namespace u_detail { int base_result; (void)keep_going; (void)base_result; - detail::swallow{ 1, (base_walk_index(L, self, keep_going, base_result), 1)... }; + (void)detail::swallow{ 1, (base_walk_index(L, self, keep_going, base_result), 1)... }; if constexpr (sizeof...(Bases) > 0) { if (!keep_going) { return base_result; @@ -21954,12 +21961,6 @@ namespace sol { return luaL_error(L, "sol: cannot modify the elements of an enumeration table"); } - template - using is_global = meta::all, meta::is_c_str...>; - - template - constexpr inline bool is_global_v = is_global::value; - } // namespace detail template @@ -21999,7 +22000,7 @@ namespace sol { template decltype(auto) traverse_get_single(int table_index, Keys&&... keys) const { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; if constexpr (meta::is_optional_v>) { int popcount = 0; detail::ref_clean c(base_t::lua_state(), popcount); @@ -22013,7 +22014,7 @@ namespace sol { template void tuple_set(std::index_sequence, Pairs&& pairs) { - constexpr bool global = detail::is_global(std::forward(pairs)))...>::value; + constexpr bool global = meta::all, meta::is_c_str(std::forward(pairs)))>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); lua_State* L = base_t::lua_state(); @@ -22204,7 +22205,7 @@ namespace sol { template decltype(auto) get(Keys&&... keys) const { static_assert(sizeof...(Keys) == sizeof...(Ret), "number of keys and number of return types do not match"); - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return tuple_get(table_index, std::forward(keys)...); @@ -22231,7 +22232,7 @@ namespace sol { template decltype(auto) traverse_get(Keys&&... keys) const { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return traverse_get_single(table_index, std::forward(keys)...); @@ -22239,7 +22240,7 @@ namespace sol { template basic_table_core& traverse_set(Keys&&... keys) { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); lua_State* L = base_t::lua_state(); @@ -22262,7 +22263,7 @@ namespace sol { template decltype(auto) raw_get(Keys&&... keys) const { static_assert(sizeof...(Keys) == sizeof...(Ret), "number of keys and number of return types do not match"); - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return tuple_get(table_index, std::forward(keys)...); @@ -22289,7 +22290,7 @@ namespace sol { template decltype(auto) traverse_raw_get(Keys&&... keys) const { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); int table_index = pp.index_of(*this); return traverse_get_single(table_index, std::forward(keys)...); @@ -22297,7 +22298,7 @@ namespace sol { template basic_table_core& traverse_raw_set(Keys&&... keys) { - constexpr static bool global = detail::is_global_v; + constexpr static bool global = meta::all, meta::is_c_str>...>::value; auto pp = stack::push_pop(*this); lua_State* L = base_t::lua_state(); auto pn = stack::pop_n(L, static_cast(sizeof...(Keys) - 2)); @@ -22589,9 +22590,9 @@ namespace sol { lua_State* L = this->lua_state(); + auto pp = stack::push_pop(*this); int top = lua_gettop(L); - auto pp = stack::push_pop(*this); stack_reference mt(L, -1); stack::get_field(L, meta_function::gc_names, mt.stack_index()); if (type_of(L, -1) != type::table) { @@ -22604,7 +22605,7 @@ namespace sol { } ustorage_base& base_storage = *static_cast(stack::get(L, -1)); std::array registry_traits; - for (int i = 0; i < registry_traits.size(); ++i) { + for (std::size_t i = 0; i < registry_traits.size(); ++i) { u_detail::submetatable_type smt = static_cast(i); stack::get_field(L, smt, gc_names_table.stack_index()); registry_traits[i] = stack::get(L, -1); @@ -22617,11 +22618,13 @@ namespace sol { // in the registry (luaL_newmetatable does // [name] = new table // in registry upon creation) - for (int i = 0; i < registry_traits.size(); ++i) { + for (std::size_t i = 0; i < registry_traits.size(); ++i) { u_detail::submetatable_type smt = static_cast(i); const string_view& gcmetakey = registry_traits[i]; if (smt == u_detail::submetatable_type::named) { - stack::set_field(L, gcmetakey, lua_nil); + // use .data() to make it treat it like a c string, + // which it is... + stack::set_field(L, gcmetakey.data(), lua_nil); } else { // do not change the values in the registry: they need to be present @@ -22667,7 +22670,7 @@ namespace sol { if constexpr (sizeof...(I) > 0) { if (maybe_uts) { u_detail::usertype_storage& uts = *maybe_uts; - detail::swallow{ 0, + (void)detail::swallow{ 0, (uts.set(this->lua_state(), std::get(std::forward(args)), std::get(std::forward(args))), 0)... }; } diff --git a/tests/runtime_tests/source/basic.cpp b/tests/runtime_tests/source/basic.cpp index 25383f2f..2a8b7104 100644 --- a/tests/runtime_tests/source/basic.cpp +++ b/tests/runtime_tests/source/basic.cpp @@ -674,7 +674,7 @@ TEST_CASE("object/is", "test whether or not the is abstraction works properly fo TEST_CASE("object/base_of_things", "make sure that object is the base of things and can be sliced / returned safely") { SECTION("reference") { sol::state lua; - lua.open_libraries(sol::lib::coroutine); + lua.open_libraries(sol::lib::base, sol::lib::coroutine); lua["ud"] = base1{}; @@ -699,7 +699,7 @@ TEST_CASE("object/base_of_things", "make sure that object is the base of things } SECTION("stack_reference") { sol::state lua; - lua.open_libraries(sol::lib::coroutine); + lua.open_libraries(sol::lib::base, sol::lib::coroutine); lua["ud"] = base1{}; diff --git a/tests/runtime_tests/source/functions.cpp b/tests/runtime_tests/source/functions.cpp index 9e24bbae..b49b01e6 100644 --- a/tests/runtime_tests/source/functions.cpp +++ b/tests/runtime_tests/source/functions.cpp @@ -435,7 +435,7 @@ TEST_CASE("functions/function_result and protected_function_result", "Function r } } -#if !defined(SOL2_CI) && ((!defined(_M_IX86) || defined(_M_IA64)) || (defined(_WIN64)) || (defined(__LLP64__) || defined(__LP64__)) ) +#if !defined(SOL2_CI) && !(SOL2_CI) && ((!defined(_M_IX86) || defined(_M_IA64)) || (defined(_WIN64)) || (defined(__LLP64__) || defined(__LP64__)) ) TEST_CASE("functions/safe protected_function_result handlers", "These tests will (hopefully) not destroy the stack since they are supposed to be mildly safe. Still, run with caution.") { sol::state lua; lua.open_libraries(sol::lib::base, sol::lib::debug); @@ -512,7 +512,15 @@ TEST_CASE("functions/unsafe protected_function_result handlers", present = (bool)opvalue; REQUIRE_FALSE(present); sol::error err = result; +#ifdef SOL_LUAJIT +#if !((!defined(SOL_EXCEPTIONS_SAFE_PROPAGATION) || !(SOL_EXCEPTIONS_SAFE_PROPAGATION))) + REQUIRE(err.what() == std::string("C++ exception")); +#else REQUIRE(err.what() == handlederrormessage_s); +#endif +#else + REQUIRE(err.what() == handlederrormessage_s); +#endif } } #endif // These tests will thrash the stack and allocations on weaker compilers