Commit Graph

835 Commits

Author SHA1 Message Date
ThePhD
ed6ae23d2e Accidentally put a critical check inside of a SOL_SAFE_USERTYPE define... Buh. 2017-03-16 10:12:17 -04:00
ThePhD
31b4dd820c silence some crap warnings and fix the inversion of the branches in the usertype metatable because I'm a dumb 2017-03-16 03:36:15 -04:00
ThePhD
21f59a997a The new constructor syntax was very easy to implement... 2017-03-16 03:07:20 -04:00
ThePhD
82482bfe3e one fix at a time... 2017-03-13 18:08:32 -04:00
ThePhD
b46901903d missed one 2017-03-13 18:03:01 -04:00
ThePhD
72fe0a5a31 remove std::move from items 2017-03-13 17:45:54 -04:00
ThePhD
30ecd7127a Tracking LuaJIT deletion bug, but it seems to be connected to the Hash Map iterator level...? Something is wrong, here... 2017-03-13 15:05:02 -04:00
ThePhD
84554c90ea VC++'s late instantiation killing me on things being used technically before they're defined, but being inside templates makes it bad... 2017-03-12 21:42:43 -04:00
ThePhD
dce8053248 Time to break everything.
Added the ability to extend all usertypes at runtime. The performance implications need to be examined closely.
variadic_args documentation was updated with the desired example demonstrating proper usage
usertype examples were updated demonstrating Lua runtime and C++ runtime updating of a usertype table
SOL_SAFE_FUNCTIONS is now part of the definitions and defined (thanks @eliasdaler)
2017-03-12 21:35:19 -04:00
ThePhD
ab9126d892 update customization points and track un-specialized structs to trigger some safe-guards as a back-compatible safety net 2017-02-20 18:07:02 -05:00
ThePhD
b7b63668c8 Ensure construction of special types in simple_usertype is working, and for regular usertype as well. 2017-02-20 03:44:41 -05:00
ThePhD
dde4aa64fc simple_usertype now responds with nil on bad lookups and sets items into place properly when new_index'd 2017-02-19 05:00:11 -05:00
ThePhD
a9cfe4b980 Fix ability to use call constructors for simple usertypes in a more systematic and thorough fashion (still some missing holes, but unlikely to ever encounter)
Add tests to make sure it never happens again
2017-02-18 21:59:31 -05:00
ThePhD
23e3f2c26d make sure member functions for simple usertypes propogate their desired type. 2017-02-17 05:46:39 -05:00
ThePhD
37420dcdc0 Documentation update about functions and new typedefs. 2017-02-16 02:05:49 -05:00
ThePhD
85194e0135 Fix leak issues and some ordering in state(view) move operations. Closes #336. 2017-02-15 05:42:44 -05:00
ThePhD
fe8b1c1c10 Bug in not properly keeping the observed valid table on the stack. 2017-02-01 06:54:30 -05:00
ThePhD
8d6f304bad Update the name table and make sure there are pairs and next metamethod entries. 2017-02-01 06:29:45 -05:00
ThePhD
c7deb82535 Improve performance by making wstring_convert objects static. Closes #326
Temporary warnings against alignment padding nonsense. Closes #325
Still need to test #324 and find out what's wrong with #327
2017-01-30 21:40:58 -05:00
RaptorFactor
c58d27e58d Work around clang-cl compilation issue. 2017-01-26 03:32:17 -08:00
Kim Byungsun
30feacb04e Fixed typo: luaxlib.h -> lauxlib.h 2017-01-14 07:44:23 -05:00
ThePhD
66ad189797 add functionality to have functions properly detected and the amount shifted over properly based on being a call constructor or not 2017-01-09 23:25:28 -05:00
ThePhD
490194f767 allow va_args to work with overloading, albeit things can get... bad, with it. Need to observe this more to make sure things don't go poorly. 2017-01-09 16:38:23 -05:00
ThePhD
658a11a2be forgot return type: update single 2017-01-07 01:11:03 -05:00
ThePhD
3baa99f941 thread and state awareness in all sol lua types 2017-01-07 00:40:44 -05:00
ThePhD
010b6bb101 allow for switch to change Lua configuration and build with assumptions to C++ handling 2017-01-02 09:36:04 -05:00
The Phantom Derpstorm
a2691c6570 Merge pull request #304 from davedissian/develop
Correct the LuaJIT 2.1.0 condition
2016-12-26 14:01:08 -05:00
ThePhD
26b85c8136 Make sure resolve works and provide some protection against deleting the handler that originates from a specific sol::state. sol::state_view users will be left out in the dark, though. 2016-12-26 13:50:08 -05:00
David Avedissian
9382ceb1b5 Correct the LuaJIT 2.1.0 condition 2016-12-25 13:21:13 +00:00
ThePhD
3aa42c5db8 update single 2016-12-16 05:31:32 -05:00
FYP
b1af00f048 fix thread_status::dead value for luajit 2016-12-16 12:20:28 +03:00
ThePhD
428adf706f optional impl alignment requirements?? Thanks, Emscripten. 2016-12-16 01:00:49 -05:00
ThePhD
e1329d244a Fix alignment issues with optional implementation
Update single.py to look at toplevel file rather than listing out all base sources
string_shim didn't have the proper header
Improve gitignore
2016-12-16 00:31:45 -05:00
ThePhD
ad010adcad Goddamn unused parameters... 2016-12-10 05:56:10 -05:00
ThePhD
f4f3bffe2f Oh boy, more simplicity functions...! 2016-12-10 01:19:23 -05:00
ThePhD
edeb81a7e1 Add registry constructors to tug things right out of the registry, and add a main_thread getter to aid in Joynet dev 2016-12-10 00:25:25 -05:00
ThePhD
16152c7faf Make various arguments push based on the Lua state passed, not on the Lua state they have (avoids a small class of errors and makes the panic function call tiself more regularly). 2016-12-06 10:51:14 -05:00
ThePhD
7628c635bd Memory leak fix! 2016-12-05 12:03:15 -05:00
ThePhD
d0a36c9657 objc define to keep code clean on that platform 2016-12-03 07:33:18 -05:00
ThePhD
20b951d551 we choose nil serialization for bad stack pushes 2016-12-02 05:47:24 -05:00
ThePhD
0d43a6f22b fix const-correctness error in detection of is_container type 2016-11-29 12:51:21 -05:00
ThePhD
433e34cd9b as_args and threading API cleanliness. 2016-11-26 13:58:06 -05:00
ThePhD
7b63057ba8 PRAISE BASED EEVEE 2016-11-26 03:32:28 -05:00
ThePhD
289ded358c -Wshadow and -Wconversion are kind've dumb 2016-11-25 20:47:15 -05:00
ThePhD
49a0f71272 library fixes 2016-11-23 02:55:25 -05:00
ThePhD
b40f895fd4 Fix double-delete crash that could also be affecting @IronsDu 2016-11-23 02:39:52 -05:00
ThePhD
97cafbaadd Default error handler function for protected_function 2016-11-17 23:58:24 -05:00
ThePhD
57c933cc9b bitfield example and link in docs 2016-11-15 22:45:34 -05:00
ThePhD
fe162b9643 make sure protect works as advertised 2016-11-15 04:39:42 -05:00
ThePhD
b2d137f65f change resolve to behave better with crappy clang 2016-11-14 21:39:26 -05:00
ThePhD
f5930bfa48 constexpr resolve 2016-11-14 13:58:55 -05:00
ThePhD
1461ab780c Fix an idiot derp in the code
and stop having sleep attacks...
2016-11-14 13:42:55 -05:00
ThePhD
22e17eb9fd Correct spelling is hard. 2016-11-13 04:21:24 -05:00
ThePhD
fbc0fc5f93 Properly word the exception documentation and made some proper links.
Update single and use proper wording.
2016-11-13 03:48:22 -05:00
Anand Aiyer
6e6cb675e2 SOL_LUAJIT_FULL_INTEROPERABILITY - If you are using a platform and
compiler that has full c++ exception interoperability
(http://luajit.org/extensions.html#exceptions), define
SOL_LUAJIT_FULL_INTEROPERABILITY. This will prevent sol from catching
(...) errors - in platforms & compilers than have full c++ exception
interoperability Lua errors can be caught with catch (...) in C++ - in
these cases sol inaccurately prevents Lua errors from being propagated
correctly.
2016-11-13 12:02:29 +05:30
Anand Aiyer
951b821272 missing ';' when SOL_NO_EXCEPTIONS is enabled 2016-11-13 11:22:54 +05:30
ThePhD
02bbe0c528 improve docs heavily 2016-11-11 12:44:34 -05:00
ThePhD
4116db8c89 Add heavy support for all things array and list and stuff 2016-11-09 07:42:45 -05:00
ThePhD
3b4dd52caf Fix is_container derp that triggered fault construction of pointer types 2016-11-07 13:52:20 -05:00
ThePhD
f8705202e2 Update single and update safe usertype checking 2016-11-06 16:34:05 -05:00
ThePhD
1c73fb054b std::cend doesn't exist in older compiler versions... 2016-11-05 23:25:46 -04:00
ThePhD
3e77a77ddc fix container usertype metatables 2016-11-05 23:04:32 -04:00
ThePhD
52f69a2653 Heavily improve documentation and add new container functions. 2016-11-05 20:08:07 -04:00
ThePhD
d863a56760 Weee, script return value tests 2016-11-02 19:00:16 -04:00
ThePhD
9836aba51d octal constants suck =/ 2016-11-01 19:24:59 -04:00
ThePhD
0a165dc5b4 Sometimes? You just don't like C++. At all. 2016-11-01 06:03:54 -04:00
ThePhD
c2c9ccf89c constexpr? More like LULexpr. 2016-11-01 05:57:48 -04:00
ThePhD
d3cb9042c3 Heey, no more submodules needed now. 2016-11-01 05:39:44 -04:00
ThePhD
1213c8959a Ditch the dependency on the optional submodule, nobody's ever gonna care about it... 2016-11-01 05:31:59 -04:00
ThePhD
c9728b7e27 do_string / do_file synonyms. I have to document all this... 2016-10-30 05:56:56 -04:00
ThePhD
0859af3203 Fix comparisons done of improper types 2016-10-30 04:40:17 -04:00
ThePhD
f896a9ea16 Pop errors off the stack if they're present. 2016-10-29 15:12:47 -04:00
ThePhD
5193db55c3 allow for not-containers to be specified
Make sure tables of various sizes are kept working
2016-10-28 04:36:04 -04:00
ThePhD
85329ca183 Mmn. Always making lots and lots of small changes. 2016-10-23 19:17:33 -04:00
ThePhD
2ac711b7f8 fix static initializer bugs from crap -- and remember to hunt down and get rid of all non-constexpr things like it in the future... 2016-10-21 17:32:27 -04:00
ThePhD
a65f795b79 ipairs and pairs improved support, folding the registration table down to avoid duplicated code 2016-10-21 07:05:58 -04:00
ThePhD
661e361b26 inline pls 2016-10-15 18:53:42 -04:00
ThePhD
391f29afb1 Oh boy, new compatibility files...! 2016-10-15 18:36:30 -04:00
ThePhD
940f44db55 Add presentation from Lua Workshop 2016
Have proper detection for numbers (even if it comes at a higher cost)
2016-10-15 18:14:19 -04:00
ThePhD
c2d219ea7d Reworked the architecture of usertype functions to include a shim table between it and the actual metatables.
This means that usertype tables visible in the code and bound to the name specified with `new_usertype` and friends will be normal tables, and those tables delegate their responsibilities to the 3 backend tables of `sol.unique_usertype<T>`, `sol.T`, and `sol.T*`. This separation allows for a few caveats for updating and overriding members of `new_simple_usertype` tables to 'just work' without any serious hassle, and to have a single point that lets up decide how to perform updates properly. It also restores an optimization we had to turn off by ham-fisting whether ot not indexing was turned on the usertype metatables themselves.

o wow wow wow it's such a nice commit message look at how organized it is
PFFFFFFFFFF.
2016-10-11 05:58:49 -04:00
ThePhD
e0e376a370 -1 size key is bad: remember to add this to presentation... 2016-10-05 20:55:40 -04:00
ThePhD
0ba4650c64 Another example, constness derp fix 2016-10-05 20:39:49 -04:00
ThePhD
009d6b0fa9 Fix protected_function shenanigans, hopefully for good. 2016-10-04 23:37:08 -04:00
ThePhD
4ac35aa8f4 sometimes, I have a dumb. Othertimes, the lua docs are sneaky and have subtle maybe-behaviors when other parts of their API never do. Sneaky, sneaky API... 2016-10-02 13:37:52 -04:00
ThePhD
23c2c6dedc weee slight fix and doc update 2016-10-01 18:19:35 -04:00
ThePhD
b05ce97247 Allllll the fixes. All the time. Mostly to make sure constructors don't fight with each other and safety is respected. And documentation updates. 2016-10-01 01:27:40 -04:00
ThePhD
6c34a2ac4f updated protected_function stuff 2016-09-30 01:42:23 -04:00
ThePhD
72a445ff6a Some minor fixes and updates 2016-09-29 03:29:48 -04:00
ThePhD
cbe599a901 Referential transparency is important. 2016-09-28 19:05:26 -04:00
ThePhD
d7b037da73 Sigh. Make sure that tuple expansion works in buggy VC++ compiler. 2016-09-26 04:02:03 -04:00
ThePhD
d88db0faff Buh. Capturing the right semantics is always hard. 2016-09-22 11:49:29 -04:00
ThePhD
3a00ce0adf Some minor fixes and DOCS AND EXAMPLES WOOoOooOOooOoo 2016-09-22 07:13:04 -04:00
ThePhD
9d52ed49ba balance that stack, goddamnit, BALANCE IT 2016-09-19 23:37:00 -04:00
ThePhD
8c9c662d97 Truly, I am a spectacular idiot... 2016-09-19 01:17:58 -04:00
ThePhD
89107d3b90 Fix crashing of simple usertypes from a previous herpderp. 2016-09-19 00:36:50 -04:00
ThePhD
1593ca00af eat a dick gcc 4.9 2016-09-17 22:39:21 -04:00
ThePhD
1dfeb1dc7c i hate old tools 2016-09-17 22:27:28 -04:00
ThePhD
330df79ab9 OoOoOooh and the world exploooodes.
Added new examples to illustrate a few things people were wondering about
HEAVILY fixed up usertypes and inheritance. Again. Sigh. One day it'll all be correct.
2016-09-17 22:15:46 -04:00
ThePhD
8028628868 Merge remote-tracking branch 'origin/develop' into develop 2016-09-17 12:03:43 -04:00
ThePhD
52836c12a3 o boi simple usertype shenaaaanigans!~ 2016-09-17 12:03:20 -04:00
OrfeasZ
95ddf46b55 Introduced a new simple_usertype class which derives from usertype.
Exposed an "add" function for it in order to allow adding members one at a time before registration.
Introduced state_view.create_simple_usertype<T>() methods for creating simple_usertypes.
2016-09-17 18:22:19 +03:00
ThePhD
3df64718ad update everything 2016-09-14 00:10:25 -04:00
ThePhD
0e56783de9 Bark. I always forget things. 2016-09-14 00:02:15 -04:00
ThePhD
34d844a06f gdi gcc, catch that shit -- update single 2016-09-13 12:53:59 -04:00
ThePhD
0de30f3b3a Upgrading simple_usertype implementation with BREAKING changes. Docs now include that information too. as_function now works with usertypes for limited cases. 2016-09-13 12:37:08 -04:00
ThePhD
5dface25fb fix problem with instantiations of abstract classes in optional reference 2016-09-10 20:59:12 -04:00
ThePhD
cb0116a3df Add guard for luaL_loadbufferx 2016-09-04 11:41:24 -04:00
ThePhD
d451271bf4 protected function updates 2016-09-04 10:54:55 -04:00
ThePhD
c6540caf67 herped the derp: gotta leave these things alone... 2016-09-01 12:36:25 -04:00
ThePhD
431977a568 herpin' that derp 2016-09-01 09:02:50 -04:00
ThePhD
6a3b0adf0d error detection for coroutine and protected function 2016-09-01 08:49:30 -04:00
xujh
6791d6ebf2 change std::snprintf to snprintf for android compile 2016-09-01 12:02:41 +08:00
ThePhD
5093f61615 Attempt to fix #119 by using less-powerful C++11 features and praying for the best
Fix #205
Partially address #204 (will need to do more -- perhaps add an automatic-conversion shim?)
2016-08-30 18:09:42 -04:00
ThePhD
5b5d1e9ca6 MIGHT AS WELL. 2016-08-27 08:45:37 -04:00
ThePhD
354c26772a 2.12.1 version includes automatic operator binding for basic comparators
it'll only be a matter of time before people ask me to auto-bind `operator+` and shit, but the answer for that will be no...
2016-08-25 12:50:50 -04:00
ThePhD
81ffb3f334 make sure proxies can be properly set to one another 2016-08-24 12:21:14 -04:00
ThePhD
54cffb7b6d tables and userdata and pairs and ipairs, oh my 2016-08-24 08:31:18 -04:00
ThePhD
cf76f6baa0 V E T T E D
Slight breaking change, but at the source level almost nothing changes (ipairs is the only thing that changes because for some reason it checks if what is passed is a table and that really doesn't make any fucking sense)
Closes #195
Closes #196
2016-08-23 21:42:27 -04:00
ThePhD
5b65ea1460 O-O-O-OVERHAAAAAUL no not really just bug fixes.... 2016-08-22 22:45:06 -04:00
Kevin Brightwell
a6c95dbb74 Add check for validity with object in require_file
Closes #193
2016-08-22 17:13:25 -04:00
ThePhD
56ed859d3f unqualified unqualified unqualified 2016-08-21 22:13:26 -04:00
ThePhD
6243cbe103 push_reference should respect unique usertypes 2016-08-21 19:24:26 -04:00
ThePhD
ec97dac651 push_reference must respect unique_usertypes are primitives 2016-08-21 19:20:31 -04:00
ThePhD
fd657ea249 qq clang pls 2016-08-19 21:38:19 -04:00
ThePhD
e31ed71006 Add hinting optimization to arrays 2016-08-19 21:08:03 -04:00
ThePhD
1ae78e1b54 High performance iteration for arrays 2016-08-18 23:51:41 -04:00
ThePhD
5ac32c7863 SIGH unused FUCKING variable 2016-08-17 16:00:27 -04:00
ThePhD
d06f2e6458 remove used variable 2016-08-17 15:53:26 -04:00
ThePhD
f256afffa3 Merge remote-tracking branch 'nava2/fix-osx-include' into develop 2016-08-17 15:49:14 -04:00
ThePhD
7744a49cfe I can spell good I promise
update bootstrap to properly use depsfile
2016-08-17 15:47:18 -04:00
ThePhD
4c2748eaef Fix in_place and optional usage here
Add `has_begin_end` getters for standard things
2016-08-17 15:05:26 -04:00
Kevin Brightwell
366937830c Fix #180 2016-08-17 14:29:21 -04:00
ThePhD
7903e1ec05 New initializer type called sol::factories, and the documentation to go with it 2016-08-17 01:16:44 -04:00
ThePhD
80981c2675 Fix the inheritance for newindex based calls 2016-08-14 13:20:27 -04:00
ThePhD
f608c4f0f8 Guess who joined the fuccboi club with g++ and VC++? THAT'S RIGHT, IT'S MINGW AND IT'S HANDY DANDY FRIEND, LIBSTDC++! WOOOOOO! 2016-08-12 15:57:53 -04:00
ThePhD
0d1d5ebd09 Turns out C++ sucks when all implementers don't do things equally as fast. WHO KNEW? 2016-08-12 13:08:59 -04:00
ThePhD
ffdff21487 Trying to be smart about shit, take 1. :B 2016-08-12 12:30:18 -04:00
ThePhD
391152382c [ci-skip] update feature table and be good at stuff 2016-08-12 11:06:14 -04:00
looki
09ba220e62 Fix 'expected .. received ..' message for function arguments 2016-08-12 04:33:26 +02:00
ThePhD
ff8ac8a6d4 One day I'll have a perfect release... 2016-08-11 11:36:39 -04:00
ThePhD
0338b7d18f Baby you construct me in all the right ways, let's spend our lifetimes together in this wonderful scope.~
Closes #168
2016-08-11 09:16:23 -04:00
ThePhD
4cde2b6a3b making questionable decisions since 1892 2016-08-11 07:25:57 -04:00
ThePhD
4aea285769 So we have 'inherited' metatables now. But is it fast? 2016-08-10 07:23:49 -04:00
ThePhD
94a1898b37 [OH GOD SO BROKEN WHY] This is tentative, untested "support" for calling inherited functions. 2016-08-10 06:32:44 -04:00
ThePhD
49cc3bddf0 Make everything super robust, thanks to @eevee pointing out some derps in how things were handled 2016-08-07 20:56:05 -04:00
ThePhD
57333bb529 Grumblemumble goddamn Xeo grumbleMumble 2016-08-07 14:04:07 -04:00
ThePhD
ba5465dd86 Fix #149's issue because Clang and Apple together are not an OTP. 0/10 would NEVER ship together
Fix regression of #166 because I am retarded
Get to looking at OrfeasZ's changes so I can know what to do with base classes
2016-08-07 12:41:29 -04:00
ThePhD
dc79e72c59 sol::vars support in most places, and updated documentation 2016-08-06 18:41:54 -04:00
ThePhD
dc05552e81 sol::var is now in business 2016-08-06 17:29:07 -04:00
OrfeasZ
51b583c88a Small typo. 2016-08-06 17:10:54 +03:00
OrfeasZ
373251c9e1 Better handling so we have 100% coverage of switch options. 2016-08-06 16:54:08 +03:00
OrfeasZ
7d6276448b Adding open_libraries(...) support for the Lua 5.3 utf8 library. 2016-08-06 16:48:51 +03:00
ThePhD
89250697aa Documents nullptr (Closes #159)
Documents callable structures and the function to use with `table.set` if needed (Closes #162)
2016-08-06 00:30:35 -04:00
ThePhD
89e0b62f2d const-ness fucking me in the ass again 2016-08-01 04:04:44 -04:00
ThePhD
045d9371df customization points are now live 2016-07-29 00:57:47 -04:00
ThePhD
be946d415c Merge remote-tracking branch 'origin/develop' into develop 2016-07-28 13:33:36 -04:00
ThePhD
de359acb3e Let's do iiiit. 2016-07-28 13:33:08 -04:00
FYP
62b21b1cec fix std::nullptr_t getter and pusher
according to
http://sol2.readthedocs.io/en/latest/tutorial/ownership.html it should
be that way
2016-07-26 00:31:31 +03:00
ThePhD
f1965a4364 const qq 2016-07-15 10:13:38 -04:00
ThePhD
85daffaa00 Havin' lots of derps these days. Fix #141 2016-07-15 07:33:54 -04:00
ThePhD
87eb901b01 Fix #139 2016-07-12 20:55:26 -04:00
ThePhD
6b85ed2936 At least I have users who can help me catch my dumbness. One day, I'll find someone who wants to work on something and isn't somehow insufferable. 2016-07-11 12:41:17 -04:00
ThePhD
ac5f13ce2f Now protect should work in multiple places, albeit we still need to do some optimizations to kick it in
Address #137 and improve implementation to not have to pop arguments
2016-07-09 13:38:55 -04:00
ThePhD
febfdbadb7 protect could use some additional optimizations for space, but I'm kinna tired. 2016-07-09 03:43:51 -04:00
ThePhD
14ced4af69 Add more tests and fix smaller errors with overloading and such. 2016-07-09 01:12:33 -04:00
ThePhD
f7108d5e37 Usertype documentation 2016-07-07 18:11:03 -04:00
ThePhD
dbaa8f58f0 Bogus clang errors make me sad. 2016-07-07 17:11:43 -04:00
ThePhD
47f29db964 qq so close to perfect 2016-07-07 17:02:11 -04:00
ThePhD
27174aba9c This mega-commit produces simple_usertype to allow for faster compile times by avoiding the use of __index internally. It sacrifices some speed and some storage optimizations and also does not allow variable syntax, but the produced table is directly modifiable.
Adds a `protect()` function to trigger safety for an item.
This commit also optimizes away all instances of virtual function calls for function calls and storage. Will need to test speed to see how it works out.
Closes #133
Closes #134
Closes #135
Closes #136
2016-07-07 16:52:39 -04:00
ThePhD
09ee4db1ed More templated fixes.
Closes #131
Closes #126, for the time being -- we can't make it go any faster without fundamentally breaking the system, and I can't do that to users rn
2016-06-29 14:08:26 -04:00
ThePhD
833be87011 More reductions... 2016-06-27 12:47:56 -04:00
ThePhD
bd62d99fbc One day, I won't run into compiler differences and lame pedanticisms for C++.
Addresses #126
2016-06-27 12:24:14 -04:00
ThePhD
374acaa7f5 Attempt #1 at reducing compiler overhead for large numbers of template instantiations. 2016-06-27 12:15:32 -04:00
ThePhD
97c132d91d Preserve internal type of member function calls / pointers, even if they're base types linked to derived types 2016-06-22 13:26:27 -04:00
ThePhD
0fef6556e4 Closes #125
Adds documentation for the new feature
Removes usages of  "sol::bond" in documentation, because that was supposed to be "sol::tie"
I really don't want to spend time trying to figure out how to slim down these templates...
2016-06-22 11:33:07 -04:00
ThePhD
83ba698aba More documentation, fix for signed/unsigned conversion issues. 2016-06-22 01:20:38 -04:00
ThePhD
d0ca1d8317 Maximum the features. 2016-06-20 09:51:26 -04:00
ThePhD
0faacb5d2c Slight refactoring of implementation. Also, stray #endif due to not being recognized by include guard regex -- the formula must be kept...!
(TODO: transition sol2 to include guards...?)
2016-06-20 07:03:44 -04:00
Lau Ching Jun
b6ba214f43 Use nullptr when converting to std::function if value is nil 2016-06-20 11:53:51 +08:00
ThePhD
63b9f748f7 Nice segmentation fault, GCC 2016-06-19 19:13:01 -04:00
ThePhD
2706f19976 Having a using statement that references the deprecation mechanism triggers... deprecation.
Thanks, clan/g++
2016-06-19 19:06:35 -04:00
ThePhD
b6928b4b4e Herpin' that derp.
SOL_NO_COMPAT is now in the proper place and documented in the compatibility part of the API.
Basic test for `table::add`
2016-06-19 19:02:40 -04:00
ThePhD
556be8da98 Documentation updates -- require function and add function and size function needed documentation
New `add` function as requested by @EliasD
2016-06-19 17:59:40 -04:00
ThePhD
d626eb0461 Well, that was a nasty hidden bug. But it's all clean now! 2016-06-18 04:10:47 -04:00
ThePhD
48ba47b059 The long road to correctness. 2016-06-18 03:56:44 -04:00
ThePhD
f45ecdcff4 Always unqualify / decay arguments 2016-06-18 03:45:03 -04:00
ThePhD
02428921af SIGH name shadowing 2016-06-18 03:36:26 -04:00
ThePhD
29e4b82b4a Formally introduce c_call to the API with overloading ability
More documentation on how things work.
Once more at a 'feature-complete' state. Continue to work on #116.
Add testcase to ensure #108 is fixed. Then, prep release.
2016-06-18 03:32:54 -04:00
ThePhD
cf5919b705 Proper workings for multiple inheritance work. 2016-06-16 20:15:56 -04:00
ThePhD
ba2dd387eb Herp the derp.
Really fixes #119
2016-06-15 12:18:30 -04:00
ThePhD
3bece97a40 Statikk trampolines and new tests for the newly opened issue
Closes #119
2016-06-15 12:00:25 -04:00
ThePhD
d76b7ebe09 Things're gonna get silly... 2016-06-13 22:31:19 -04:00
ThePhD
9352473d59 Oopsies with index / new_index. Should fix @billw2012 's problem from #71 2016-06-12 05:21:45 -04:00
ThePhD
69b45e4d66 Fixed documentation SNAFUs and typos. Praying for stack_get speed... 2016-06-11 13:10:38 -04:00
ThePhD
412718badb Test speed thought... 2016-06-11 11:51:56 -04:00
ThePhD
8eb10388c1 directly insert lua_cfunctions 2016-06-10 23:05:25 -04:00
ThePhD
72fcc1e6a5 nil checks. Nil checks as far as the eye can see. 2016-06-10 21:14:43 -04:00
ThePhD
e1241c110a SPEED AND FIXES, HOOOOOOOOO! 2016-06-10 21:04:48 -04:00
ThePhD
295b7b1a08 The performance went to shit and I need all the perf tools I can get to find out why. 2016-06-09 21:14:12 -04:00
ThePhD
58fc314e6f Fiiixes! Thanks to @CatPlusPlus and @melak47 for helping me fix this one.
Closes #112 .
2016-06-09 15:49:53 -04:00
ThePhD
b762de5c76 Ensure call works properly 2016-06-08 11:55:05 -04:00
ThePhD
606f8275a0 A small oopsie. 2016-06-08 11:29:30 -04:00
ThePhD
89bf8d5cbb Making sure everything is fixed on all compilers + g++ too now 2016-06-08 11:23:17 -04:00
ThePhD
220ff5a475 Fixes the key value being left on the stack when using iterators (the other case that's not "and we're not actually using this for iteration", asides from the empty table case).
Closes #111 - fixed
Closes #110 - need to test exactly how much extra speed was gained
Closes #108 - seems to be fixed, albeit std::mutex is a butt on VC++
2016-06-07 20:32:10 -04:00
ThePhD
53bed40bc5 Merge remote-tracking branch 'feature/boost-optional/boost-optional' into develop 2016-06-06 15:48:32 -04:00
ThePhD
c458849d29 Many of the tests are still busted, but we're getting closer.
Closes #96
Closes #79
Fixes #105 - but we still need to double-check and add a test to prove it
2016-06-06 15:46:53 -04:00
ThePhD
e35fe6be85 This mega-commit implements the new usertype_metatable while keeping everything else still intact. Blurgh, managing API versions suck... 2016-06-03 21:40:23 -04:00
Georg Sauthoff
250661b780 Use Boost Optional if SOL_USE_BOOST is defined
Usecase: Project already uses Boost as dependency, your compiler doesn't
come with <optional> yet and you want to minimize further dependencies.
2016-05-28 20:19:31 +02:00
ThePhD
9b65fb9f93 gotta have it on both sides yo 2016-05-20 05:39:34 -04:00
ThePhD
f70edf5686 Q_Q 2016-05-20 05:33:29 -04:00
ThePhD
8fa48627c6 awhdwjakdahwd clang++ internal linkage qqqqqqq 2016-05-20 05:25:56 -04:00
ThePhD
35d4eb3989 S I G H KEPLERPROJECT 2016-05-20 04:56:35 -04:00
ThePhD
7be09d0781 Who would have thought Lua's API between versions would be so... inconsistent. 2016-05-20 04:20:22 -04:00
ThePhD
e244a2bb67 SIGH g++ 2016-05-19 17:31:57 -04:00
ThePhD
9f019ae536 Adds requires feature - Closes #90
Function name for getting the status was actually changed to status in all places... being consistent, yay
2016-05-19 17:27:12 -04:00
ThePhD
54551af736 tempfile soemhow got here... 2016-05-19 02:18:01 -04:00
ThePhD
3b81a7c85f VC++ is a butt, but this Closes #91
It prepares for #97 as well, and blocks out #95 until I can be assed
Now, it's either performance or handling sol::property ...
2016-05-19 02:15:42 -04:00
ThePhD
96f231a183 We do have a cheap char type now, but figuring out that codecvt is super busted makes me sad
Safety macros are now in place. Usertype ones turned on by default
Closes #93
Closes #94
2016-05-18 21:29:17 -04:00
ThePhD
f8873064a5 And glibc is a fuccboi too. 2016-05-13 13:50:15 -04:00
ThePhD
938538b491 VC++ is a fuccboi 2016-05-13 13:42:31 -04:00
ThePhD
44cd259960 base_t templated 2016-05-13 03:13:23 -04:00
ThePhD
033c61ff1a Constructors for many of the types updated. sol::object now makes many more styles of types. Tests updated to match. Update documentation as per #87. Close #88. Close #86 2016-05-13 02:48:22 -04:00
ThePhD
a4e3caee15 TOPKEK initializers. 2016-05-11 22:09:17 -04:00
ThePhD
f1cedcb922 error on bad usertypes 2016-05-11 15:55:07 -04:00
ThePhD
45956d1637 the lua API is a nightmare 2016-05-05 16:59:17 -04:00
ThePhD
2cfce0d8ce I can spell the goodest, I swear 2016-05-05 16:40:14 -04:00
ThePhD
9f189df874 Undocumented macro for turning of compat (for the time being)
adding of luaL_loadbufferx as part of the 5.1 compat layer
2016-05-05 16:36:15 -04:00
ThePhD
309947d704 flesh out load buffer a little bit 2016-05-05 16:14:13 -04:00
MisterKH
c44f577d19 add load_buffer function 2016-05-05 15:12:25 +02:00
ThePhD
1c61773354 Use absolute indices in the places where it's necessary. 2016-05-03 16:49:53 -04:00
ThePhD
2aa5ab77a8 Ordering issues make me sad. 2016-05-03 15:17:14 -04:00
ThePhD
9e31119f16 This commit adds some QoI constructor keys / types, as well as implements make_object. The documentation has been updated as well.
Closes #78
Closes #77
Closes #76
Closes #75
2016-05-03 14:19:30 -04:00
ThePhD
06fecfb4ca Fix optional usages and edge cases. Closes #74 2016-05-02 01:52:51 -04:00
ThePhD
706ca803c8 push_reference and specific notes in the documentation for it 2016-05-01 17:10:41 -04:00
ThePhD
2531f2f851 muh tabz 2016-04-24 17:40:01 -04:00
ThePhD
ea0104475c gdi g++ 2016-04-24 17:38:55 -04:00
ThePhD
f15f8dd5a7 const-correctness since nobody is going to let me be fuckin' lazy .-. 2016-04-24 17:31:32 -04:00
ThePhD
b19d1a0854 Update version numbers, fix tests, and change bond -> tie, since nobody understands what bond means 2016-04-24 10:09:05 -04:00
ThePhD
38d21827b1 :l Stop finding bugs in my code -- unique_usertype_traits implemented, sol::overloaded work for static functions 2016-04-24 01:39:44 -04:00
ThePhD
a2eced863f shiny new load_result type, and thusly we're ready for 2.5. 2016-04-23 18:18:02 -04:00
ThePhD
2497567897 Inclusion argument order sorting 2016-04-23 17:40:22 -04:00
ThePhD
fdefa46ddc missing important include 2016-04-23 17:22:14 -04:00
ThePhD
673fc3a6fa loadfilex doesn't exist... nice. 2016-04-23 17:16:56 -04:00
ThePhD
f37eedd6c2 reverse_iterator 2016-04-23 17:13:49 -04:00
ThePhD
006357430b Shiny quick 'n' dirty tutorial -- variadic_args now is iterable -- fixed bug with transparent args in overload resolution -- added load functions 2016-04-23 17:07:51 -04:00
ThePhD
69ad2b4c71 better static assert 2016-04-22 17:59:44 -04:00
ThePhD
1b6062404b Demangling will kill us one day. 2016-04-22 17:39:54 -04:00
ThePhD
2cfe74cc7f Better demangling
Userdata pushed before the usertype is pushed will not latch onto the new metatable if its added
Updated tests
2016-04-22 17:06:56 -04:00
ThePhD
96da27d565 Ensure argument transparency. 2016-04-18 08:27:30 -04:00
ThePhD
062d2281d5 bit32 was deprecated, apparently. Lovely. 2016-04-17 21:14:33 -04:00
ThePhD
9872c67b4f jit lib and all 2016-04-17 21:00:24 -04:00
ThePhD
4123830e6c Should probably introduce a is_push_pop_transparent trait for things like is_this_state ... 2016-04-17 03:13:46 -04:00
ThePhD
4e029b7a00 -.- Macros. 2016-04-17 02:32:51 -04:00
ThePhD
90ea495d4c "constexpr" my ass. 2016-04-17 02:26:18 -04:00
ThePhD
88155d44e0 sol::property is implemented for usertypes now
sol::this_state is  a transparent argument that gets the current state at any position in any callback
sol::variadic_args allows a person to get something that can reference the "rest of the arguments", though it doesn't enforce that it has to be the last argument

Closes #57
Closes #59
Closes #60
2016-04-17 02:18:34 -04:00
ThePhD
f10988363c implicit conversion operator to make using the framework easier. 2016-04-11 18:07:25 -04:00
ThePhD
42f4455383 Allow for "static functions" to be registered on userdata like other parts of the framework, as well as self-contained structs and lambas.
sol::readonly for the ability to make a variable set on a userdata readonly.
No support for property yet: put on issues list for later
2016-04-11 01:02:43 -04:00
ThePhD
16007fa792 Documentation update, get_or for proxies, and other goodies. 2016-04-09 00:55:12 -04:00
ThePhD
4cdcac2001 Ensure compilation for 2 more function types 2016-04-07 05:43:44 -04:00
ThePhD
9734577fdb stack implementation, plus reference semantics within lua for usertypes/data now.
I hate my life.
I hate the projects I'm working on.
Closes #53
Closes #56
Closes #52
2016-04-07 05:21:49 -04:00
ThePhD
204bd5d5ed This adds the additional safety features. stack_guard should probably be migrated into the tests too, since a lesser form is already used there.
Closes #54 #55
2016-04-04 02:28:39 -04:00
ThePhD
5efbae5798 Is pedantic safe to turn on? TIME TO FIND OUT. 2016-04-02 09:11:44 -04:00
ThePhD
c087ca30bf .-. good thing we have travis CI 2016-03-31 16:33:21 -04:00
ThePhD
8862c65f0a NOW we're truly feature complete. Sheesh, the work that this requires.... 2016-03-31 16:16:07 -04:00
ThePhD
2d14cedc17 Eat shit, std::tuple 2016-03-31 12:12:04 -04:00
ThePhD
7af3fc4ffa Added nullopt pushing, optional pushing, improved tests 2016-03-30 16:52:51 -04:00
ThePhD
a683d615a5 compat for g fucking libgarbage 2016-03-30 03:33:44 -04:00
ThePhD
623f83547d Enumeraatiions... 2016-03-30 03:25:22 -04:00
ThePhD
3f753b55b9 Enumeration warnings 2016-03-30 03:24:07 -04:00
ThePhD
3abcf7f086 Fuck you, clang: http://stackoverflow.com/a/8629943/5280922 2016-03-30 03:08:53 -04:00
ThePhD
2826a1f8c0 unused q_q 2016-03-30 02:21:52 -04:00
ThePhD
2ee9967cdd More unused parameters. .-. 2016-03-30 02:16:08 -04:00
ThePhD
20c4fee60e unused parameter derp 2016-03-30 02:07:09 -04:00
ThePhD
92c388e30a And nooow we're set for optional. Totally. With the get_or implementation as well. Hopefully this will be all we need. 2016-03-30 01:40:40 -04:00
ThePhD
9804d7dd63 Merge remote-tracking branch 'zwparchman/develop' into develop 2016-03-30 00:34:05 -04:00
ThePhD
5acb33e2bc full-on optional support. so much support it's coming through my eyeballs. Goodness.
Support for c_call wrapper to be a thing.
2016-03-30 00:31:18 -04:00
Zachary
6637f2e1b7 Added table::get_with_default method
There is now a sol::table::get_with_default method that takes 2
arguments, one being the key to search on, the other being the default.
If the key does not have a value in the table the default value is
returned.
2016-03-29 13:03:19 -05:00
ThePhD
a0fdaaaa7d Full-on optional support. 2016-03-25 10:39:54 -04:00
ThePhD
7efc577eea Meow. 2016-03-25 05:43:37 -04:00
ThePhD
9aabf71896 Off by one errors .-. 2016-03-25 05:38:09 -04:00
ThePhD
68660a1bed Allow for checking whether or not a given proxy is valid. 2016-03-25 05:27:19 -04:00
ThePhD
4f99b99ee9 Properly directly include optional and reference it in C++17 and beyond. 2016-03-24 15:51:04 -04:00
ThePhD
09a0a5051a Documentation updates and new stack::check_get API. 2016-03-24 15:45:44 -04:00
ThePhD
f43adf9a3d Additional function creation tables and tests to keep them there. 2016-03-15 07:32:59 -04:00
ThePhD
c3bf2e04f8 I really don't like clang. 2016-03-15 06:45:49 -04:00
ThePhD
d52bc23f53 Mooooar tests. And better support for proxy and tuples. 2016-03-15 06:36:25 -04:00
ThePhD
3534bc222c proxy is now pushable, making it usable with functions 2016-03-15 05:20:56 -04:00
ThePhD
20d85850ea Ha ha haaa I forgot std::pair is a tuple-like type .-. 2016-03-14 18:33:10 -04:00
ThePhD
83ec159da1 Bwuh. 2016-03-14 17:19:43 -04:00
ThePhD
0c42c203c9 I program well, I swear. .-. 2016-03-14 17:12:03 -04:00
ThePhD
3de38f8da1 Easier access to specific functions. 2016-03-14 16:10:08 -04:00
ThePhD
97e36f70c5 Alright, NOW everything's kosher. Bwuh, byte order marks... 2016-03-14 09:53:24 -04:00
ThePhD
53c8961a20 Merge remote-tracking branch 'origin/develop' into develop 2016-03-14 02:34:28 -04:00
ThePhD
62f082d999 documentation fixes from feedback and fixes! 2016-03-14 02:34:02 -04:00
Patrik Huber
540926d9f4 Removed stray <feff> byte order mark
This fixes compiling with clang on msys2. I believe you saved these files as UTF16 once or something and these byte order marks were added by an editor.
The PR leads to the line "// The MIT License (MIT)" to no longer be present in the single-header sol.hpp at 3 occasions, but I think they were there by mistake anyway and should've been stripped by the python script, but didn't, because of the BOM. So this actually fixes that as well.
2016-03-14 00:54:23 +00:00
ThePhD
d3ccfa7426 Primetime 2016-03-13 10:03:05 -04:00
ThePhD
7f40c4edb6 Clang errors because 2 phase lookup is stupid between compilers. 2016-03-13 08:41:29 -04:00
ThePhD
c42c1bafe5 Documentation fixes, new tests, unique/shared_ptr support.
Closes #32
2016-03-13 08:30:14 -04:00
ThePhD
d8bc6c8612 Unfortunately have to use tag dispatched types because Clang's a piece of shit. 2016-03-11 18:41:44 -05:00
ThePhD
338278edf7 The docs are here. 2016-03-11 17:47:15 -05:00