summaryrefslogtreecommitdiff
path: root/Lib/lua
Commit message (Collapse)AuthorAgeFilesLines
* Lua variadic templates sizeof... constants fixWilliam S Fulton2022-12-221-2/+2
|
* [Lua] Fix type resolution between SWIG-wrapped modulesOlly Betts2022-10-201-1/+1
| | | | See #2126
* Cleanup SWIG_VERSION definitionWilliam S Fulton2022-10-131-2/+0
| | | | | | | | | | | | | Add Swig_obligatory_macros which must be called by each target language to define SWIG_VERSION correctly in the generated code, as well as the language specific macro SWIGXXX where XXX is the target language name. Drop the #ifdef SWIGXXX that was previously generated - I can't see the point of this and if users are defining this macro somehow, then users will need to change this Closes #1050
* Sort out predefined SWIG-specific macrosOlly Betts2022-10-051-0/+2
| | | | | | | | | | | | | | | | | | | Ensure that SWIG_VERSION is defined both at SWIG-time and in the generated C/C++ wrapper code (it was only defined in the wrapper for some target languages previously). SWIGGO and SWIGJAVASCRIPT are now defined in the generated wrappers to match behaviour for all other target languages. Stop defining SWIGVERSION in the wrapper. This only happened as a side-effect of how SWIG_VERSION was defined but was never documented and is redundant. The new testcase also checks that SWIG is defined at SWIG-time but not in the generated wrapper, and that exactly one of a list of target-language specific macros is defined. Fixes #1050
* Add missing typecheck typemaps for std::auto_ptr and std::unique_ptrWilliam S Fulton2022-09-172-0/+12
| | | | To fix overloading when using these types.
* Provide SWIGTYPE MOVE typemaps in swigmove.iWilliam S Fulton2022-09-161-0/+18
| | | | | | | | | | | | For implementing full move semantics when passing parameters by value. Based on SWIGTYPE && and std::unique_ptr typemaps which implement move semantics. Added for all languages, but untested for: Go, Ocaml, R, Scilab (and unlikely to be fully functional for same reasons as for std::unique_ptr support). Issue #999
* Test/fixes to handle NULL pointer for unique_ptr/auto_ptrWilliam S Fulton2022-08-312-2/+2
| | | | Also add missing unique_ptr tests for Lua and Racket.
* SWIGTYPE && input typemaps now assume object has been movedWilliam S Fulton2022-08-311-4/+10
| | | | | | | | | | | | | | | | | | | | Replicated Java implementation. Fully implemented for: - C# - D - Guile - Javascript (UTL) - Lua - MzScheme - Octave (UTL) - Perl (UTL) - PHP - Python (UTL) - Ruby (UTL) - Tcl (UTL) PHP std::auto_ptr std::unique_ptr minor tweaks and testcase corrections
* Cosmetic stray semi-colon removal after %typemap using quotesWilliam S Fulton2022-08-311-1/+1
|
* Add Lua support for std::unique_ptr and std::auto_ptrWilliam S Fulton2022-08-113-9/+87
| | | | Equivalent to Python/Ruby implementations.
* More move semantics improvementsWilliam S Fulton2022-07-041-1/+1
| | | | | More removal of casts in the out typemaps when copying objects to enable C++ compilers to possibly make use of move semantics.
* Movable and move-only types supported in "out" typemaps.William S Fulton2022-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhance SWIGTYPE "out" typemaps to use std::move when copying objects, thereby making use of move semantics when wrapping a function returning by value if the returned type supports move semantics. Wrapping functions that return move only types 'by value' now work out the box without having to provide custom typemaps. The implementation removed all casts in the "out" typemaps to allow the compiler to appropriately choose calling a move constructor, where possible, otherwise a copy constructor. The implementation alsoand required modifying SwigValueWrapper to change a cast operator from: SwigValueWrapper::operator T&() const; to #if __cplusplus >=201103L SwigValueWrapper::operator T&&() const; #else SwigValueWrapper::operator T&() const; #endif This is not backwards compatible for C++11 and later when using the valuewrapper feature if a cast is explicitly being made in user supplied "out" typemaps. Suggested change in custom "out" typemaps for C++11 and later code: 1. Try remove the cast altogether to let the compiler use an appropriate implicit cast. 2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the __cplusplus macro if all versions of C++ need to be supported. Issue #999 Closes #1044 More about the commit: Added some missing "varout" typemaps for Ocaml which was falling back to use "out" typemaps as they were missing. Ruby std::set fix for SwigValueWrapper C++11 changes.
* Document argc argv libraryWilliam S Fulton2022-05-151-1/+1
|
* argcargv.i cosmetic updatesWilliam S Fulton2022-05-151-13/+12
|
* Add argcargv.i to LuaKonrad Eisele2022-05-061-0/+58
| | | | Found in https://stackoverflow.com/questions/9860362/swig-lua-call-mint-argv-char-argc
* Fix typos in docs and commentsOlly Betts2022-02-275-13/+13
|
* Remove commented out redundant codeOlly Betts2022-02-271-10/+0
| | | | | | | This was an alternate version without NULL checks on free() and delete, but we removed those checks globally in 7ec2f89fe241e3aabd988d3aa6fe17e4878516dc so now it's just the same as the active code.
* Avoid -Wempty-body warnings from SWIG_contract_assertOlly Betts2022-02-112-3/+3
|
* Renames performed by `%namewarn` with `rename=` are printed in warning messageSeth R Johnson2022-02-061-1/+1
| | | | | | This is necessary for regex-like renames (where you can't use the #define trick as is done in many of the %keywordwarn directives). It's now unnecessary to print the "renaming to '`x`'" code explicitly by the kw.swg files.
* Remove redundant NULL checks before free()/delete (#2184)Olly Betts2022-01-291-2/+2
| | | | | | | | | Remove redundant NULL checks before free()/delete The ISO C and C++ standards guarantee that it's safe to call these on a NULL pointer, so it's not necessary for the calling code to also check. Fixes https://sourceforge.net/p/swig/feature-requests/70/
* [lua] Fix maybe-uninitialized warning in generated codetytan6522021-12-151-1/+1
|
* Lua int ref typemap improvementsWilliam S Fulton2021-11-121-4/+4
| | | | | Fixes complex typedefs to const int& and const unsigned int&. Fixes cpp11_type_aliasing testcase
* Member function pointer typemap tweaksWilliam S Fulton2021-04-261-3/+3
| | | | | | Use sizeof variable name rather than variable type. Workaround Visual C++ unable to parse some complex C++11 types, such as sizeof(short (Funcs::*)(bool) const &&)
* Fix more "allows to" and other typosOlly Betts2021-04-211-4/+4
|
* Fix unwrapping of LUA lightuserdata type. Add test case.Ryan Nevell2020-02-171-0/+5
|
* removing unnecessary bitsShane Liesegang2019-08-021-7/+1
|
* closer match to Python's outputShane Liesegang2019-08-021-1/+1
|
* typoShane Liesegang2019-07-281-1/+1
|
* actually seeing both is usefulShane Liesegang2019-07-271-1/+1
|
* matching code conventionsShane Liesegang2019-07-201-20/+20
|
* Lua userdata print pointing to wrapped memoryShane Liesegang2019-07-201-2/+2
| | | This is actually a fix to some functionality that I submitted many years ago. :) At the time I set the string conversion to output the userdata address, but since that points to an internal SWIG structure, it's way more useful to the user to point to the actual memory being wrapped in that userdata.
* Consistent parameter names for std::pairWilliam S Fulton2019-02-141-2/+2
|
* Add STL container copy constructors where missingWilliam S Fulton2019-02-142-1/+2
| | | | Also provide consistent copy constructor declarations.
* Add missing typedefs to std::vector + typedef correctionsWilliam S Fulton2019-02-131-0/+8
| | | | | | | Tests for std::vector of pointers added which check std::vector<T*>::const_reference and std::vector<T*>::reference usage which gave compilation errors in Python and Perl which had specialized these vectors incorrectly.
* Add missing typedefs to std::pairWilliam S Fulton2019-02-131-16/+0
|
* Add missing typedefs to std::mapWilliam S Fulton2019-02-131-0/+6
|
* Add missing parameter names in STL container wrappersWilliam S Fulton2019-02-134-5/+3
| | | | | | | Mostly in STL copy constructors. Best to have parameter names as they make their way into the wrappers in some target languages.
* Fix overloading for non-pointers and NULL - LuaWilliam S Fulton2018-12-303-8/+14
|
* Add support for non-default compare template argument in std::map wrappersWilliam S Fulton2018-10-091-5/+5
|
* Misc. typosluz.paz2018-05-173-5/+5
| | | found via `codespell` and `grep`
* Fix various comment and documentation typosOlly Betts2017-08-131-2/+2
|
* Merge branch 'jleveque-warning_fix'William S Fulton2017-04-251-2/+2
|\ | | | | | | | | * jleveque-warning_fix: [Lua] Fix compiler warnings
| * [Lua] Fix compiler warningsJoe LeVeque2017-03-311-2/+2
| |
* | Fix Lua warning for missing (SWIGTYPE CLASS::*) typemaps for C wrappersWilliam S Fulton2017-04-251-2/+0
|/
* Fix wrapping of references/pointers and qualifiers to member pointersWilliam S Fulton2017-03-161-0/+2
| | | | Also fix Go wrapping of member const function pointers.
* Add <typeinfo> header for std::bad_castDaniel Vollmer2016-09-171-0/+1
|
* Add std::bad_cast to std_except.iDaniel Vollmer2016-09-171-0/+1
| | | | | | This exception occurs when dynamic_cast<T&> fails. Fixes #783.
* Fix lua base class methods with __getitemAlexander Warg2016-03-171-13/+42
| | | | | | | When a C++ class defined a __getitem function the base classes where never used for resolving methods. This fix first scans the '.get' and '.fn' tables of all base classes and only if there is no result does the same for __getitem functions.
* lua: push characters as unformatted 1-character stringsNils Gladitz2015-07-013-4/+7
| | | | | | | | Since Lua 5.3 the "%c" format character in lua_pushfstring will produce the string "<\XXX>" (XXX being a decimal code sequence) when given unprintable characters. Use lua_pushlstring instead to reproduce the old behavior.
* lua: push integer constants as integerAlexander Warg2015-04-281-1/+1
| | | | | This allows better compatibility with Lua 5.3. Otherwise function overloading assuming integer parameters might not work.