Commit graph

3,818 commits

Author SHA1 Message Date
William S Fulton
a006091b0f Add in a definition for RTYPEDDATA_P for Ruby<1.9.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.
2019-02-22 19:55:55 +00:00
Takashi Tamura
ff9e9f9f98 [ruby] check whether object is of RTypedData using RTYPEDDATA_P. 2019-02-22 19:55:54 +00:00
William S Fulton
6d8c1c47f3 Merge branch 'java9_finalize_warnings'
* java9_finalize_warnings:
  [Java] Suppress deprecation warning on finalize method
2019-02-21 13:46:59 -08:00
William S Fulton
2786bf37a1 Fix multiple definitions of swig::container_owner_attribute 2019-02-21 17:57:11 +00:00
William S Fulton
32b963ef1c Re-organise Python method creation and docstring functions declarations
Fix ‘PyMethodDef* SWIG_PythonGetProxyDoc(const char*)’ declared ‘static’ but
never defined [-Wunused-function]

Closes #1448 (again)
2019-02-19 22:54:08 +00:00
William S Fulton
f19882ed51
Merge pull request #1473 from ZackerySpytz/OCaml-wrapmacro-test
[OCaml] Fix the wrapmacro test
2019-02-18 19:33:22 +00:00
William S Fulton
911bc5310f
Merge pull request #1472 from ZackerySpytz/OCaml-SWIGTYPE-typecheck
[OCaml] Add a typecheck typemap for SWIGTYPE
2019-02-18 19:31:50 +00:00
William S Fulton
a628bf9b6f Python std::vector back-reference changes
Give reference in container_owner a more unique name (back_reference).
Change back-reference 'ret' typemap to have a function name so that they
are less unwittingly be used elsewhere where not intended.

Note that they can be overridden by users if needed using:

%extend std::vector {
%typemap(ret)
  value_type const& __getitem__,
  value_type const& front,
  value_type const& back
  { ...  }
}

These override the SWIG supplied versions because the SWIG supplied
typemaps use non-const value_type&, but the methods use const, so the
above have a higher precedence in the typemap search algorithm.
2019-02-18 18:50:22 +00:00
William S Fulton
b634905b65 Merge branch 'jakecobb-python-container-memory'
* jakecobb-python-container-memory:
  Better name for container back-reference attribute
  Python - Struct spec. for container owner
  Python: Avoid container owner check for value types
  Python: Init container owner attribute in thread-safe way
  Python: Use PyObject_SetAttr instead of PyObject_GenericSetAttr for back-ref
  Python: Cleanup container back ref
  Python: Keep reference to owning container during element access
2019-02-18 07:11:19 +00:00
Zackery Spytz
10d62aecd5 [OCaml] Fix the wrapmacro test
Add a typecheck typemap for size_t and const size_t &.

Add the const qualifier to the typemaps for primitive reference
types.

Add multiple runtime tests.
2019-02-17 01:41:59 -07:00
Zackery Spytz
b7a400f991 [OCaml] Add a typecheck typemap for SWIGTYPE
This fixes many of the remaining warnings in the OCaml test suite.

Add multiple runtime tests.
2019-02-16 01:07:31 -07:00
William S Fulton
62417708fd Better name for container back-reference attribute
Mangle name with swig so as not to clash with any attribute names a
user might use.
Remove Doxygen style comments - we don't use Doxygen in SWIG.
2019-02-15 22:01:38 +00:00
William S Fulton
1f4b3a4553
Merge pull request #1470 from ZackerySpytz/OCaml-dynamic_cast-test
[OCaml] Fix the dynamic_cast test
2019-02-15 19:10:15 +00:00
William S Fulton
dd8c3e1466
Merge pull request #1461 from ZackerySpytz/OCaml-argout-typemaps-ref-types
[OCaml] Don't use argout typemaps by default for some reference types
2019-02-15 19:06:05 +00:00
William S Fulton
52063a732b Consistent parameter names for std::pair 2019-02-14 22:44:27 +00:00
William S Fulton
a6a50d60e1 Restore original std::map template parameters for Java 2019-02-14 21:41:08 +00:00
William S Fulton
6d27ead9c0 Add STL container copy constructors where missing
Also provide consistent copy constructor declarations.
2019-02-14 18:53:05 +00:00
Zackery Spytz
a159a252dd [OCaml] Fix the dynamic_cast test
Add out typemaps for SWIGTYPE *DYNAMIC and SWIGTYPE &DYNAMIC.

