Commit graph

18,578 commits

Author SHA1 Message Date
Olly Betts
b06ec2c847 Fix typo in method description 2015-05-10 01:23:09 +12:00
Olly Betts
d1a8675ac4 Fix incorrect comments 2015-05-09 21:59:03 +12:00
Olly Betts
083a03710a Remove no-op calls to swig_incref().
Python and Perl were calling this from the Director constructor, but
swig_disown_flag is always false at that point, so the call doesn't
do anything.
2015-05-09 18:34:11 +12:00
Ian Lance Taylor
51541d7808 Merge pull request #414 from michael-schaller/go-doc-cpp-mem
[Go] Improved Go Class Memory Management section of the Go documentation.
2015-05-08 07:11:36 -07:00
Michael Schaller
255715d9ad [Go] Improved Go Class Memory Management section of the Go documentation.
Fixes #289.
2015-05-08 14:32:22 +02:00
Olly Betts
9086eb351c Merge pull request #413 from LindleyF/master
Don't include an STL header in SWIG.
2015-05-08 11:57:13 +12:00
Lindley French
8f19d77fec Don't include an STL header in SWIG. 2015-05-07 11:29:47 -07:00
Olly Betts
c2972b8bf0 [Python] Deal with an integer as the default value of a bool
parameter in the C++ prototype.  Fixes github #327, reported by
Greg Allen.
2015-05-07 16:25:32 +12:00
Olly Betts
c2a13b9b7b Add entry for #403 2015-05-07 13:29:03 +12:00
Olly Betts
8fc7796643 Merge pull request #403 from LindleyF/master
Zero-initialize swig_override in the director constructor.
2015-05-07 13:26:04 +12:00
Lindley French
159b3c7958 Use a bitset which is automatically initialized to 0, instead of a bool array which is not. 2015-05-06 11:33:28 -07:00
Olly Betts
b19d506db7 Suppress warning 325 "Nested class not currently supported (Foo
ignored)" when Foo has already been explicitly ignored with
"%ignore".
2015-05-05 18:07:49 +12:00
William S Fulton
428b6176df Add support for friend templates, including operator overloading.
Closes #196.
2015-05-05 06:48:25 +01:00
Ian Lance Taylor
e044dc4405 [Go] Fix Go multimap example to use Swig_AllocateString and swigCopyString. 2015-05-04 17:16:44 -07:00
Lindley French
3ce7867a0a Added missing untracked files. 2015-05-04 15:27:51 -07:00
Lindley French
bd0fa56705 Added director_ref test. 2015-05-04 15:22:14 -07:00
Ian Lance Taylor
48263f4802 [Go] Make sure that arguments for which use memcpy when calling C are
still live after the call.  This ensures that they will not be
collected if the GC runs during the call.
2015-05-04 15:11:31 -07:00
William S Fulton
140782054a Fix unresolved symbols in testcase 2015-05-02 00:25:15 +01:00
Lindley French
5f0181bfdd Too hard to conditionally define the memset....instead just make sure the array is defined even if it's unused. 2015-05-01 12:40:07 -07:00
William S Fulton
463b2a324c Cosmetic rename COPERATOR to CONVERSIONOPERATOR
Was never very obvious what C in COPERATOR was.
2015-05-01 19:26:09 +01:00
William S Fulton
cf29b90a2b Fix comments and newlines within operator definitions
Fix handling of conversion operators where the operator is split over multiple lines or
has comments within the operator type.

Also fix similar problem with normal operators which gave a syntax error if split over
multiple lines or had a comment within the operator declaration.

