Commit graph

16,289 commits

Author SHA1 Message Date
William S Fulton
d1bb451eab Merge branch 'perl5-directors-minimal' of https://github.com/talby-/swig into talby--perl5-directors-minimal
* 'perl5-directors-minimal' of https://github.com/talby-/swig:
  try adding travis ci to this branch
  ran "beautify-file" make target over perl5.cxx patch hunks and rewrote callback and extend examples in the style of existing examples
  prefer polymorphism on existing destructor over custom destructor method
  fix string mangled by tidy
  eliminate dead director code and convert remaining blocks
  mitigate ConvertPtr director cost when directors are not enabled
  steals python director docs and adapts to perl5
  adds "callback" and "extend" examples
  don't forget the most important part
  steals python directors and adapts to perl5
2013-12-23 07:30:37 +00:00
William S Fulton
92128eef44 C++11 support for new versions of erase and insert in the STL containers.
The erase and insert methods in the containers use const_iterator instead
of iterator in C++11.  There are times when the methods wrapped must match
the parameters exactly. Specifically when full type information for
template types is missing or SWIG fails to look up the type correctly,
for example:

  %include <std_vector.i>
  typedef float Real;
  %template(RealVector) std::vector<Real>;

SWIG does not find std::vector<Real>::iterator because %template using
typedefs does not always work and so SWIG doesn't know if the type is
copyable and so uses SwigValueWrapper<iterator> which does
not support conversion to another type (const_iterator). This resulted
in compilation errors when using the C++11 version of the containers.

Closes #73
2013-12-22 19:52:55 +00:00
William S Fulton
cf92954bc0 C++11 tests re-organise - gcc-4.8 minimum expected for all to pass 2013-12-22 19:38:46 +00:00
William S Fulton
6250c288b5 Suppress gcc-4.9 auto_ptr deprecation in test 2013-12-22 17:49:16 +00:00
William S Fulton
32ad89668a Use RUNME consistently in examples makefile 2013-12-20 18:52:19 +00:00
Ian Lance Taylor
01ebdc0995 In Examples/Makefile.in, compile and link the program in go and
go_cpp, rather than in go_run.  This permits eliminating go_run_cpp.
2013-12-20 08:14:45 -08:00
William S Fulton
82990df573 Error test-suite updated for nested changes
WARN_DEPRECATED_NESTED_WORKAROUND test added
WARN_PARSE_NAMED_NESTED_CLASS test removed
2013-12-19 18:23:28 +00:00
William S Fulton
257a9865e9 Make save_value non-copyable 2013-12-19 18:12:19 +00:00
Vladimir Kalinin
b4fef06c42 fixed %template within %extend, test added
fixed language symbol table nested classes name separator, test added
fixed %feature "flatnested" working with %extend
fixed Swig_offset_string for empty string
added simple template to save/restore values in current scope (readability reasons)
2013-12-19 02:11:22 +04:00
Ian Lance Taylor
8dba8b1fde Go: Don't require that Go environment variables be set when running
examples or testsuite.
2013-12-18 11:03:39 -08:00
Ian Lance Taylor
ba049db40b Remove Go -longsize option. 2013-12-17 17:37:55 -08:00
Ian Lance Taylor
532da6989c [Go] Add -go-pkgpath option. 2013-12-17 13:50:39 -08:00
Vladimir Kalinin
25689857eb Language::addSymbol fix, to handle classes correctly 2013-12-17 12:14:33 +04:00
Ian Lance Taylor
1dca0af024 Update for Go 1.2 release. Add support for linking SWIG code directly
into executable, rather than using a shared library.
2013-12-16 19:50:17 -08:00
William S Fulton
39bf2efdc9 Revert template_nested_typemaps to what it was before nested merge
The breaks were fixed in the last couple of commits
2013-12-16 19:28:11 +00:00
Vladimir Kalinin
5487345ce7 properly disabled nested %template declared in other scopes 2013-12-16 13:08:34 +04:00
Vladimir Kalinin
865408874f fixed %template declared within class, next to template declaration
added a few tests for C# nested classes support
2013-12-16 11:43:28 +04:00
Geert Janssens
0cf116128b Skip unsigned (long) long integer tests on OS X with guile 1.8 2013-12-14 23:36:35 +00:00
William S Fulton
a1c17d585d Fix R unions seg fault
Started seg faulting since nested branch merge
2013-12-14 22:35:02 +00:00
William S Fulton
66ebb2a7cb Remove nested branch from Travis builds 2013-12-14 15:13:59 +00:00
William S Fulton
314fae460b Merge branch 'nested' - nested structs/classes support
* nested:
  Deprecation of the 'nestedworkaround' feature
  Ensure -c++out is not used with -c++
  Add missing header to new source file
  Nested C class setters restored in c++out mode for Octave
  Classprefix fixed after private nested classes some comments and spaces added
  Fix template partial specialization detection
  Minor tweaks in Swig_feature_set
  Swig_offset_string moved to misc.c
  nested private classes are discarded while parsing nested relate functions are moved to nested.cxx and renamed accordingly
  out-of-scope template definitions fixed nested_private test disabled again
  fixed out-of-scope nested class definitions, added a test enabled nested C structs assignment (still disabled for Octave), added Java runtime test fixed nested_private test case for Java & C#
  Testcase of private nested class usage causing segfault
  C nested struct passed by value example
  Add in Travis testing for nested branch
  Add C++ nested class example
  Minor code improvements
  Cosmetics/code beautification of nested class support
  Nested classes support
