Commit graph

123 commits

Author SHA1 Message Date
William S Fulton
c10a84c775 Cosmetic stray semi-colon removal after %typemap using quotes 2022-08-31 19:40:13 +01:00
William S Fulton
ec965840ce Cosmetic stray semi-colon removal after %typemap 2022-08-20 15:29:49 +01:00
William S Fulton
bf36bf7d8a Movable and move-only types supported in "out" typemaps.
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.
2022-06-30 17:26:48 +01:00
William S Fulton
28036e5a16 Documentation for attribute support in $typemap. 2022-06-04 14:19:15 +01:00
William S Fulton
da40946aaa Merge branch 'typemap-colon'
* typemap-colon:
  Incoporate review suggestions
  Allow referencing of typemap keywords inside of "$typemap("
2022-06-01 07:57:01 +01:00
Olly Betts
f137840aa9 Clarify name used for matching out typemaps
Based on a patch from Dustin J. Mitchell in
https://sourceforge.net/p/swig/bugs/915/
2022-03-07 17:40:25 +13:00
Olly Betts
9eb75a0c07 Improve typemap method and attribute checking
Specifying a value on the typemap method now gives an error, e.g.:

%typemap(argout=123) char * ""

The old way of specifying a language name in the typemap attributes
is no longer supported (it has been deprecated for 16 years).

Closes #891
2022-03-03 18:46:15 +13:00
Seth R Johnson
b38a6530e3 Incoporate review suggestions 2022-02-26 06:40:37 -05:00
Seth R Johnson
1329670640 Allow referencing of typemap keywords inside of "$typemap(" 2022-02-25 10:52:33 -05:00
William S Fulton
d59cbf1c39 Fragments: additional testing and documentation enhancements
Add test for original syntax when using a single fragment key containing
the list of dependent fragments. I couldn't find a test for this.

