Commit graph

2361 commits

Author SHA1 Message Date
ThePhD
c1f95a773c
🛠️ miscellaneous fixes 2025-03-07 22:01:35 +01:00
ThePhD
309f8dd45b
🛠️ LuaJIT modifications 2025-03-07 22:00:22 +01:00
Marcus Tillmanns
620c9ae5ac Fix type 2025-02-25 19:54:42 +01:00
Marcus Tillmanns
fdd681477f Use main_object in dynamic_object example 2025-02-25 19:54:42 +01:00
ThePhD
9190880c59
3.5.0 Release -- Fix a bunch of exception work and error reporting
- 🛠️ Supports lua/* prefix for header inclusion of the lua library
- 🛠️ Use luaL_error to try and retain traceback information, even when compiled as C++ (don't catchall)
- 🛠️ Revise trampoline usage by changing automatic macro detection to be more precise (e.g. Building as C++ doesn't automatically enable catchalls
- 🛠️ Use safety argument checking for the object argument, to get better error messages in certain places
- 🛠️ Pull errors more appropriately (e.g. check directly for the sol::error / sol::detail::error_exception type to make sure it gets propagated properly
2025-02-25 19:45:12 +01:00
soasis
336f76c377
🔥 Remove debug header 2025-02-07 17:29:01 +01:00
Shepherd
034700e5f5
💚👷‍♀️ Minor modifications to LuaJIT retrieval 2025-02-07 17:29:00 +01:00
Robert Hodgson
2b0d2fe8ba Normalized the use of parenthesis when comparing a PreProcessor macro with 0 2024-07-13 10:53:41 -04:00
Robert Hodgson
469f14ee27 Corrected the pre-processor syntax by removing the defined keyword when there is an expression associated with the #if condition 2024-07-13 10:53:41 -04:00
deadlocklogic
ab83eac703 call.hpp: std::is_base_of_v<Union, Union> is false, use is_same_v 2024-07-13 10:53:17 -04:00
C3pa
980bc91589 Fix a typo in functions docs 2024-07-13 10:52:58 -04:00
C3pa
b815714052 Fix a typo in the inheritance example #1514 2024-07-13 10:52:50 -04:00
Marcus Tillmanns
22f9cbff33 Fix safety.rst typo
The documentation states SOL_SAFE_FUNCTION, but in code its called SOL_SAFE_FUNCTION(S)
2024-07-13 10:52:39 -04:00
Gaël Écorchard
8525c20831 Fix some issues with the build system
There is still an issue: `aguya.cpp:51:16: error: ‘kaguya’ has not been declared`.

Signed-off-by: Gaël Écorchard <gael@km-robotics.cz>
2024-07-13 10:52:26 -04:00
Rob Fischer
c4e7247b01 Fixed a typo in version.hpp 2024-07-13 10:52:06 -04:00
“Paulo
d805d027e0 fix emplace 2024-07-13 10:51:50 -04:00
loveridge
e8e122e9ce Print aux_message if there is not message 2024-01-14 11:57:52 -05:00
ThePhD
9c882a28fd
🙈 Ignore MacOS files 2023-08-06 17:47:47 -04:00
ThePhD
ff3f254f7b
🛠 Disable semantic difference between this and LuaJIT
💬 "This removes some performance savings, but it's the best we can do for now."
2023-07-20 00:53:31 -04:00
ThePhD
839f2a1dce
🛠 Fix up example to use cpp_object properly as the name, and other checks.
— Addresses #1454
— Remove zero-based check for certain versioning macros for Lua (need others?)
2023-07-18 13:45:11 -04:00
Tatjam
ba7aff015d Add note for LuaJIT 5.2 style containers
If you use the LUAJIT_ENABLE_LUA52COMPAT compilation flag with LuaJIT, C++ container can be used just fine with `ipairs` or `pairs` as these properly check the metatable keys `__ipairs` and `__pairs` used by sol to implement this behaviour.
2023-07-18 13:23:08 -04:00
ShepherdSoasis
64e3823bd2 🛠 Address lifetime issues through Lua references in iterators.
📝 Fixes #1315, #1374, and #1400.
— 📝 Lifetime in iterators was referencing the wrong stack (the main thread) rather than the coroutine's stack at time of creation.
— 📝 Using main_reference/main_* objects was a suitable enough fix for most of these problems.
— 🛠 Prevent performance and usability issues from changing containers by storing the being/end iterator separately, rather than continually invoking `deferred_uc::end(…)` every time.
— 🛠 Improve sizes for stored iterators in select cases.
— 🛠 Allow for sentinel-style C++20-and-beyond ranges.
— 🔧 Improve single file generation CMake.
— 👷‍♀️ Fix up internal Lua build system issues.
2023-07-18 13:12:11 -04:00
C3pa
97806f2a7c Fix get_max_hp mehod in property example 2023-07-18 13:09:58 -04:00
Elias Daler
eab1430ccd Add mention of sol2::sol2 alias in build.rst 2023-02-16 09:34:52 -05:00
spawayz
19898d8d3e Fixed possible typo. 2023-01-07 00:00:01 -05:00
ShepherdSoasis
973e1c3cd6 🛠 Review exhaustive check and get rid of a few Wall/pedwarn warnings 2023-01-06 23:59:33 -05:00
ShepherdSoasis
f81643aa0c 🛠 Fix exhaustive checking compilation 2022-11-09 18:33:16 -05:00
ShepherdSoasis
3592851a2a New exhaustive check feature for vectors & similar 2022-11-09 18:33:16 -05:00
Fini Jastrow
c4e843b6dd Fix clang compiler warning
[why]
Compiling with clang issues this warning (clang 10.0 and 15.0 tested):

    .../sol/sol.hpp:14541:32: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-warning-option]
    #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

[how]
Check if the compiler does know the warning, before trying to turn the
warning off.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-11-09 18:31:09 -05:00
Alexey Sokolov
0386513a2d Export to other projects cmake as sol2::sol2
Fix #1304
2022-09-27 13:41:01 -04:00
Alexey Sokolov
e5348c29f1 Install cmake files to share/
Because this is header-only library, there is no .a/.so which is
arch-dependent.
2022-09-27 13:41:01 -04:00
ThePhD
8173d26557
🧪 Restore tests 2022-09-27 13:39:28 -04:00
ThePhD
81501d2762
Merge branch 'gotschmarcel-ni-feature/utilities' into develop 2022-09-27 13:36:21 -04:00
Marcel Gotsch
92cbc71c10 add to_string and is_integer utilities 2022-08-26 15:21:02 +02:00
Mihail
4de99c5b41 Fixed typo: "almomst" with "almost" 2022-07-13 01:16:02 -04:00
Zach Toogood
dca62a0f02 Add static_cast to unique_index arg to silence MSVC warning 2022-06-25 13:27:29 -04:00
ThePhD
eba86625b7
✍ Update Copyright Year for docs 2022-06-25 04:06:18 -04:00
ThePhD
ce40e894d0
✍ Update Copyright Year 2022-06-25 04:00:53 -04:00
ThePhD
17e1c951dc
🛠 Fix #1328 2022-06-25 03:47:22 -04:00
ThePhD
55828d1ee0
Fix #1266 2022-06-25 03:43:17 -04:00
Eric Zhang
c9055478c7 fix #1354 2022-06-24 12:57:34 -04:00
Matus Fedorko
13b7e8a7ca Fix compile error when registering new user types with operator() 2022-06-24 12:56:14 -04:00
Daniel Volk
de0e9de816 CMake: Build LuaJIT: use copy_if_different
Use copy_if_different to move luajit products in the post build step to
avoid relinking of projects depending on sol2/luagit.
This is mostly relevant when building sol2 and luajit as subprojects.
2022-06-24 12:55:33 -04:00
Shepherd
3b97af0ac4 🛠 Clean up old VC++ code
🔎 Silence uninitialized warning for later inspection
2022-06-24 12:51:09 -04:00
Shepherd
323c3ca210 🛠 Prevent non-zero default initialization for result types 2022-06-24 12:51:09 -04:00
Shepherd
0a801ee656 🛠 Guard against environment over-pushing 2022-06-24 12:51:09 -04:00
Shepherd
612b469ad9 🛠 Retrieve main thread to prevent collapses on Luas
— Lua 5.1, 5.2, and 5.3 seemed to have a deficiency in which the stack thread space variable (given as a lua_State*) would die before everything referencing it would be properly dead. This made holding a reference for keep-alive purposes impossible to maintain. Therefore, we retrieve the main thread to keep it alive.
2022-06-24 12:51:09 -04:00
Shepherd
268b58964c 🛠 Avoid shadowing warning 2022-06-24 12:51:09 -04:00
Shepherd
7859f53e81 🛠 Fix many missing <memory> includes 2022-06-24 12:51:09 -04:00
Shepherd
4efea0ff3c Test and fix #1315
— 🛠 Update SOL_IS_(DEFAULT_)ON/OFF usage to be more idiomatic and less confusing (add SOL_RAW_* alternatives as well)
— 💚 Re-check CI
— 👷‍♀️ Add missing header from ebco.hpp
2022-06-24 12:51:09 -04:00