2013-12-14 15:12:07 +00:00
Ian Lance Taylor
4cf5de797f Add comment with SWIG file name in files generated for Go. 2013-12-13 11:56:31 -08:00
William S Fulton
0f4ceaf592 Deprecation of the 'nestedworkaround' feature
Also add in macros for the flatnested feature which can be used in place
of the nestedworkaround feature
2013-12-13 08:11:17 +00:00
William S Fulton
fb103f8db4 Minor expansion of nested C structs testing 2013-12-12 21:23:49 +00:00
William S Fulton
c256dd140b Add check-c and check-cpp targets for running just C and C++ test cases 2013-12-12 20:58:10 +00:00
William S Fulton
2121e1217e Ensure -c++out is not used with -c++
Error checking for this combination implemented as well as correcting
Octave

Also refactor, replacing CPlusPlusOut variable with cparse_cplusplusout
for an implementation which more closely resembles cparse_cplusplus which
is also required in both .c and .cxx files.
2013-12-12 20:52:44 +00:00
William S Fulton
3b4d331310 Add missing header to new source file 2013-12-12 09:00:23 +00:00
William S Fulton
e95ac82651 Nested C class setters restored in c++out mode for Octave
Suitable casts are required so that assignment of instances of nested classes
work as the nested class is duplicated in the global namespace, eg:

struct Outer {
  struct Nested {
    int bar;
  } bar_instance;
};

Outer.bar_instance can now be assigned to.
2013-12-12 09:00:16 +00:00
Olly Betts
dcc4096f8c Add CHANGES.current entry for previous commit 2013-12-12 17:00:26 +13:00
jleveque
c7ef593549 Bug fix (typo - "wchar" instead of "wchar_t") 2013-12-12 16:53:23 +13:00
Olly Betts
bef3cfe594 Add CHANGES.current entry and minimal doc update for previous change 2013-12-12 16:06:00 +13:00
Miklos Vajna
227192f80a Fix Examples/php/pointer to work with PHP 5.5
With this, all examples work with PHP 5.5 for me.
2013-12-12 15:52:51 +13:00
jleveque
8be8b62d83 Fix compile warning on Linux 2013-12-12 15:50:10 +13:00
Michael Bunk
abeba45644 Fix typos 2013-12-12 15:46:33 +13:00
Olly Betts
cecd89f66f [PHP] The usage of $input in PHP directorout typemaps has been
changed to be consistent with other languages.  The typemaps
provided by SWIG have been updated accordingly, but if you
have written your own directorout typemaps, you'll need to
update $input to &$input (or make equivalent changes).

*** POTENTIAL INCOMPATIBILITY  ***
2013-12-12 15:40:15 +13:00
Olly Betts
c6e4dea572 Fix a few typos in comments and docs 2013-12-12 11:45:30 +13:00
William S Fulton
2d0dc707e6 More control on output from top level Makefile
Move the '-k -s' flags to a new FLAGS variable which can then be overridden
on the command line.
2013-12-08 19:48:39 +00:00
Vladimir Kalinin
cf3696e8f9 Merge branch 'nested' of https://github.com/swig/swig into nested 2013-12-08 01:47:01 +04:00
Vladimir Kalinin
44323e14b3 Classprefix fixed after private nested classes
some comments and spaces added
2013-12-08 01:46:38 +04:00
William S Fulton
67848e377a Fix template partial specialization detection
Fixes template definitions that should be ignored and warnings introduced after nested changes:
../../../Examples/test-suite/refcount.i:63: Warning 318: Instantiation of template 'RCPtr< A >' is ambiguous,
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' used,
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' ignored.
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' ignored.
../../../Examples/test-suite/refcount.h:159: Warning 318: instantiation 'RCPtr< T >::RCPtr' ignored.

Different/clearer implementation of constructor detection since Classprefix is
not behaving the same since nested changes were introduced. Only accept
constructors if in extend mode or in a class.

Also remove unused "isextension" attribute on the nodes.
2013-12-07 16:22:44 +00:00
William S Fulton
6d97335d94 Minor tweaks in Swig_feature_set 2013-12-05 21:21:07 +00:00
William S Fulton
7103a06849 Swig_offset_string moved to misc.c 2013-12-05 20:59:09 +00:00
Vladimir Kalinin
b0afa8a95c nested private classes are discarded while parsing
nested relate functions are moved to nested.cxx and renamed accordingly
2013-12-05 20:41:22 +04:00
Vladimir Kalinin
053c605df0 out-of-scope template definitions fixed
nested_private test disabled again
2013-12-04 16:21:33 +04:00
William S Fulton
5504bd3201 decltype fix on missing type info 2013-12-04 00:24:40 +00:00
William S Fulton
b175df4e5f C++11 alias templates seg fault fix
Segfault fix when using alias templates, reported by Pierre-Henri Wuillemin
2013-12-03 23:38:54 +00:00
Vadim Zeitlin
6624f66af5 Just a correction to the last commit changelog entry.
Mention the target languages affected.
2013-12-03 23:46:13 +01:00
Vadim Zeitlin
ed28725a15 Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
These typemaps are currently defined for C#, Java and Python only and the
tests are provided only for these languages.

Also add a brief description of the new header to the documentation.
2013-12-03 23:45:20 +01:00
Vladimir Kalinin
e1a4e11bea fixed out-of-scope nested class definitions, added a test
enabled nested C structs assignment (still disabled for Octave), added Java runtime test
fixed nested_private test case for Java & C#
2013-12-04 01:53:42 +04:00
William S Fulton
9d3fc0069c Add a few more types for the code beautifier 2013-12-02 08:37:09 +00:00