summaryrefslogtreecommitdiff
path: root/Lib/ruby
Commit message (Collapse)AuthorAgeFilesLines
* Really fix "mixed declarations and code" warningOlly Betts2023-04-191-3/+1
|
* Fix "ISO C90 forbids mixed declarations and code" warningMaple Ong2023-04-121-1/+2
|
* Fix "undefining the allocator of T_DATA" error seen in Ruby 3.2Maple Ong2023-04-121-1/+2
| | | | | Ruby 3.2 issue: https://bugs.ruby-lang.org/issues/18007 Similar to https://github.com/robinst/swig/commit/9b5d37fd174331fa2b7113fe968fcf0570de43bf
* 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/+1
| | | | | | | | | | | | 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
* Cosmetic stray semi-colon removal after %typemap using quotesWilliam S Fulton2022-08-311-2/+2
|
* rubyWilliam S Fulton2022-07-311-0/+2
|
* Suppress Ruby.h gcc warningsWilliam S Fulton2022-07-311-0/+15
|
* Add support for std::auto_ptr inputsWilliam S Fulton2022-07-181-6/+20
| | | | Ported from std::unique, behaviour is identical with regard to memory ownership/handling
* Cosmetic formatting and doc updates in std_unique_ptr.i filesWilliam S Fulton2022-07-171-6/+7
|
* Add Ruby support for std::unique_ptr inputsWilliam S Fulton2022-07-172-1/+23
| | | | Equivalent to Java/C#/Python implementations.
* More move semantics improvementsWilliam S Fulton2022-07-041-2/+2
| | | | | More removal of casts in the out typemaps when copying objects to enable C++ compilers to possibly make use of move semantics.
* Performance optimisation for directors for classes passed by valueWilliam S Fulton2022-07-041-1/+1
| | | | | | | The directorin typemaps in the director methods now use std::move on the input parameter when copying the object from the stack to the heap prior to the callback into the target language, thereby taking advantage of move semantics if available.
* Cosmetic changes to auto_ptr library filesWilliam S Fulton2022-07-021-8/+10
|
* Add std::unique supportWilliam S Fulton2022-07-021-0/+19
| | | | | | | Simple copy of current auto_ptr support (just suppport for functions returning std::unique_ptr). Closes #1722
* Movable and move-only types supported in "out" typemaps.William S Fulton2022-06-301-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+3
|
* argcargv.i cosmetic updatesWilliam S Fulton2022-05-151-8/+5
|
* Fix Ruby 3.2 warning "undefining the allocator of T_DATA class ↵Robin Stocker2022-04-121-0/+1
| | | | | | | | | | | | | | | | | | | swig_runtime_data" Ruby 3.2 (still in development) started warning about this, see https://bugs.ruby-lang.org/issues/18007. Note that the extension docs mention it in https://ruby-doc.org/core-3.1.1/doc/extension_rdoc.html#label-C+struct+to+Ruby+object: > The klass argument is the class for the object. The klass should > derive from `rb_cObject`, and the allocator must be set by calling > `rb_define_alloc_func` or `rb_undef_alloc_func`. So in this case we call `rb_undef_alloc_func` to fix the warning. Verified that this works in robinst/taglib-ruby#115. Fixes #2257.
* Fix typos in docs and commentsOlly Betts2022-02-271-1/+1
|
* 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.
* Ruby: Fix warnings in generated code about missing parameter in variadic macroThomas Reitmayr2022-01-299-13/+13
| | | | | | | | | | | | | | The Ruby C API function 'rb_funcall' is used in various places in generated code for invoking a Ruby method without parameters. The C function uses a variadic parameter list for the arguments passed to Ruby, therefore in these cases the list of variadic parameters is empty. As an optimization Ruby may implement the 'rb_funcall' function as a macro which however will not accept an empty list of arguments for '...' as of C99 and C++11. In order to prevent compiler warnings, this commit replaces all such occurrences with a call to 'rb_funcall2' (which in its current name 'rb_funcallv' is invoked by the 'rb_funcall' macro anyway, at least for Ruby 2.6.6).
* Fix typosDimitris Apostolou2021-11-171-2/+2
|
* Fix more "allows to" and other typosOlly Betts2021-04-211-1/+1
|
* 0.0 float warning fixWilliam S Fulton2020-10-101-1/+1
|
* Merge branch 'fix-1199'William S Fulton2020-06-071-0/+2
|\ | | | | | | | | * fix-1199: fix #1199
| * fix #1199Viktor Gal2020-02-011-0/+2
| |
* | Ruby wstring - only include endian.h on linuxAndreas Schwab2020-06-061-2/+13
| | | | | | | | | | This file is not always available on other systems. See #1801
* | Ruby - catch exceptions by const referenceWilliam S Fulton2020-02-181-9/+8
| |
* | Merge branch 'catch-value'William S Fulton2020-02-181-5/+5
|\ \ | | | | | | | | | | | | * catch-value: Catch exceptions by reference rather than by value.
| * | Catch exceptions by reference rather than by value.Daniel Mach2020-02-141-5/+5
| |/ | | | | | | Fixes -Wcatch-value gcc warnings.
* | Remove an unnecessary shared_ptr reference count increment in Ruby wrappersWilliam S Fulton2020-02-131-17/+20
|/ | | | | | When wrapping STL containers, remove a shared_ptr reference count increment when an upcast is needed when checking type conversion in traits_check::check.
* Extend std::auto_ptr<> support to RubyVadim Zeitlin2020-01-171-0/+17
| | | | | | This is trivial as exactly the same typemap as for Python can be used for Ruby too, all the differenced are abstracted by the unified typemap library.
* Improve description of cast macros for RubyThomas Reitmayr2020-01-041-8/+24
| | | | | | | | | The macros for casting function pointers are now fully described and also clarify why the macros act transparently for C even before Ruby 2.7. In addition, an "if (CPlusPlus)" was removed in the code generator for global variables in order to keep the distinction between C and C++ in one place, which is at the definition of said macros.
* Move new macros for Ruby to their dedicated namespaceThomas Reitmayr2020-01-032-6/+10
|
* Add support for Ruby 2.7Thomas Reitmayr2019-12-314-36/+29
| | | | | | | | | | | | This commit fixes the signatures of various callback methods and cleans up the macro definitions used for casting callbacks. Note that the transparent version of the macro RUBY_METHOD_FUNC is currently masked behind RUBY_DEVEL, see commit https://github.com/ruby/ruby/commit/1d91feaf13e0ffe04b2dabc6e77e4101b6d0bb07 In order to still support strict signature checking and prevent nasty deprecation warnings, the use of RUBY_METHOD_FUNC had to be replaced with VALUEFUNC.
* Python STL container method overloading fixWilliam S Fulton2019-08-061-8/+2
| | | | | Fix method overloading of methods that take STL containers of different types. Due to some error handling that was not cleared during typehecking.
* Remove the UnknownExceptionHandler director error handling classWilliam S Fulton2019-06-271-37/+0
| | | | | | | | Done in order to be C++17 compliant as it uses std::unexpected_handler which was removed in C++17. This class was intended for director exception handling but was never used by SWIG and was never documented. Closes #1538
* Replace std::unexpected_handler with std::terminate_handler to be c++17 ↵William S Fulton2019-06-271-5/+5
| | | | | | compliant Closes #1538
* Include all template parameters for std_unordered_multiset and std_unordered_setWilliam S Fulton2019-03-122-20/+20
|
* Correct unordered_set/unordered_multiset template Key parameter nameWilliam S Fulton2019-03-122-20/+20
|
* Include all template parameters for std_unordered_multimap and std_unordered_mapWilliam S Fulton2019-03-122-21/+21
|
* Add in a definition for RTYPEDDATA_P for Ruby<1.9.3William S Fulton2019-02-221-0/+3
| | | | | | | | This definition ensures the SWIG wrappers keep compiling in older versions of Ruby given the previous change (which uses RTYPEDDATA_P and hence requires Ruby 1.9.3). The definition of RTYPEDDATA_P is such that the previous commit plus the definition should keep the behaviour the same as before.
* [ruby] check whether object is of RTypedData using RTYPEDDATA_P.Takashi Tamura2019-02-221-2/+2
|
* Add missing parameter names in STL container wrappersWilliam S Fulton2019-02-136-7/+7
| | | | | | | Mostly in STL copy constructors. Best to have parameter names as they make their way into the wrappers in some target languages.
* Create a consistent stl.i library fileWilliam S Fulton2019-02-121-2/+0
| | | | | Same file now for all languages except R which is still missing std_map.i. Recent Java changes adding in std_set.i removed.
* Fix overloading for non-pointers and NULL - RubyWilliam S Fulton2018-12-291-1/+1
|
* Remove final remnants of GCJ - jstring.iWilliam S Fulton2018-06-151-44/+0
|
* follow-up typosluz.paz2018-05-171-1/+1
|
* Misc. typosluz.paz2018-05-172-2/+2
| | | found via `codespell` and `grep`