Commit Graph

239 Commits

Author SHA1 Message Date
ThePhD
27c352149d
Protect against empty requires 2021-01-24 22:53:35 -05:00
ThePhD
e1950b9a55
protected_function, not function 2021-01-24 12:38:37 -05:00
ThePhD
d363ccd759
Implement better insert-with-no-iterator support
- reorder constructor values to match class order
- Fix up compilation related to GCC
- Add new shim tests to confirm insertion works properly
- regenerate single
2021-01-22 01:32:42 -05:00
ThePhD
a9ff1d4187
Fix up string_view handling
- Fix mispelling for is_stackED_based_v
- Regenerate single
- Repair badly named test
- Remove unused variable names
2021-01-21 15:58:27 -05:00
ThePhD
c032cda56e
M O R E B R E A K I N G C H A N G E S
- constant_automagic_enrollments use compile-time flags to avoid crappy shenanigans with linker-unavailable methods
2021-01-21 03:26:42 -05:00
ThePhD
f7d8e1e822
Unqualify type names to transparent argments 2021-01-21 02:20:31 -05:00
ThePhD
6fde9c3f14
B R E A K I N G C H A N G E
- This is going to start the mark of v4
- pairs() implemented on tables for pairs-like iteration
- .error_handler variable is now hidden from view on protected function! Use set_error_handler/get_error_handler
- packaged_coroutine skeleton, but code is blacked out
- tests rearranged a little bit
- auxiliary keys lookup, search, and storage improved
- overhead of stored tables improved
- usertype registration and un-registration improved
2021-01-20 13:55:44 -05:00
ThePhD
68fd0c0166
Some fixups!
- Formatting on a test file
- Fix up of some errors in the usertype traits usage
2021-01-04 14:58:54 -05:00
ThePhD
955418fe13
First draft of sol_lua_check_access fixes
- Should address #1074 and #1010!
2021-01-04 05:52:30 -05:00
ThePhD
8f7d4dbb4c
Add more comprehensive unregistration tests
- Make sure multiple states don't interfere with each other's keys
- Make sure re-registration of the same type does not cause too many problems
- Make sure the variadics test is present
- Make sure the storage keys are cleared out properly
2020-12-30 09:36:23 -05:00
ThePhD
f7d99b05a5
Fold string literals better by moving them inside
- Partially addresses #1094
- Fix a warning for unreachable code (I still don't like this part of if constexpr)
- Update single
2020-12-29 21:59:28 -05:00
ThePhD
b9115623b2
Overhaul stack_field tableless handlers
- Ensure stack field_get/field_set has consistent metaprogramming for needing a pushed table, and at what offset
- Avoid duplicate logic in table_core for the same logic by deferring to detail helper
- Fixes #1095
2020-12-29 21:50:16 -05:00
atom0s
6a77d5cf42 Fix argument usage typo. 2020-12-19 02:26:27 -05:00
ThePhD
bf75afa250
Some changes for Shadowing Errors
- Not all were done, though; gave up at enumerations in an enum class being marked as shadowers.
- Which is just the dumbestt hing I've ever had to deal with. At least Clang is smarter!
2020-12-19 00:47:55 -05:00
ThePhD
4649a76507
New Workflows, More Optional Tests
- Add a test for picking deeply nested / constructible values out of an optional
- Fix up the readme to show where users can get support
2020-12-18 23:48:42 -05:00
ThePhD
220335d95c
Fix up inheritance with special metamethods
- Inheritance was causing __index and __new_index to be overriden on the named metatables
- This meant special constructors and other metamethods might not have been set properly
- Use lua_rawset to directly slam dunk the value into the table
2020-12-18 10:04:46 -05:00
ThePhD
d39330eab9
Overhaul function calls and usage
- add noexcept to some of the core function calls
- type usage for both trampolines and yields can now be fully tracked, at the expense of more template instantiations when using both
- exceptions should be less prone to explosion in C versions, but will break in C++ code (the trampolines need to be modified for usertype calls to avoid this problem, specifically)
2020-12-17 23:25:48 -05:00
ThePhD
561c90abf4
Fix a lot of errors
- Add a new feature for SOL_FUNCTION_CALL_VALUE_SEMANTICS. Fixes #1059
- Detect deprecated/removed bit32 library. Fixes #1086
- Format the entire repository. Close #1073
- SOL_LUAJIT was not being properly defined. Close #1082
- Fix alignment issue. #1071
2020-12-16 15:25:35 -05:00
dimitrisudell
5b7cf9ade9 Ignore -Wshadow and -Wconversion on Clang 2020-12-16 06:32:34 -05:00
dimitrisudell
71193eadbd Ignore unused variables 2020-12-16 06:32:34 -05:00
ThePhD
30019c4076
Freeze current progress 2020-12-06 00:41:32 -05:00
ThePhD
bd09f8e853
Remove UB with proper conditional 2020-12-06 00:41:32 -05:00
Vas Crabb
38473d39fe Add override qualifier to bad_optional_access::what() - fixes GCC -Wsuggest-override warning 2020-11-19 17:42:08 -05:00
ThePhD
ef33531df4
Fix most of the most pressing warnings
- Fixes #1000
- Fixes #1060
- Fixes #1062
- Fixes #1067
2020-11-19 16:42:02 -05:00
ThePhD
62804667ee
Fix various issues
- readonly(...) should no longer issue errors in bogus manners
- binding for member function pointers and normal pointers should behave better now
- coroutines should now properly transfer the state/identity of their error handlers
- Fix empty base class optimization type
- Improve bind traits metaprogramming
- Add new define to catch-all for exception propagation
- Improve natvis
- Move test defines to build system, as we should
- Add a new example for multiple thread/states in Coroutines
- Add proper direct to mangling in Clang for Windows
- Exceptions are still busted on some platforms (Clang being quite funky)
2020-11-19 15:12:56 -05:00
ThePhD
b8aa189e32
Revert to using 1 for lua_newuserdatauv
- This needs to be addressed in the future
- Prevents failures when "attaching" a free-standing table.
2020-11-02 05:53:57 -05:00
atom0s
63e396b996 Fix typos in configuration macros. 2020-11-02 05:33:44 -05:00
ThePhD
e108f8bbbf
Work around non-constexpr boost shenanigans....... 2020-10-24 04:53:21 -04:00
ThePhD
651b90ba24
Fix boost build and optimize for lua_newuserdatauv 2020-10-23 18:59:07 -04:00
ThePhD
e5e6466e09
Fix configuration macros
- Enable all necessary configuration macros to be deliberately shut off, appropriately
- Fix version macro headings
2020-10-15 01:18:12 -04:00
ThePhD
48e5fc9e44
Fix unorded_map derp 2020-10-03 17:34:34 -04:00
ThePhD
48eea7b573
New Unsafe Feature: Function Pointers!
- Not at all type safe: there should be some investigation into making it less unsafe to work with these things (albeit it looks like it would cost +1 pointer to serialize a string name for each callable in Lua, at LEAST)
- Must be opted into - see the documentation
- Fixes #1015
- A few drive-by fixes here and there
- New configuration test harness with CMake
2020-09-26 09:46:11 -04:00
ThePhD
000fa31809
Heavily improve usage of Preprocessor checks
- Weed out bugs in the numeric checking implementation
- Solve the problem with load_result/protected_function_result/unsafe_function_result being copyable and thus amenable to explosions. Fixes #995.
- Resolve the warning in sol::readonly. Fixes #1000.
- Looke into #1014. Not sure I can help there, honestly; looks like a mix up of multiply-loaded libraries and mixing the two.
2020-09-26 06:47:32 -04:00
Intrets
0e1aafe4df fix bug in checking for const in push_reference
std::is_const<T> will always be false if std::is_lvalue_reference<T> is true, we first have to strip off the reference to look at the const-ness. See https://en.cppreference.com/w/cpp/types/is_const
2020-09-26 03:45:20 -04:00
ThePhD
e89b6ac2e7
Actually use the correct value instead of pushing without saving the file
- I promise
- I am smarter than I commit
2020-09-08 20:47:39 -04:00
ThePhD
e4f588d18c
Turns out I'm not very smart - who knew?! 2020-09-08 20:17:12 -04:00
ThePhD
275ae2c096
Fix ambiguous overload for array vs. pointer
- Arrays vs. pointers continue to be the bane of my existence in working with """text""" in C++.
- Fixes #1001 and the issue that was ongoing in Mugen.
2020-09-05 17:46:20 -04:00
ThePhD
63df43e061
Get rid of MSVC problems and improve state API.
- Just let MSVC have crap codegen. The compiler sucks anyways. Fixes
- Add incremental GC power. Fixes #997.
- Add non-null offset manipulation. Did I mention I hate VC++ and how it implemented _Aligned? Fixes #1017.
2020-09-05 17:25:15 -04:00
ThePhD
de87bec171
Even better Regression Testing™ 2020-08-13 10:42:37 -04:00
ThePhD
af779f0bed
Improve the testing macros to work across platforms.
Add a note to the documentation about SOL_NO_LUA_HPP being less preferred over the C++ defines, to Fix #1013.
Add regression tests (not yet fixed) so I can get to the bottom of VC++ being ass.
2020-08-12 19:07:32 -04:00
ThePhD
5bbc095396
Improve configuration macros and other things while trying to track down ways to make MSVC stop being a butt on its latest iterations. 2020-08-09 17:17:47 -04:00
Ubpa
ca1e85d06d no_constructor 2020-08-04 10:52:56 -04:00
Ubpa
855d480049 variable name is_const -> ret_is_const
`is_const` will get some strange messages in VS 2019
maybe it is conflicted with `std::is_const`
2020-08-04 10:52:56 -04:00
ThePhD
7be51ebbef
Add tons of redundant includes in the single, since they may be conditionally compiled out, and add a note to see if this can be looked into more closely later... 2020-07-16 19:46:15 -04:00
ThePhD
4a16979adf
Use a specified configuration macro for the size of a given chunk.
This might help with error reporting for larger non-text based chunks. Maybe helps #989, but that looks like it needs the user to define their own traceback handler.
Fix compilation issues with boost optional usage. Fixes #990
Fix more shitty docs (thanks, @nabijaczleweli)
2020-07-15 09:29:27 -04:00
ThePhD
7d8532b5f8
Merge branch 'develop' of github.com:ThePhD/sol2 into develop
# Conflicts:
#	single/include/sol/forward.hpp
#	single/include/sol/sol.hpp
2020-07-04 04:01:11 -04:00
ThePhD
862c01019a
Use invoke_result_t to get rid of deprecated result_of_t (Fixes #986).
Make thread local keyword optional by using a config macro SOL_NO_THREAD_LOCAL (off by default) (Fixes #979).
Cannot do anything for #985; that's an architecture issue.
2020-07-04 03:58:24 -04:00
Brent Davis
428767b8cd Reduce binary bloat from static_trampoline and check_metatable 2020-07-03 12:04:02 -04:00
Brent Davis
a21fef97e9 Fix formatting in previous commit 2020-07-03 12:04:02 -04:00
Brent Davis
37c61eb16b Move code that doesn't need to be in a template, out of the template, to reduce duplicated binary code 2020-07-03 12:04:02 -04:00
ThePhD
e09d2ffef8
Fix up protected function returns and fix/use the horrible size extension point derp. Fixes #973 2020-05-26 20:08:38 -04:00
ThePhD
465b472b2c
Fix #968, #969 (nice). 2020-05-22 09:38:53 -04:00
ThePhD
d9c034d672
Protections for MoonJit, explicitly. 2020-05-17 23:21:32 -04:00
ThePhD
c5f6680bf4
Add an additional configuration parameter to make it so automagic usertypes can be turned off, and document it.
Thanks @EliasDaler
2020-05-17 18:17:14 -04:00
ThePhD
5022c4d8f6
Improve container handling and the vec[#vec] = nil idiom from Lua 2020-05-06 22:17:02 -04:00
espkk
670ea9b405 Allow open_libraries() to accept any value category. 2020-04-08 20:01:29 -04:00
ThePhD
053a7fdcb1
Fix #949, #935, #948, #945, and #933.
We will need a new feature to fix #941, which is related to #872.
2020-03-31 00:24:23 -04:00
ThePhD
82812c56d9
__mt is the wrong name. 2020-03-09 21:33:41 -04:00
ThePhD
bc96c1d7b2
Fix some more derps in the code. Also, std::iterator is a zombie! 2020-02-16 16:52:39 +01:00
ThePhD
11d6e8c8d4
Where did the checkers for sol::nested go...? Maybe a casualty of refactoring? 2020-01-28 13:44:35 -05:00
ThePhD
903f4db02b
Fix up the tutorial. 2020-01-27 14:13:22 -05:00
ThePhD
0c38fd1a57
Lua stream example! 2020-01-25 13:09:16 -05:00
ThePhD
2beb13b9b2
Found the problem. 2020-01-25 00:13:08 -05:00
ThePhD
ba9507107b
Index adjustments from derping around. 2020-01-24 20:16:37 -05:00
ThePhD
5301bc1d4c
New base object customization point management example, derived directly form @NullCascade. Thanks! 2020-01-24 19:58:12 -05:00
ThePhD
c77b5b432e
Update catch, move yielding check up one level to avoid problems with trampoline and exception handling, and add a new test/example from an issue. Closes #906. Closes #917. 2020-01-17 05:22:52 -05:00
ThePhD
b9acaddd78
Stack aligned function should be safe, if possible. 2020-01-08 06:40:33 -05:00
ThePhD
43f215c27d
Fix #913 2019-12-25 13:24:21 -05:00
ThePhD
36972a994b
mmm double trampolining is not good
add new ways to shoot myself in the foot with CMake
2019-12-23 09:09:23 -05:00
ThePhD
1f27149239
Fix usage of the traits, rename them to say more directly what they are. 2019-12-02 15:54:58 -05:00
ThePhD
38d979209d
Rework variant checks and other things to prevent hard failures. 2019-12-01 19:27:49 -05:00
ThePhD
b0c74207d8
Force constness on ostream operator.
Automatically disable magic for variant types.
2019-12-01 17:40:16 -05:00
ThePhD
83a656ae61
Break all the behaviors. _All_ of them. 2019-11-29 13:08:41 -05:00
ThePhD
21c030933f
Clean up exceptions checking. Fixes #901 2019-11-24 18:06:52 -05:00
ThePhD
bc1106cdea
Tackle bug in indexing on Lua Version < 5.3
Figure out LuaJIT bug for allocations on x64 on Version < 2.1.x
2019-11-13 05:18:02 +01:00
ThePhD
2ca27eede3
Please read the docs. Pretty please. 2019-11-12 18:53:17 +01:00
ThePhD
ce32549bc6
Remove as many of the std::string error handlers as possible to avoid memory leaks in C mode
Add some checks for container usertypes that masquerade as convertible from tables
Make sure shared_ptr-like types that are copyable are returned directly (but do not do this for move-only types)
2019-11-09 04:53:48 +00:00
ThePhD
88355fcdf8
fix derp for checked calls 2019-10-02 04:43:44 -04:00
ThePhD
908074e696
wew lad 2019-10-02 02:38:12 -04:00
int3
97279aa68e Fix: constructing basic_reference<true> from basic_reference<false> 2019-10-01 02:17:04 -04:00
David P. Sicilia
b545e1bf1b Enable C++17 features when __cplusplus >= 201703.
This will keep them enabled even when compiling with later
standards or experimental standards such as -std=c++2a.
2019-09-15 00:49:53 -04:00
ThePhD
bafac3abbd
Change how proxies are done for the sake of efficiency. 2019-09-15 00:43:44 -04:00
ThePhD
b2c22ea8fe
Fix #864 2019-09-08 19:54:17 -04:00
ThePhD
9294afc082
memory tracker and separate-definition ADL customization points, inspired by Olek and Aurailus 2019-09-01 02:27:58 -04:00
ThePhD
e8649d276b
NOW it's REALLY fixed, super duperly. 2019-08-28 00:17:11 -04:00
ThePhD
12eb1168e2
Burning hatred for unconstrained functions. 2019-08-27 20:04:55 -04:00
ThePhD
a2e01ada2f
More dumb patches for more all-consuming template functions. 2019-08-27 19:59:07 -04:00
ThePhD
683d1393d7
std function can be empty
fixes #862
2019-08-27 18:36:45 -04:00
ThePhD
e03f53d4dc
more minor fixes for bad trait usage, wee 2019-08-15 08:14:06 -04:00
ThePhD
12f8f046cc
fix up container handling 2019-08-15 02:28:37 -04:00
ThePhD
cb3acaa97b
add more documentation, add clear() to bytecode, include additional examples and better data 2019-08-15 01:26:52 -04:00
ThePhD
09f5e862b8
Lua 5.4 changes... oh boy! 2019-08-12 14:07:25 -04:00
ThePhD
5799084572
Fix #838 by defining the operators to prevent VS warning 2019-07-25 22:14:24 -04:00
ThePhD
7584e3b9fd
derped in some undef'd code 2019-07-04 22:53:36 -04:00
ThePhD
fd4ba95602
repetition is bad 2019-07-04 16:34:32 -04:00
ThePhD
60332562fd
better numerics errors ? 2019-07-04 09:42:12 -04:00
ThePhD
eb6f425245
fix some derps in overload resolution in cases where it is ambiguous with .call<void>(). Also improve variant handling, going from 0 to variant_siz 2019-07-01 23:30:54 -04:00
ThePhD
52dc19a75a
wew containers and perfect matching ye 2019-07-01 05:44:53 -04:00
ThePhD
1ab57fc11e
fix up variadic_results and change pointer_like traits to not fall prey to implict conversions as easily 2019-07-01 02:13:34 -04:00
ThePhD
b08387d947
sol variadic results to make it easier to convert function results. 2019-06-29 09:51:47 -04:00