Closes #401
2015-05-01 19:22:38 +01:00
Olly Betts
0fad8a3728 '#undef seed' macro which Perl API headers define
This macro breaks '#include <algorithm>', causing generated Perl
bindings to fail to compile with 'g++ -std=gnu++11'.
2015-05-02 00:06:58 +12:00
Lindley French
e8ca8fb2e6 Only output memset if the array exists. 2015-04-30 23:14:48 -07:00
Lindley French
8acca78953 Zero-initialize swig_override in the director constructor. 2015-04-30 21:16:30 -07:00
Olly Betts
50ba1ea6fa Adjust testcase for unknown directive error
Fixes testcase failure caused by fix for issue #394.
2015-04-30 15:27:12 +12:00
Olly Betts
d26a505dad Ignore unknown preprocessor directives which are inside an inactive
conditional (github issue #394, reported by Dan Wilcox).
Regression introduced in 3.0.3.
2015-04-30 13:40:42 +12:00
Alexander Warg
ece1009c5d lua: push integer constants as integer
This allows better compatibility with Lua 5.3. Otherwise function
overloading assuming integer parameters might not work.
2015-04-28 17:09:57 +02:00
Vadim Zeitlin
6988b00aba Fix handling of default arguments after ignored ones in Python.
Don't skip checking subsequent arguments just because one of them has "in"
typemap with numinputs=0 attribute.

Add a unit test showing the problem which is relatively rare as it doesn't
happen for the class methods and is hidden unless autodoc feature is used for
the global functions.

Closes #377.
2015-04-27 23:17:14 +02:00
William S Fulton
d64c241e1c gcc-5.1 warning fixes 2015-04-26 01:18:26 +01:00
William S Fulton
605b95d706 Merge branch 'yazug-ignore_generated_example_files'
* yazug-ignore_generated_example_files:
  Guile gitignore and consistent naming in examples
  Add language specific files to gitignore
  gitignore for python
  Add generated director header files to .ignore
  fix typo of Perl in .gitignore
  Add some generated example files to the .gitignore list
2015-04-26 00:23:24 +01:00
William S Fulton
d7f37f3974 Guile gitignore and consistent naming in examples
Use my-guile for the executable for all the augmented examples
Fix gitignore for Guile
2015-04-26 00:17:42 +01:00
William S Fulton
3f8034395b Add language specific files to gitignore 2015-04-25 23:57:50 +01:00
William S Fulton
f8e4b1beb5 gitignore for python 2015-04-25 21:09:16 +01:00
William S Fulton
a0fe65839c Add generated director header files to .ignore 2015-04-25 18:38:15 +01:00
William S Fulton
4b69bdadd4 Add Python Travis tests for -O 2015-04-24 21:11:09 +01:00
William S Fulton
416277b3a5 Python code generated with '-builtin -modernargs' segfaults for any method taking zero arguments.
Also fixes: "SystemError: error return without exception set" during error checking
when using just -builtin and the incorrect number of arguments is passed to a class
method expecting zero arguments.

Closes #256
Closes #382
2015-04-24 21:08:17 +01:00
Jon Schlueter
57f715e2b1 fix typo of Perl in .gitignore 2015-04-24 11:59:44 -04:00
William S Fulton
e4d02d20ad Warning fix for VC++ 2015-04-23 19:21:59 +01:00
William S Fulton
ea1b6e8ed5 Memory leak in java directors when passing byte arrays (char*, size_t)
When passing a byte array from c++ to Java using the director feature, the generated jni code does not release a temporary byte array.

This is the typemap specified in Java.swg:

    %typemap(directorin, descriptor="[B") (char *STRING, size_t LENGTH) {
    jbyteArray jb = (jenv)->NewByteArray($2);
    (jenv)->SetByteArrayRegion(jb, 0, $2, (jbyte *)$1);
    $input = jb;
    }

    %typemap(directorargout) (char *STRING, size_t LENGTH)
    %{(jenv)->GetByteArrayRegion($input, 0, $2, (jbyte *)$1); %}

Notice that the call to NewByteArray doesn't contain a symmetric release logic as the SetByteArrayRegion/GetByteArrayRegion does.

Closes #386
2015-04-23 19:17:35 +01:00
Jon Schlueter
d4a06d75a3 Add some generated example files to the .gitignore list 2015-04-23 12:24:53 -04:00
Vadim Zeitlin
5569d91bd0 Fix handling of "default" typemap in Python.
Use "compact" arguments form for the function if "default" typemap is defined
for any of its arguments to allow omitting this argument when calling it from
Python.

Closes #377.
2015-04-23 15:11:05 +02:00
Vadim Zeitlin
2369e2c500 No changes, just added an explanatory comment to Python module.
Explain a bit better when and why do we decide to use "*args" in the generated
Python code.
2015-04-23 15:11:02 +02:00
Vadim Zeitlin
0eae8a8efa Fix handling of NULL default argument values for pointer types.
Accept not only manifest pointer types (such as e.g. "void *") but also types
that are typedefs for pointer types when checking whether C++ value of 0 must
be represented as 0 or None in Python.

Closes #365, #376.
2015-04-23 15:11:02 +02:00
William S Fulton
3394eab52e Fix 'make check-ccache' when one of the CCACHE_ environment variables is set.
Note that CCACHE_DISABLE is now set in the Travis environment.
2015-04-23 08:20:13 +01:00
Vadim Zeitlin
84e9cc6570 Mark the not-always-using-args in Python change as incompatible.
Some existing typemaps actually rely on "*args" being always used, so document
the change fixing the bug which resulted in their use as being potentially
incompatible and point to a way to restore the previous behaviour.
2015-04-22 23:45:30 +02:00
Ian Lance Taylor
661c4ba036 [Go] Add comments telling users that _swig_goallocate and
_swig_makegostring will no longer work in the Go 1.5 release.
Keep the existing code so that existing users with current versions of
Go will not break suddenly.
2015-04-17 09:44:40 -07:00
Olly Betts
6207b8bfa3 Move testflags.py into Tools/ 2015-04-16 10:55:34 +12:00
William S Fulton
7178bb11d3 Expand __declspec documentation 2015-04-14 08:13:13 +01:00
Chris Krycho
aebc9379ed Document %include behavior for __declspec preprocessor directives.
Add a short paragraph and example of how to handle the way Microsoft
recommends to wrap `__declspec` definitions in preprocessor macros and
supply them in a common header file.
2015-04-14 07:44:49 +01:00
William S Fulton
55e7264d43 Clearer warning message for badly constructed typecheck typemaps 2015-04-14 07:34:40 +01:00