Add dynamic_cast_runme.ml.
2019-02-14 02:21:36 -07:00
William S Fulton
dc34c39c53 Cosmetic STL typedef changes 2019-02-14 08:16:16 +00:00
William S Fulton
40d7f4137e typedef declaration corrections for std::array 2019-02-14 07:38:49 +00:00
William S Fulton
440264e479 Add missing typedefs to std::list + typedef corrections
Numerous missing typedefs added.
std::list<T*>::const_reference and std::list<T*>::reference
specialization typedef fixes.
2019-02-14 07:31:21 +00:00
William S Fulton
e26f6bb4e2 Add missing typedefs to std::vector + typedef corrections
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.
2019-02-13 22:46:28 +00:00
William S Fulton
a47c2553f5 Add missing typedefs to std::pair 2019-02-13 22:46:28 +00:00
William S Fulton
9dd33e6367 Add missing typedefs to std::map 2019-02-13 22:46:27 +00:00
William S Fulton
6d0c495fd0 Add missing parameter names in STL container wrappers
Mostly in STL copy constructors.

Best to have parameter names as they make their way into the wrappers in
some target languages.
2019-02-13 22:45:47 +00:00
William S Fulton
8c207dd3a9 Merge branch 'master' of git+ssh://github.com/swig/swig
* 'master' of git+ssh://github.com/swig/swig:
  [Python] Fix some errors in the documentation for -threads
  Fixed typo in Perl5 docs.
  Update PHP testsuite for vadz's new cars
  [php] Whitespace improvements in generated C/C++ code
  Fix hardcoded _v in PHP typecheck typemaps
2019-02-12 18:53:46 +00:00
William S Fulton
68e86614ff Create a consistent stl.i library file
Same file now for all languages except R which is still missing std_map.i.
Recent Java changes adding in std_set.i removed.
2019-02-12 18:46:05 +00:00
William S Fulton
136e6cfe2b Merge branch 'bkotzz-add_set_map'
* bkotzz-add_set_map:
  Add missing typedefs to Java STL containers
  Combine duplicate unordered_set unordered_map testcases
  Nicer looking generated Java container code
  Replicate some cosmetic changes from std_map.i
  Legacy macros, protected iterator, typedefs
  Remove c++11 from stl.i
  Add to STL file as well
  Maps both working as java.util impls
  Mostly working for map
  Add set/unordered_set that extend AbstractSet
  Move unordered containers under cpp11_ prefix
  Add test cases to C++11 list
  Add unordered_{set|map} and set to Java
2019-02-12 18:09:38 +00:00
William S Fulton
e83e14a15e Add missing typedefs to Java STL containers 2019-02-12 07:15:51 +00:00
William S Fulton
9849174d93 Nicer looking generated Java container code 2019-02-12 06:20:19 +00:00
William S Fulton
437037a3e6 Replicate some cosmetic changes from std_map.i
into std_set.i, std_unordered_map.i, std_unordered_set.i.
2019-02-12 06:20:10 +00:00
Olly Betts
950473d77e [php] Whitespace improvements in generated C/C++ code 2019-02-12 10:14:25 +13:00
Olly Betts
3499675cb0 Fix hardcoded _v in PHP typecheck typemaps
This should be $1, which ends up substituted with _v so this does
not actually affect behaviour.
2019-02-12 09:29:41 +13:00
William S Fulton
43438b66ab Re-organise some generate Python code for method creation and docstring support
Fix ‘PyMethodDef* SWIG_PythonGetProxyDoc(const char*)’ declared ‘static’ but
never defined [-Wunused-function]