Spaces in the fragment list don't seem to work - document it.
2022-02-07 21:45:33 +00:00
Seth R Johnson
6c41db3b8c Add documentation 2022-02-05 19:12:06 -05:00
Olly Betts
7ec2f89fe2
Remove redundant NULL checks before free()/delete (#2184)
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/
2022-01-29 22:03:48 +13:00
William S Fulton
b7bcb338cf Add C++20 documentation chapter 2020-06-08 20:56:40 +01:00
William S Fulton
7070320335 Revert "Add C++20 documentation chapter"
This reverts commit 36e8d521de.

Conflicts:
	Doc/Manual/R.html
2020-06-08 20:06:55 +01:00
William S Fulton
36e8d521de Add C++20 documentation chapter
[skip-ci]
2020-01-28 20:31:53 +00:00
William S Fulton
753c50afd7 Update docs on %typecheck precedence levels 2019-07-25 18:57:10 +01:00
William S Fulton
bc615e8a6e Correct out of date html links 2019-04-15 19:01:52 +01:00
William S Fulton
d16d145787 Documentation section numbering update
[skip ci]
2019-02-11 19:02:03 +00:00
William S Fulton
7375d4575a Typemap %apply docs clarification 2018-10-24 19:53:31 +01:00
William S Fulton
51f1478df7 Improve typemaps documentation for %apply and delete.
Make %apply and %clear section clearer (hopefully).
2018-10-05 20:45:52 +01:00
luz.paz
6f69830321 follow-up typos 2018-05-17 10:26:00 -04:00
William S Fulton
066c396ad6 Add C++17 documentation chapter 2018-05-14 21:29:46 +01:00
William S Fulton
34712c0108 Improve Java director exception customization documentation 2017-11-29 20:32:15 +00:00
William S Fulton
077bb0b04f Improved Java director exceptions documentation 2017-11-16 20:03:58 +00:00
William S Fulton
ed4b84f4d3 Fix overloading of shared_ptr method overloading
Add 'equivalent' attribute to typecheck typemap.
Closes #1098.
2017-09-23 15:19:34 +01:00
William S Fulton
330ef362f4 Add docs for C++11 ref-qualifiers 2017-08-30 18:17:04 +01:00
William S Fulton
57a89f987d Fix %import and %fragment forced inclusion to not generate code. 2017-06-03 18:37:05 +01:00
sunoru
9a6f82ab31 Realign for some comments. 2016-12-31 23:29:45 +08:00
sunoru
8985c34809 Fix some typos in docs and examples and make the code look nicer. 2016-12-31 23:06:56 +08:00
William S Fulton
96015de0dd Update documentation for using SWIG_ConvertPtr example usage
Add a test case to test the example documentation typemaps
2016-10-23 20:16:35 +01:00
William S Fulton
268b942865 Consistent formatting of example code in the docs 2016-10-23 20:16:35 +01:00
William S Fulton
129ef8ea8f Correct docs and examples to call SWIG_fail after setting a Python error
Although 'return NULL' works, it may miss out on some cleanup and NULL
is the wrong value to return in generated code for overloaded functions.
2016-10-23 20:16:35 +01:00
William S Fulton
08688d7d9d Add support for "ret" typemap where missing and improve documentation on it. 2016-09-29 08:07:26 +01:00
William S Fulton
9ceee4ba87 Correct documentation link for Typemap delimiters 2016-05-05 21:12:54 +01:00
William S Fulton
355f2623c7 Improve documentation for multi-argument typemaps and overloading 2016-04-02 13:44:44 +01:00
William S Fulton
3763beb489 Replace tabs with spaces in html docs
wkhtmltopdf is not expanding tabs within <pre> elements to 8 spaces as it
should. Workaround the problem by converting all tabs to an appropriate
number of spaces.
2015-12-30 22:22:33 +00:00
William S Fulton
925b2a336f HTML fixes for documentation - add meta tag and loose.dtd 2015-12-30 22:22:32 +00:00
William S Fulton
cacb36bedb Docs - remove html tags from headings 2015-12-30 22:22:32 +00:00
William S Fulton
8288ac15a0 Correct links in html documentation using new version of makechap.py
Corrects position of heading text within A and H1, H2, ... elements.
2015-12-30 22:22:32 +00:00
William S Fulton
862b4c6138 Add a linkchecker target for checking broken links in SWIGDocumentation.html 2015-12-18 21:14:39 +00:00
William S Fulton
9c23981992 HTML fix in docs 2015-08-02 19:47:02 +01:00
William S Fulton
f482adc6d1 Add documentation and CHANGES for special variables and typemap attributes.
Also add info about special variable expansions in special variable
macros.
2015-07-22 23:28:26 +01:00
William S Fulton
55e7264d43 Clearer warning message for badly constructed typecheck typemaps 2015-04-14 07:34:40 +01:00
William S Fulton
073bb244e4 Add docs about missing precedence levels for typecheck typemaps 2015-04-13 20:36:12 +01:00
William S Fulton
427c5112e7 Add more docs about _global_ prefix in typemap temporary variables 2014-12-06 21:49:42 +00:00
Alexey Neyman
1509d6c9e0 Add clarification on _global_ prefix. 2014-12-06 21:38:58 +00:00
Olly Betts
f541e604e8 Consistently put whitespace outside of <tt>...</tt> and not inside 2014-11-18 12:44:37 +13:00
William S Fulton
785d93d9fb html fixes and section updates 2014-03-15 22:45:43 +00:00
Olly Betts
c6e4dea572 Fix a few typos in comments and docs 2013-12-12 11:45:30 +13:00
Geert Janssens
b819d2a91e Drop guilegh interface
All of guile's interface files now use the scm interface.
This should not affect any users. Swig generated code
using the scm interface can be mixed with gh interface
using user code.
It does simplify maintenance of the guile swig code though.
2013-04-28 22:06:24 +02:00