-
Notifications
You must be signed in to change notification settings - Fork 0
/
CHANGES
24056 lines (18103 loc) · 931 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
SWIG (Simplified Wrapper and Interface Generator)
See the CHANGES.current file for changes in the current version.
See the RELEASENOTES file for a summary of changes in each release.
Version 3.0.7 (3 Aug 2015)
==========================
2015-08-02: wsfulton
[Java] Fix potential security exploit in generated Java classes.
The swigCPtr and swigCMemOwn member variables in the generated Java
classes are now declared 'transient' by default. Further details of the exploit
in Android is being published in an academic paper as part of USENIX WOOT '15:
https://www.usenix.org/conference/woot15/workshop-program/presentation/peles.
In the unlikely event that you are relying on these members being serializable,
then you will need to override the default javabody and javabody_derived typemaps
to generate the old generated code. The relevant typemaps are in the Lib directory
in the java.swg, boost_shared_ptr.i and boost_intrusive_ptr.i files. Copy the
relevant default typemaps into your interface file and remove the 'transient' keyword.
*** POTENTIAL INCOMPATIBILITY ***
2015-08-01: vadz
Make configure --without-alllang option more useful: it can now be overridden by the following
--with-xxx options, allowing to easily enable just one or two languages.
2015-07-30: wsfulton
Fix #440 - Initialise all newly created arrays when using %array_functions and %array_class
in the carrays.i library - bug is only relevant when using C++.
2015-07-29: wsfulton
[Python] Improve indentation warning and error messages for code in the following directives:
%pythonprepend
%pythonappend
%pythoncode
%pythonbegin
%feature("shadow")
Old error example:
Error: Line indented less than expected (line 3 of pythoncode)
New error example:
Error: Line indented less than expected (line 3 of %pythoncode or %insert("python") block)
as no line should be indented less than the indentation in line 1
Old warning example:
Warning 740: Whitespace prefix doesn't match (line 2 of %pythoncode or %insert("python") block)
New warning example:
Warning 740: Whitespace indentation is inconsistent compared to earlier lines (line 3 of
%pythoncode or %insert("python") block)
2015-07-28: wsfulton
[Python] Fix #475. Improve docstring indentation handling.
SWIG-3.0.5 and earlier sometimes truncated text provided in the docstring feature.
This occurred when the indentation (whitespace) in the docstring was less in the
second or later lines when compared to the first line.
SWIG-3.0.6 gave a 'Line indented less than expected' error instead of truncating
the docstring text.
Now the indentation for the 'docstring' feature is smarter and is appropriately
adjusted so that no truncation occurs.
2015-07-22: wsfulton
Support for special variable expansion in typemap attributes. Example usage expansion
in the 'out' attribute (C# specific):
%typemap(ctype, out="$*1_ltype") unsigned int& "$*1_ltype"
is equivalent to the following as $*1_ltype expands to 'unsigned int':
%typemap(ctype, out="unsigned int") unsigned int& "unsigned int"
Special variables can be used within special variable macros too. Example usage expansion:
%typemap(cstype) unsigned int "uint"
%typemap(cstype, out="$typemap(cstype, $*1_ltype)") unsigned int& "$typemap(cstype, $*1_ltype)"
Special variables are expanded first and hence the above is equivalent to:
%typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"
which then expands to:
%typemap(cstype, out="uint") unsigned int& "uint"
2015-07-22: lindleyf
Apply patch #439 - support for $typemap() (aka embedded typemaps or special variable
macros) in typemap attributes. A simple example where $typemap() is expanded in the
'out' attribute (C# specific):
%typemap(cstype) unsigned int "uint"
%typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"
is equivalent to:
%typemap(cstype, out="uint") unsigned int& "uint"
2015-07-18: m7thon
[Python] Docstrings provided via %feature("docstring") are now quoted and added to
the tp_doc slot when using python builtin classes (-builtin). When no docstring is
provided, the tp_doc slot is set to the fully qualified C/C++ class name.
Github issues #445 and #461.
2015-07-17: kwwette
[octave] Support Octave version 4.0.0 (thanks to patches from Orion Poplawski).
2015-07-07: wsfulton
SWIG no longer generates a wrapper for a class' constructor if that class has
any base class with a private destructor. This is because your compiler should
not allow a class to be instantiated if a base has a private destructor. Some
compilers do, so if you need the old behaviour, use the "notabstract" feature, eg:
%feature("notabstract") Derived;
class Base {
~Base() {}
};
struct Derived : Base {};
Version 3.0.6 (5 Jul 2015)
==========================
2015-07-02: wsfulton
Fix syntax error when the template keyword is used in types, eg:
std::template vector<int> v;
2015-07-02: ngladitz
[Lua] Push characters as unformatted 1-character strings to avoid
unprintable characters such as (char)127 being converted to
"<\127>" with Lua 5.3 and later. (github PR #452)
2015-06-29: olly
[Python] Improve handling of whitespace in %pythoncode.
Previously SWIG looked at the indentation of the first line and
removed that many characters from each subsequent line, regardless
of what those characters were. This was made worse because SWIG's
preprocessor removes any whitespace before a '#'. Fixes github
issue #379, reported by Joe Orton.
2015-06-12: wsfulton
[R] Fix #430 - call to SWIG_createNewRef in copyToC was incorrectly named.
2015-06-11: sghirate
[C#] Patch #427 adds in new command line option -outfile to combine all the
generated C# code into a single file.
2015-06-09: wsfulton
Fix seg fault processing C++11 type aliasing. Issue #424.
2015-05-28: wsfulton
[Python] Add new feature "python:cdefaultargs" to control default argument
code generation. By default, SWIG attempts to convert C/C++ default argument values
into Python values and generates code into the Python layer with these values.
Recent versions of SWIG are able to convert more of these values, however, the
new behaviour can be circumvented if desired via this new feature, such that
the default argument values are obtained from the C layer and not the Python layer.
For example:
struct CDA {
int fff(int a = 1, bool b = false);
};
The default code generation in the Python layer is:
class CDA(_object):
...
def fff(self, a=1, b=False):
return _default_args.CDA_fff(self, a, b)
Adding the feature:
%feature("python:cdefaultargs") CDA::fff;
Results in:
class CDA(_object):
...
def fff(self, *args):
return _default_args.CDA_fff(self, *args)
Some code generation modes, eg -builtin and -fastproxy, are unaffected by this as
the default values are always obtained from the C layer.
2015-05-27: wsfulton
[Python] Deal with an integer as the default value of a typedef to bool
parameter in the C++ prototype. See #327. Regression from 3.0.0 onwards.
2015-05-19: olly
[Python] Fix warning when compiling generated code with MSVC.
(Fixes https://sourceforge.net/p/swig/patches/351/ reported by
Mateusz Szyma¿ski).
2015-05-14: wsfulton
Fix seg fault wrapping shared_ptr of classes with private constructors and destructors.
This also fixes the "unref" feature when used on classes with private destructors.
2015-05-10: wsfulton
[Java] Fix multi-argument typemaps (char *STRING, size_t LENGTH)
so that they can be applied to a wider range of types. Fixes #385.
2015-05-07: olly
[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: LindleyF
[Java] Allow feature("director") and feature("ref") to be used
together. Github PR#403.
2015-05-05: olly
Suppress warning 325 "Nested class not currently supported (Foo
ignored)" when Foo has already been explicitly ignored with "%ignore".
2015-05-04: wsfulton
Add support for friend templates, including operator overloading - fixes #196. Considering
the example below, previously the operator gave a syntax error and friendfunc incorrectly
warned with:
"Warning 503: Can't wrap 'friendfunc<(Type)>' unless renamed to a valid identifier."
template <class Type> class MyClass {
friend int friendfunc <Type>(double is, MyClass <Type> & x);
friend int operator<< <Type>(double un, const MyClass <Type> &x);
};
The following also previously incorrectly warned with:
"Warning 302: Identifier 'template_friend' redefined (ignored),"
template<typename T> T template_friend(T);
struct MyTemplate {
template<typename T> friend T template_friend(T);
};
2015-05-01: wsfulton
Fix handling of conversion operators where the operator is split over multiple
lines or has comments within the operator type. Fixes #401.
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.
2015-04-30: olly
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-27: vadz
[Python] Fix "default" typemap used after an argument with "numinputs=0" (#377).
2015-04-24: wsfulton
[Python] Fix #256. 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.
2015-04-23: wsfulton
[Java] Bug #386 - Memory leak fix in (char *STRING, size_t LENGTH) typemaps.
2015-04-23: vadz
[Python] Make "default" typemap work again (#330, #377).
2015-04-23: vadz
[Python] Fix the use of default values for the pointer types (#365, #376).
2015-04-23: wsfulton
Fix 'make check-ccache' which is part of 'make check' when one of the CCACHE_
environment variables, for example CCACHE_DISABLE, is set.
2015-04-14: wsfulton
Clearer warning message for badly constructed typecheck typemaps. For example, was:
example.i:3: Warning 467: Overloaded foo(int) not supported (no type checking
rule for 'int').
Now:
example.i:3: Warning 467: Overloaded foo(int) not supported (incomplete type checking
rule - no precedence level in typecheck typemap for 'int').
2015-04-11: wsfulton
[Java] Fix #353 - Linker multiple definition of 'ExceptionMatches' when
using directors and multiple modules.
2015-04-11: wsfulton
Merge #320 - Make __dict__ accessible for Python builtin classes.
2015-04-07: wsfulton
Fix #375 - parsing of extern "C" and typedef for example:
extern "C" typedef void (*Hook2_t)(int, const char *);
extern "C" typedef int Integer;
2015-03-12: olly
-DSWIG_DIRECTOR_STATIC is now supported for all languages with
director support, not only Python and PHP.
2015-03-02: ianlancetaylor
[Go] Add -cgo option, required for Go versions 1.5 and
later.
2015-02-26: olly
Fix segmentation fault when top==NULL, introduced by nested class
handling (reported in issue#346 by Pawe¿ Tomulik).
2015-02-09: wsfulton
[Guile] Fix generated code for static const char member variables when
defined and declared inline.
2015-02-09: mishas
[Go] Fix %import of files in sub directories.
2015-02-05: ianlancetaylor
[Go] Ignore Go specific type maps (goin, goout, etc.) if they are empty.
2015-02-05: ianlancetaylor
[Go] Generated Go code no longer calls _swig_goallocate or
_swig_makegostring, as they will no longer work as of Go 1.5.
Version 3.0.5 (31 Jan 2015)
===========================
2015-01-30: wsfulton
[Python] Fix Python -classic and property setting. Setting properties on classic classes
was broken in swig-3.0.3 by attempting to use __setattr__. This regression is fixed now
by using __dict__ again when using -classic.
Fixes patch #232.
2015-01-27: smarchetto
[Scilab] Support for the Scilab language has been added
2015-01-23: olly
[PHP] When wrapping a returned resource as an object, check if all
cases wrap it in the same class, and if so eliminate the pointless
switch statement wrapper we previously generated.
2015-01-22: wsfulton
[Octave] Merge patch #297 for SF bug #1277 - Octave shared_ptr support
2015-01-15: wsfulton
[Python] Merge patch #250 - Fixes for using %constant and objects (non-primitive types)
2015-01-15: wsfulton
[C# Go] Merge patch #308 and fix #307 - C++11 strongly typed enum support
in directors
2015-01-15: wsfulton
[Python] Second fix for #294 #296 - Regression introduced in SWIG-3.0.3 when
wrapping functions with default arguments, this time when using kwargs.
Version 3.0.4 (14 Jan 2015)
===========================
2015-01-12: olly
[PHP] Fix segfault in director upcall check when using PHP built with
ZTS enabled. Fixes #155, reported by Pierre Labastie.
2015-01-12: vadz
[Python] Fix #294 #296 - Regression introduced in SWIG-3.0.3 when
wrapping functions with default arguments. Invalid or missing default
arguments were sometimes being generated into the python layer.
2015-01-08: olly
Allow C++11 "explicit constexpr". Fixes github issue #284 reported
by Pawel Tomulik. Also handle "constexpr explicit" and "constexpr
static".
2015-01-08: olly
When reporting an error for a construct which hasn't been
terminated when the end of the file is reached, report it at the
start line rather than "EOF" as then tools like editors and IDEs
will take you to a generally more useful place for fixing the
problem.
2015-01-08: olly
Improve error messages for a few cases which previously gave the
one of the cryptic catch-all errors "Syntax error in input".
2015-01-08: olly
Provide -cppext as a general command line option for setting the
extension used for generated C++ files (previously it was specific
to the PHP backend). Deprecate the equivalent -suffix option
provided by the Ocaml backend, but continue to support that for
now.
Version 3.0.3 (30 Dec 2014)
===========================
2014-12-27: wsfulton
Fix #280 - abort using all default template parameters within other template
parameters.
2014-12-27: talby
[Perl] Issue #282 perl5 archlib vs archlibexp
[Perl] tidy "warning: duplicate 'extern' declaration specifier" when building generated code
under clang
2014-12-18: wsfulton
Add support for %constant and structs/classes - issue #272
2014-12-09: wsfulton
Fix #245 - regression (since swig-3.0.0) in templated constructors.
Templated constructors could not be instantiated - they were incorrectly ignored with a warning 504:
"Function: xyz must have a return type. Ignored."
2014-12-07: wsfulton
Add support for C++11 strongly typed enumerations.
2014-11-21: wsfulton
[Java C#] Fix multiply defined error when using %rename of enum items when using the "simple enum"
wrappers.
2014-10-28: vadz
[Python] Patch #201 The generated .py file no longer uses *args for all Python parameters.
Instead, the parameters are named using the C++ parameter names.
"compactdefaultargs" feature can be enabled to restore the old behaviour.
*** POTENTIAL INCOMPATIBILITY ***
2014-10-24: timotheecour
[D] Patch #204 Use core.atomic.atomicOp to mutate shared variables
2014-10-21: wsfulton
Fix issue #242 - Use of the "kwargs" feature no longer automatically turns on the
"compactdefaultargs" feature if the target language does not support kwargs.
Only Java and Python support kwargs, so this affects all the other languages.
*** POTENTIAL INCOMPATIBILITY ***
2014-10-10: diorcety
[Python] Patch #232 Fix property access using directors
2014-10-06: wsfulton
[Python] Fixes when using -builtin and std::vector/std::list wrappers to allow deletion
of single elements, such as 'del vec[0]'.
2014-09-30: oliverb
[Javascript] Merge patch #216 by Richie765 - Added support for many versions of v8 javascript.
2014-09-30: oliverb
[Javascript] Merge patch #195 by zittix - Fixed JSClassRef declaration not using the static one.
2014-09-30: ianlancetaylor
[Go] In configure script, require Go 1.1 or later.
2014-09-30: wsfulton
[Python] Patch #207 - Fix No module error with -relativeimport when using single
header file import.
2014-09-27: wsfulton
Patch #208 - Initialise newly created array when using array_functions in the
carrays.i library (C++ usage).
2014-09-27: wsfulton
[Ruby] Patch #187 - Fix crash on shutdown of the Ruby interpreter if more than one
module was loaded at a time when data is being shared between modules.
2014-09-27: wsfulton
[Java] Patch #168 - Fix leak in Java director string handling after the Java
upcall when called from a native thread.
2014-09-25: ianlancetaylor
[Go] Adjust generated code to work with upcoming Go 1.4
release.
2014-09-23: wsfulton
[Python] Add patch from Thomas Maslach to fix crash in wrappers when using -threads in
the STL iterators (SwigPyIterator destructor).
2014-09-17: wsfulton
[C#] Merge patch #229 from contre - Add bool array types to arrays_csharp.i
2014-09-12: olly
[PHP] Add support for specifying any PHP interfaces a wrapped class
implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator";
2014-09-11: olly
[PHP] Fix throwing a PHP exception through C++ from a subclassed
director method - PHP NULL gets returned by the subclassed method
in this case, so the directorout typemap needs to allow that (at
least if an exception is active).
2014-09-09: ianlancetaylor
[Go] Add goargout typemap.
2014-09-09: olly
[PHP] Fix segmentation faults with directors in PHP >= 5.4, and
reenable runme tests for director_basic testcase. Fix from
pavel-charvat in issue#164.
2014-09-05: ianlancetaylor
[Go] Add imtype, goin, goout, godirectorin, and
godirectorout typemaps, to support writing Go code to
convert between types.
2014-09-02: olly
[Python] Fix regression in indentation of python code produced with
-modern, introduced by changes in #188. Reported by fabiencastan
in #218.
2014-09-01: olly
Issue an error for unknown SWIG preprocessor directives, rather
than quietly ignoring them. Reported by jrhelsey in issue#217.
*** POTENTIAL INCOMPATIBILITY ***
2014-08-15: talby
[Perl] Include guard fix for nested modules from Anthony Heading (SF Patch #350).
2014-08-04: wsfulton
[C#] Merge patch #200 from gpetrou - Changed CSharp license header to include auto-generated
tag so that StyleCop ignores the files.
2014-08-04: wsfulton
[Java] Merge patch #198 from Yuval Kashtan - Support for java.nio.ByteBuffer mapping to
unsigned char * in various.i in NIOBUFFER typemaps.
2014-07-14: ianlancetaylor
[Go] Change struct definition to use void *, not uint8, so
that the type is recorded as possibly containing
pointers. This ensures that the 1.3 garbage collector
does not collect pointers passed to C++ code.
2014-07-01: wsfulton
Fix SF Bug #1375 - Expansion of the $parentclassname special variable incorrectly contains
brackets in the expanded name.
Version 3.0.2 (4 Jun 2014)
==========================
2014-06-02: v-for-vandal
[Lua] Pull request #176:
If class has no __eq implemented, then default __eq is generated.
Default __eq compares actual pointers stored inside Lua userdata.
2014-06-02: vkalinin
Fix #183 - %extend and unnamed nested structs
2014-05-28: kwwette
Fix install failure when using an 'out of source' build using the shipped
tarball - regression introduced in swig-3.0.1.
2014-05-24: kwwette
[Octave] Remove deprecated -global/-noglobal command-line arguments
*** POTENTIAL INCOMPATIBILITY ***
Version 3.0.1 (27 May 2014)
===========================
2014-05-25: hfalcic
[Python] Python 3 byte string output: use errors="surrogateescape"
if available on the version of Python that's in use. This allows
obtaining the original byte string (and potentially trying a fallback
encoding) if the bytes can't be decoded as UTF-8.
Previously, a UnicodeDecodeError would be raised with no way to treat
the data as bytes or try another codec.
2014-05-18: vkalinin
Bug #175 - Restore %extend to work for unnamed nested structures by using a C
symbol comprising the outer structure name and unnamed variable instance name.
2014-05-15: kwwette
Add #166 - 'make check' now works out of source. This required the examples to build
out of source. The main languages have been tested - C#, Go, Guile, Java, Javascript,
Lua, Octave, Perl, PHP, Python, Ruby and Tcl.
2014-05-01: Oliver Buchtala
Javascript support added, see Javascript chapter in the documentation.
2014-05-01: olly
[PHP] The generated __isset() method now returns true for read-only properties.
2014-04-24: kwwette
[Go] Fix go ./configure parsing of gccgo --version, and
goruntime.swg typo in __GNUC_PATCHLEVEL__ (SF Bug #1298)
2014-04-24: kwwette
Fix {python|perl5|ruby|tcl}/java examples
In Lib/gcj/cni.i, for compatibility with newer gcj versions:
- remove JvAllocObject() which gcj no longer defines, from gcj Changelog:
2004-04-16 Bryce McKinlay <mckinlay@redhat.com>
* gcj/cni.h (JvAllocObject): Remove these obsolete,
undocumented CNI calls.
- change JvCreateJavaVM() argument from void* to JvVMInitArgs*, from gcj Changelog:
2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>
PR libgcj/16923
...
(JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*.
*** POTENTIAL INCOMPATIBILITY ***
2014-04-08: wsfulton
SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i
2014-04-08: wsfulton
[Java C#] Enums which have been ignored via %ignore and are subsequently
used are handled slightly differently. Type wrapper classes are now generated
which are effectively a wrapper of an empty enum. Previously in Java uncompilable
code was generated and in C# an int was used.
2014-04-04: wsfulton
Fix regression in 3.0.0 where legal code following an operator<< definition might
give a syntax error. SF Bug #1365.
2014-04-03: olly
[PHP] Fix wrapping director constructors with default parameters
with a ZTS-enabled build of PHP.
2014-04-02: olly
[PHP] Pass the ZTS context we already have to avoid needing to
call TSRMLS_FETCH, which is relatively expensive.
2014-04-02: olly
[PHP] Pass ZTS context through to t_output_helper() so it works
with a ZTS-enabled build of PHP. Reported by Pierre Labastie in
github PR#155.
2014-03-28: wsfulton
[Java C# D Go] Fixes for C enums used in an API and the definition of the enum
has not been parsed. For D, this fixes a segfault in SWIG. The other languages
now produce code that compiles, although the definition of the enum is needed
in order to use the enum properly from the target language.
2014-03-23: v-for-vandal
[Lua] Fix for usage of snprintf in Lua runtime which Visual Studio does not have.
Version 3.0.0 (16 Mar 2014)
===========================
2014-03-16: wsfulton
C++11 support initially developed as C++0x support by Matevz Jekovec as a Google Summer of Code
project has been further extended. The C++11 support is comprehensive, but by no means complete
or without limitations. Full details for each new feature in C++11 is covered in the
CPlusPlus11.html chapter in the documentation which is included in SWIG and also available
online at http://www.swig.org/Doc3.0/CPlusPlus11.html.
2014-03-14: v-for-vandal
[Lua] Numerous Lua improvements:
1. %nspace support has been added. Namespaces are mapped to tables in the module, with the same
name as the C++ namespace.
2. Inheritance is now handled differently. Each class metatable keeps a list of class bases instead
of merging all members of all bases into the derived class.
3. The new metatables result in differences in accessing class members. For example:
%module example
struct Test {
enum { TEST1 = 10, TEST2 = 20 };
static const int ICONST = 12;
};
Now this can be used as follows:
print(example.Test.TEST1)
print(example.Test.ICONST)
The old way was:
print(example.Test_TEST1)
print(example.Test_ICONST)
4. The special class metatable member ".constructor" was removed. Now SWIG generates the proxy
function by itself and assigns it directly to the class table "__call" method.
5. eLua should also now support inheritance.
6. 'const' subtable in eLua is considered deprecated.
Changes in behaviour:
a. You can no longer assign to non-existing class members in classes without a __setitem__ method.
It will cause a Lua error.
b. You can no longer iterate over a module table and copy everything into the global namespace.
Actually, this was never the case, but it is now explicitly prohibited.
c. Now changing a base class will immediately affect all derived classes.
d. There might be some issues with inheritance. Although the bases iteration scheme is the same
as was used for merging base classes into derived one, some unknown issues may arise.
The old metatable behaviour can be restored by using the -no-old-metatable-bindings option.
*** POTENTIAL INCOMPATIBILITY ***
2014-03-06: wsfulton
[Python] Change in default behaviour wrapping C++ bool. Only a Python True or False
will now work for C++ bool parameters. This fixes overloading bool with other types.
Python 2.3 minimum is now required for wrapping bool.
When wrapping:
const char* overloaded(bool value) { return "bool"; }
const char* overloaded(int value) { return "int"; }
Previous behaviour:
>>> overloaded(False)
'int'
>>> overloaded(True)
'int'
>>> overloaded(0)
'int'
Now we get the expected behaviour:
>>> overloaded(False)
'bool'
>>> overloaded(0)
'int'
The consequence is when wrapping bool in non-overloaded functions:
const char* boolfunction(bool value) { return value ? "true" : "false"; }
The previous behaviour was very Pythonic:
>>> boolfunction("")
'false'
>>> boolfunction("hi")
'true'
>>> boolfunction(12.34)
'true'
>>> boolfunction(0)
'false'
>>> boolfunction(1)
'true'
Now the new behaviour more along the lines of C++ due to stricter type checking. The
above calls result in an exception and need to be explicitly converted into a bool as
follows:
>>> boolfunction(0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: in method 'boolfunction', argument 1 of type 'bool'
>>> boolfunction(bool(0))
'false'
The old behaviour can be resurrected by passing the -DSWIG_PYTHON_LEGACY_BOOL command line
parameter when executing SWIG. Typemaps can of course be written to customise the behaviour
for specific parameters.
*** POTENTIAL INCOMPATIBILITY ***
2014-03-06: wsfulton
Fix SF Bug #1363 - Problem with method overloading when some methods are added by %extend
and others are real methods and using template default parameters with smart pointers.
This is noticeable as a regression since 2.0.12 when using the default smart pointer
handling for some languages when the smart pointer wraps std::map and other STL containers.
2014-03-02: wsfulton
[Python] SF Patch #346 from Jens Krueger. Correct exception thrown attempting to
access a non-existent C/C++ global variable on the 'cvar' object. The exception thrown
used to be a NameError. However, as this access is via a primary, an AttributeError
is more correct and so the exception thrown now is an AttributeError. Reference:
http://docs.python.org/2/reference/expressions.html#attribute-references
*** POTENTIAL INCOMPATIBILITY ***
2014-03-01: wsfulton
[Python] Patch #143 Fix type shown when using type() to include the module and package
name when using -builtin.
2014-03-01: wsfulton
[Python] SF patch #347 Fix missing argument count checking with -modern.
Fixes regression introduced when builtin changes were introduced in SWIG-2.0.3.
2014-02-21: wsfulton
[PHP] Fix warning suppression using %warnfilter for PHP reserved class names.
2014-02-19: olly
[Lua] Add keyword warnings for Lua keywords and Basic Functions.
2014-02-19: olly
-Wallkw now includes keywords for all languages with keyword
warnings (previously Go and R were missing).
2014-02-19: olly
[PHP] Update the lists of PHP keywords with new ones from PHP 5.4
and newer (and some missing ones from 5.3). Reserved PHP constants
names are now checked against enum values and constants, instead
of against function and method names. Built-in PHP function names
no longer match methods added by %extend. Functions and methods
named '__sleep', '__wakeup', 'not', 'parent', or 'virtual' are no
longer needlessly renamed.
2014-02-15: wsfulton
Fix the %$ismember %rename predicates to also apply to members added via %extend.
Add %$isextendmember for %rename of members added via %extend. This can be used to
distinguish between normal class/struct members and %extend members. For example
'%$ismember, %$not %$isextendmember' will now identify just class/struct members.
*** POTENTIAL INCOMPATIBILITY ***
2014-02-16: hfalcic
[Python] Patch #137 - fix crashes/exceptions in exception handling in Python 3.3
2014-02-15: wsfulton
[Java] Add support for the cdata library.
2014-02-08: vkalinin
Nested class support added. This primarily allows SWIG to properly parse nested
classes and keep the nested class information in the parse tree. Java and C#
have utilised this information wrapping the C++ nested classes as Java/C#
nested classes. The remaining target languages ignore nested classes as in
previous versions. Help is needed by users of these remaining languages to
design how C++ nested classes can be best wrapped. Please talk to us on the
swig-devel mailing list if you think you can help.
Previously, there was limited nested class support. Nested classes were treated
as opaque pointers. However, the "nestedworkaround" feature provided a way to
wrap a nested class as if it was a global class. This feature no longer exists
and is replaced by the new "flatnested" feature. This effectively does the same
thing with less manual code to be written. Please see the 'Nested classes'
section in the documentation in SWIGPlus.html if you were previously using this
feature.
SWIG now parses the contents of nested classes where previously it did not. You
may find that you will need to make adjustments to your interface file as
effectively extra code is being wrapped.
*** POTENTIAL INCOMPATIBILITY ***
2014-02-06: gjanssens
[Guile] Patch #133. Make scm to string conversion work with non-ascii strings.
Guile 2 has a completely rewritten string implementation. SWIG made some assumptions
that are no longer valid as to the internals of guile's string representation.
2014-01-30: wsfulton
[C#] Add new swigtype_inout.i library containing SWIGTYPE *& OUTPUT typemaps.
Example usage wrapping:
void f(XXX *& x) { x = new XXX(111); }
would be:
XXX x = null;
f(out x);
// use x
x.Dispose(); // manually clear memory or otherwise leave out and leave it to the garbage collector
2014-01-21: ianlancetaylor
[Go] Add %go_import directive.
2014-01-21: ianlancetaylor
[Go] Add support for Go 1.3, not yet released.
2014-01-20: wsfulton
Director exceptions (Swig::DirectorException) now derive from std::exception
and hence provide the what() method. In Python and Ruby, this replaces the now
deprecated DirectorException::getMessage() method.
2014-01-14: diorcety
Patch #112 - Fix symbol resolution involving scopes that have multiple levels
of typedefs - fixes some template resolutions as well as some typemap searches.
2014-01-11: wsfulton
Fix and document the naturalvar feature override behaviour - the naturalvar
feature attached to a variable name has precedence over the naturalvar
feature attached to the variable's type. The overriding was not working
when turning the feature off on the variable's name.
Fix so that any use of the naturalvar feature will override the global
setting. Previously when set globally by -naturalvar or %module(naturalvar=1),
use of the naturalvar feature was not always honoured.
2014-01-06: ianlancetaylor
[Go] Fix bug that broke using directors from a thread not
created by Go.
2013-12-24: ptomulik
[Python] SF Bug #1297
Resolve several issues related to python imports.
For example, it's now possible to import modules having the same module
names, but belonging in different packages.
From the user's viewpoint, this patch gives a little bit more control on
import statements generated by SWIG. The user may choose to use relative
or absolute imports.
Some details:
- we (still) generate import statements in the form 'import a.b.c' which
corresponds to absolute imports in python3 and (the only available)
ambiguous one in python2.
- added -relativeimport option to use explicit relative import syntax
(python3),
The "Python Packages" section in the documentation discusses how to work
with importing packages including the new -relativeimport command line option.
2013-12-23: vadz
[Octave, Perl, Python, R, Ruby, Tcl] Change the length of strings created from fixed-size char
buffers in C code.
This is a potential backwards compatibility break: a "char buf[5]" containing "ho\0la" was
returned as a string of length 5 before, but is returned as a string of length 2 now. Also,
it was possible to assign a (non-NUL-terminated) string "hello" to such a buffer before but
now this fails and only "helo" can fit.
Apply "char FIXSIZE[ANY]" typemaps to explicitly choose the old behaviour.
*** POTENTIAL INCOMPATIBILITY ***
2013-12-23: talby
[Perl] Add support for directors.
2013-12-18: ianlancetaylor
[Go] Don't require that Go environment variables be set
when running examples or testsuite when using Go 1 or
later.
2013-12-17: ianlancetaylor
[Go] Remove -longsize option (for backward compatibility,
ignore it if seen).
2013-12-17: ianlancetaylor
[Go] Add -go-pkgpath option.
2013-12-16: ianlancetaylor
[Go] Update for Go 1.2 release. Add support for linking
SWIG code directly into executable, rather than using a
shared library.
2013-12-13: ianlancetaylor
[Go] Add SWIG source file name as comments in generated
files. This can be used by Go documentation tools.
2013-12-12: jleveque
[Lua] Fix typo (wchar instead of wchar_t) which made wchar.i
for Lua useless.
2013-12-12: vmiklos
[PHP] PHP's peculiar call-time pass-by-reference feature was
deprecated in PHP 5.3 and removed in PHP 5.4, so update the REF
typemaps in phppointers.i to specify pass-by-reference in the
function definition. Examples/php/pointer has been updated
accordingly.
2013-12-12: olly
[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-11-27: vadz
[C#, Java, Python] Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
2013-11-09: wsfulton
[C#] Apply patch #79 from Brant Kyser
- Remove using directives from the generated C# code and fully qualify the use of all .NET
framework types in order to minimize potential name collisions from input files defining
types, namespace, etc with the same name as .NET framework members.
- Globally qualify the use of .NET framework types in the System namespace
- Remove .NET 1.1 support, .NET 2 is the minimum for the C# module
This is a potential backwards compatibility break if code has been added relying on these using
statements that used to be generated:
using System;
using System.Runtime.InteropServices;
The quick fix to add these back in is to add the -DSWIG2_CSHARP command line option when
executing SWIG. See CSharp.html documentation for more info.
*** POTENTIAL INCOMPATIBILITY ***
2013-11-05: wsfulton
[Java] Fix some corner cases for the $packagepath/$javaclassname special variable substitution.
2013-11-05: wsfulton
[Java] Apply patch #91 from Marvin Greenberg - Add director:except feature for improved
exception handling in director methods for Java.
2013-10-15: vadz
Allow using \l, \L, \u, \U and \E in the substitution part of %(regex:/pattern/subst/)
inside %rename to change the case of the text being replaced.
2013-10-12: wsfulton
[CFFI] Apply #96 - superclass not lispify
2013-10-12: wsfulton
Merge in C++11 support from the gsoc2009-matevz branch where Matevz Jekovec first
started the C++0x additions. Documentation of the C++11 features supported is in a
new Chapter of the documentation, "SWIG and C++11" in Doc/Manual/CPlusPlus11.html.
2013-10-04: wsfulton
Fix %naturalvar not having any affect on templated classes instantiated with an
enum as the template parameter type. Problem reported by Vadim Zeitlin.
2013-09-20: wsfulton
[Java] Fix a memory leak for the java char **STRING_ARRAY typemaps.
Version 2.0.12 (9 Feb 2014)
===========================
2014-01-16: wsfulton