Closes #1448
2019-02-10 22:55:16 +00:00
Olly Betts
a0720885bd Remove PHP-specific avoidance of uninitialised variable
This code is no longer needed since
ebd37155a8 addressed this more
generically.
2019-02-11 10:49:20 +13:00
Olly Betts
60eccff4b7 [php] Fix typemap indentation (cosmetic) 2019-02-11 10:49:20 +13:00
Zackery Spytz
b2d93665fe [OCaml] Don't use argout typemaps by default for some reference types
The OCaml module's typemaps.i supplied argout typemaps for some
reference types (e.g. int &) by default, which was unintuitive and
inconsistent when compared with other modules. The argout_ref example
depended on this, so add a typemap to argout_ref/example.i.

Add multiple runtime tests that deal with references.
2019-02-09 22:04:46 -07:00
William S Fulton
6ec798f7ff Merge branch 'ZackerySpytz-OCaml-exception-improvements'
* ZackerySpytz-OCaml-exception-improvements:
  [OCaml] Some exception improvements
2019-02-09 22:35:48 +00:00
William S Fulton
d7bb500315 Merge branch 'ZackerySpytz-OCaml-director-ctors'
* ZackerySpytz-OCaml-director-ctors:
  [OCaml] Fix a bug in the ctors of director classes
2019-02-09 22:28:10 +00:00
William S Fulton
b80b4d5638 Merge branch 'ZackerySpytz-OCaml-director_pass_by_value'
* ZackerySpytz-OCaml-director_pass_by_value:
  [OCaml] Fix director_pass_by_value
  [OCaml] Reduce the duplication in typemaps.i
2019-02-09 22:25:29 +00:00
William S Fulton
d595a7a9ed Merge branch 'ZackerySpytz-OCaml-cache-caml_named_value'
* ZackerySpytz-OCaml-cache-caml_named_value:
  [OCaml] Cache the result of caml_named_value() in some cases
2019-02-09 22:14:10 +00:00
Olly Betts
ab754b0c65 [PHP] Fix access to already released memory
Fix access to already released memory during PHP module  shutdown, which
often didn't cause visible problems, but could result in segmentation
faults, bus errors, etc.  Fixes #1170, reported by Jitka Plesníková.
2019-02-09 17:08:21 +13:00
Olly Betts
ce1936eb5b [php] Fix SWIG_ZEND_CONSTANT_SET_FLAGS for PHP < 7.3 2019-02-08 16:58:22 +13:00
Olly Betts
89c6c01c40 [php] Fix function constants for PHP 7.3
The code we were generating no longer compiled.
2019-02-08 14:58:01 +13:00
Zackery Spytz
e5b8b5a164 [OCaml] Some exception improvements
The OCaml module's exception handling code was poorly designed,
gave confusing exception messages, and was vulnerable to buffer
overflows.

The OCaml module's SWIG_exception_() was adding a useless newline to
the end of the exception message.

In some cases, the integer value of f.e. SWIG_TypeError was being added
to the exception message.

The unneeded else in the OCaml module's SWIG_contract_assert() macro
was causing -Wmisleading-indentation warnings.

The OCaml module's exception handling code now mirrors that of the
Java module.

Add Lib/ocaml/std_except.i.
Add multiple runtime tests.
2019-02-07 16:25:10 -07:00
Zackery Spytz
828ce477c8 [OCaml] Fix a bug in the ctors of director classes
If a class was given the director feature, it was not possible
to use ctors with multiple parameters.

Add director_default_runme.ml (it is based on
director_default_runme.java).
2019-02-05 13:35:43 -07:00
William S Fulton
09e0577d95 Disable Chicken target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:42:12 +00:00
William S Fulton
8aa4086136 Disable Pike target language
Clean up to disable target languages that have been neglected/not functional.
Target language be fully deleted in SWIG 4.1 unless a new maintainer brings
it up to an acceptable status (experimental or supported).

Issue #1447
2019-02-05 18:41:46 +00:00
Brad Kotsopoulos
d06ffe1087 Legacy macros, protected iterator, typedefs 2019-02-04 22:23:13 -05:00
Jake Cobb
30f16b9138 Python - Struct spec. for container owner
Use a struct with specialization to dispatch the container
owner reference function instead of a function.  Avoids
possible future problems if overloading were introduced.
2019-02-04 13:48:52 -05:00