summaryrefslogtreecommitdiff
path: root/Source/Modules/ruby.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Consolidate name mangling functionsWilliam S Fulton2022-11-121-1/+1
| | | | | | Swig_string_mangle => Swig_name_mangle_string Swig_name_mangle => Swig_name_mangle_string Swig_string_mangle_type => Swig_name_mangle_type
* Cleanup SWIG_VERSION definitionWilliam S Fulton2022-10-131-1/+1
| | | | | | | | | | | | | 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
* Improve director unwrap detection for the return typeWilliam S Fulton2022-10-101-21/+3
| | | | | | | | | | | | | Resolve the return type to correctly determine if the type is a pointer or reference to a director class. SwigType_refptr_count_return() recently added as a simpler fix is no longer needed. The conventional approach of using the "type" rather than "decl" to analyse the return type is used instead too. Issue #1823
* Merge branch 'director-unwrap-result'William S Fulton2022-10-071-3/+1
|\ | | | | | | | | * director-unwrap-result: Unwrap director classes only when returning a pointer or reference to an object
| * Merge branch 'master' into director-unwrap-resultOlly Betts2022-03-011-30/+9
| |\
| * | Unwrap director classes only when returning a pointer or reference to an objectThomas Reitmayr2020-06-201-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This involves properly counting the number of references and pointers in the return type of a function and only generate unwrapping code if this number is 1. For template instances some post-processing code is added to fix the 'decl' and 'type' attributes of functions if changed in an unfavorable way during template expansion. This commit fixes swig#1811.
* | | Use https for swig.org linksOlly Betts2022-10-061-1/+1
| | |
* | | Add DOH Exit() and SetExitHandler()Olly Betts2022-03-061-5/+5
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Exit() is a wrapper for exit() by default, but SetExitHandler() allows specifying a function to call instead. This means that failures within DOH (e.g. Malloc() failing due to lack of memory) will now perform cleanup such as removing output files. This commit also cleans up exit statuses so SWIG should now reliably exit with status 0 if the run was successful and status 1 if there was an error (or a warning and -Werror was in effect). Previously in some situations SWIG would try to exit with the status set to the number of errors encountered, but that's problematic - for example if there were 256 errors this would result in exit status 0 on most platforms. Also some error statuses have special meanings e.g. those defined by <sysexits.h>. Also SWIG/Javascript tried to exit with status -1 in a few places (which typically results in exit status 255).
* | [Ruby] Fix remove of prefix from method nameOlly Betts2022-02-021-2/+3
| | | | | | | | | | | | The prefix is now only removed at the start. Fixes https://sourceforge.net/p/swig/bugs/1136/
* | Fix ODR violationsOlly Betts2021-09-201-0/+2
| | | | | | | | Detected by compiling with GCC flags `-flto -Wodr`.
* | Remove support for $source and $targetOlly Betts2021-04-301-28/+4
|/ | | | | | | | These were officially deprecated in 2001, and attempts to use them have resulted in a warning (including a pointer to what to update them to) for most if not all of that time. Fixes #1984
* Improve description of cast macros for RubyThomas Reitmayr2020-01-041-7/+5
| | | | | | | | | 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-031-1/+1
|
* Add support for Ruby 2.7Thomas Reitmayr2019-12-311-13/+9
| | | | | | | | | | | | 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.
* Fix code generated for Ruby global variablesThomas Reitmayr2019-10-271-10/+26
| | | | | | This commit fixes swig#1653 by creating a Ruby virtual variable for a C/c++ global variable when SWIG is invoked with the -globalmodule option.
* Harmonize parameters in autodoc in Ruby and Octave with PythonVadim Zeitlin2019-01-211-10/+12
| | | | | | | | Backport changes to Python version of make_autodocParmList() to Ruby and Octave modules, which use similar code. In particular, this improves handling of parameters clashing with the language keywords/reserved words for these languages as well.
* Fix Ruby docstring feature.William S Fulton2019-01-051-24/+13
| | | | | | | | | | | | The docstring was not encapsulated within /* */ comments. The implementation had code for autodoc strings being either single or multi-line and then adding extra newlines. However, in practice only multi-line autodoc string are ever generated, so this bit of code handling was removed. The docstring feature does not attempt to add newlines depending on the existence of newlines in the docstring. Closes #538
* Remove -cppcast and -nocppcast command line optionsWilliam S Fulton2018-11-131-14/+7
| | | | | | | | | | | | | The -cppcast option is still turned on by default. The -nocppcast option to turn off the use of c++ casts (const_cast, static_cast etc) has been removed. However, defining SWIG_NO_CPLUSPLUS_CAST will still generate C casts instead of C++ casts for C++ wrappers. This a revert of commit fc79264a48f186f8bbd367e91fa9dbf9758aa092: "Revert "Remove -cppcast and -nocppcast command line options"" The Scilab and Javascript casting problems are now fixed, so -cppcast is now switched on as default.
* Revert "Remove -cppcast and -nocppcast command line options"William S Fulton2018-11-061-7/+14
| | | | | | This reverts commit c06f2b4497bffeb185dbf0e65dc925514537ef37. More work to be done as it breaks Scilab and Javascript tests.
* Remove -cppcast and -nocppcast command line optionsWilliam S Fulton2018-11-061-14/+7
| | | | | | | The -cppcast option is still turned on by default. The -nocppcast option to turn off the use of c++ casts (const_cast, static_cast etc) has been removed. However, defining SWIG_NO_CPLUSPLUS_CAST will still generate C casts instead of C++ casts for C++ wrappers.
* Misc. typosluz.paz2018-05-171-1/+1
| | | found via `codespell` and `grep`
* Merge branch 'goatshriek-ruby-alias'William S Fulton2018-04-071-1/+7
|\ | | | | | | | | * goatshriek-ruby-alias: Fix ruby %alias directive for native c functions
| * Fix ruby %alias directive for native c functionsJoel Anderson2018-03-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the %alias directive on native C functions causes swig to segfault due to a dereference of klass (which is NULL for native C functions) in the defineAliases function of the Ruby module. This commit adds support for an alias of native C functions for both separate module as well as global functions, as well as three test cases for the %alias directive of the Ruby module. Fixes: mod.i %module ruby_alias %alias get_my_name "nickname,fullname"; %inline %{ const char *get_my_name(){ return "Chester Tester"; } %} $ swig -ruby mod.i Segmentation fault Signed-off-by: Joel Anderson <joelanderson333@gmail.com>
* | [Ruby] Pass Qnil instead of NULL to rb_funcall()Olly Betts2018-04-031-1/+1
|/ | | | | This silences GCC -Wconversion-null warning (on by default with recent GCC).
* Generation of director method declarations fixesWilliam S Fulton2017-10-231-4/+4
| | | | | | | - Fixes generation of director method declarations containing C++11 ref-qualifiers. - Fixes generation of director method declarations returning more complex types such as const ref pointers. - Rewrite Swig_method_call to use more up to date code in the core.
* Enhancements for directorin typemapsWilliam S Fulton2017-10-161-1/+1
| | | | | | | | | The directorin typemaps will now generate a temporary variable (specified after the type), such as: %typemap(directorin) MyType (MyType *temp) { ... use temp ... } The shared_ptr director typemaps have been fixed for use in functions that take more than one parameter.
* Fix potential use of uninitialized variables in directorsWilliam S Fulton2017-05-131-3/+13
|
* #526 : propagate c++11 noexcept to director classesChristophe Duvernois2017-04-271-0/+4
|
* Fix GCC 7 warningsOlly Betts2016-12-211-2/+1
| | | | From -Wimplicit-fallthrough which is now enabled by -W.
* Fix "set but not used" warningOlly Betts2016-12-131-1/+1
|
* Remove unused kwnames generated variable in Ruby wrappersWilliam S Fulton2016-05-281-1/+3
| | | | This seems to be from some left over Python kwargs / unfinished kwargs support
* Merge branch 'tamuratak-master'William S Fulton2016-05-171-5/+6
|\ | | | | | | | | | | * tamuratak-master: Revert introduction of minor memory leak in Ruby wrappers ruby: use nodeType attribute to determine whether functions are constructors. get return type each time.
| * Revert introduction of minor memory leak in Ruby wrappersWilliam S Fulton2016-05-171-1/+5
| |
| * ruby: use nodeType attribute to determine whether functions are constructors.Takashi Tamura2016-04-081-5/+2
| | | | | | | | get return type each time.
* | Merge branch 'ruby-module-docstring'William S Fulton2016-05-171-0/+12
|\ \ | |/ |/| | | | | | | * ruby-module-docstring: Ruby module docstring avoid memory leak Ruby add support for docstring option in %module()
| * Ruby module docstring avoid memory leakAurelien Jacobs2016-01-121-2/+4
| |
| * Ruby add support for docstring option in %module()Aurelien Jacobs2016-01-111-0/+10
| | | | | | | | This was already documented but not actually implemented.
* | Multiple inheritance warning wording tweakWilliam S Fulton2016-03-061-1/+1
| |
* | Fix typo: "neccessary" -> "necessary"Olly Betts2016-01-121-1/+1
|/
* Alternative solution for Ruby unbalanced bracesWilliam S Fulton2016-01-101-5/+4
|
* Ruby fix unbalanced braces causing issue with the YARD parserAurelien Jacobs2016-01-091-0/+3
|
* Prevent redefinition warnings when compiling with SWIG<module> definedPetre Eftime2015-12-221-2/+1
| | | | Signed-off-by: Petre Eftime <petre.p.eftime@intel.com>
* Ruby shared_ptr fixes for use with minheritWilliam S Fulton2015-10-011-10/+8
|
* Fix Ruby smartptr feature for classes in a namespaceWilliam S Fulton2015-09-251-2/+3
|
* Add Ruby shared_ptr supportWilliam S Fulton2015-09-251-5/+31
|
* Ruby free function declaration changeWilliam S Fulton2015-09-141-1/+3
| | | | | Declare function taking void * parameter to be more flexible for upcoming smart pointer support.
* Fix ruby warning using clang in director exception codeWilliam S Fulton2015-08-311-0/+1
| | | | | | | | Suppresses warning: error: control may reach end of non-void function [-Werror,-Wreturn-type] The UNUSED macro is not expanded in ruby.h for rb_exc_raise for clang when it ought to be. For patch #512
* gcc-5.1 warning fixesWilliam S Fulton2015-04-261-4/+2
|
* Fix C&P references to Python in commentsOlly Betts2015-03-271-2/+2
|
* Create director_common.swg for language-indep codeOlly Betts2015-03-121-0/+1
| | | | | Move -DSWIG_DIRECTOR_STATIC handling there, so this is now supported for all languages with director support, not just Python and PHP.