blob: c900f16916a4f3e67d93871c08c32ce41e8e8e63 [file] [log] [blame]
Dave Beazleyc928c102000-01-12 03:01:06 +00001SWIG (Simplified Wrapper and Interface Generator)
2
William S Fulton293426b2010-06-03 06:34:15 +00003See the CHANGES.current file for changes in the current version.
4See the RELEASENOTES file for a summary of changes in each release.
William S Fulton5919e9c2016-12-27 19:45:02 +00005Issue # numbers mentioned below can be found on Github. For more details, add
6the issue number to the end of the URL: https://github.com/swig/swig/issues/
William S Fulton293426b2010-06-03 06:34:15 +00007
William S Fultoneab248c2025-04-15 23:03:19 +01008Version 4.3.1 (15 Apr 2025)
9===========================
10
112025-04-10: jschueller, wsfulton
12 [Python] #3067 Fix compile errors regression using external runtime and
13 PY_LIMITED_API.
14
152025-03-31: alatina
16 [Octave] #3149 Fix to compile with Octave 10.0
17
182025-01-27: StefanBattmer
19 [Python] #2889 Fix regression when using directors and threads
20 but not using limited API.
21
222024-11-21: olly
23 [Java] #3070 Fix regression wrapping enum values which don't fit
24 in a Java signed int.
25
262024-10-27: olly
27 #3058 Fix precedence of casts, which should have the same high
28 precedence as unary plus and minus, but actually had a lower
29 precedence than anything else. This could lead to the wrong type
30 being deduced in obscure cases, but also prevented SWIG deducing a
31 type for expressions such as (0)*1+2 which SWIG parses as a cast
32 and then fixes up afterwards. A bug fixed in 4.3.0 made this
33 latter problem manifest more often (previously type deduction
34 happened to work for (0)*1+2 due to an internal field not getting
35 cleared properly).
36
William S Fultonf84f80c2024-10-21 18:54:41 +010037Version 4.3.0 (20 Oct 2024)
38===========================
39
402024-10-20: wsfulton
41 #3051 Fix seg fault passing invalid unicode values when expecting a
42 std::string type - fix for python-3.13.
43
442024-10-19: olly
45 [Ruby] Documentation comments now use `true` and `false` for bool
46 parameter default values, instead of `True` and `False` (which are
47 the Python names and wrong for Ruby!)
48
492024-10-16: wsfulton
50 #874 Add nested classes to the parse tree dumped out by -xml.
51
522024-10-16: wsfulton
53 #2213 Documentation for the XML output options of SWIG's parse tree has
54 been added to the Extending chapter.
55
562024-10-09: wsfulton
57 Remove -xmllang option used with -xml, which had no effect on the output.
58
592024-10-06: wsfulton
60 [PHP] #2907 Fix returning NULL from functions with output
61 parameters.
62
63 Ensures OUTPUT and INOUT typemaps are handled consistently wrt
64 return type.
65
66 Added:
67 void SWIG_Php_AppendOutput(zval *target, zval *o, int is_void);
68
69 The t_output_helper function is deprecated. Replace t_output_helper
70 in typemaps with SWIG_AppendOutput which calls SWIG_Php_AppendOutput
71 appropriately setting the is_void parameter using the $isvoid special
72 variable. If t_output_helper is currently being used and a completely
73 backwards compatible (but technically incorrect) solution is required,
74 then use SWIG_Php_AppendOutput and pass 1 instead of $isvoid for the
75 is_void parameter.
76
77 The t_output_helper fragment is also deprecated and is no longer
78 needed as the SWIG_Php_AppendOutput function is now always
79 generated.
80
812024-10-05: wsfulton
82 [Ruby] Removed backwards compatible output_helper fragment and
83 macro.
84
85 Use SWIG_AppendOutput instead of output_helper (does not require
86 the output_helper fragment).
87
88 *** POTENTIAL INCOMPATIBILITY ***
89
902024-10-05: wsfulton
91 [Ruby] #2907 Fix returning NULL from functions with output
92 parameters.
93
94 Ensures OUTPUT and INOUT typemaps are handled consistently wrt
95 return type.
96
97 New declaration of SWIG_Ruby_AppendOutput is now:
98
99 SWIG_Ruby_AppendOutput(VALUE target, VALUE o, int is_void);
100
101 The 3rd parameter is new and the new $isvoid special variable
102 should be passed to it, indicating whether or not the wrapped
103 function returns void. If SWIG_Python_AppendOutput is currently being
104 used and a completely backwards compatible (but technically incorrect)
105 solution is required, then pass 1 for the is_void parameter.
106
107 Also consider replacing with:
108
109 SWIG_AppendOutput(VALUE target, VALUE o);
110
111 which calls SWIG_Ruby_AppendOutput with same parameters but adding
112 $isvoid for final parameter.
113
114 *** POTENTIAL INCOMPATIBILITY ***
115
1162024-09-29: clintonstimpson
117 [Python] #2350 Switch implementation from static types to heap
118 types using PyType_FromSpec() introduced in Python 3.
119
120 This currently only applies to the default code generation and is
121 not available for the -builtin code generation.
122
1232024-09-29: wsfulton
124 [Python] Single line docstring comments are stripped of leading and
125 trailing whitespace.
126
1272024-09-29: olly
128 SWIG can now handle arbitrary expressions as a subscript (i.e. in
129 `[`...`]`). We don't actually need to parse expressions in this
130 context so we can just skip to the matching closing square bracket.
131
1322024-09-29: olly
133 C++11 auto variables for which SWIG can't parse the initialiser
134 now give a warning and are ignored rather than SWIG exiting with a
135 parse error.
136
1372024-09-26: olly
138 SWIG now recognises --version as an alias for -version (it has
139 supported --help as an alias for -help since 2006).
140
1412024-09-25: wsfulton
142 [MzScheme/Racket] #920 #2830 MzScheme/Racket Deprecation notice.
143
144 This language module no longer works with modern Racket versions
145 (Racket 8 and later) due to the introduction of a different C API.
146 We are thus putting out a plea for a Racket maintainer to step
147 forward and rewrite the MzScheme module for Racket 8, otherwise it
148 will be removed in swig-4.4.
149
1502024-09-25: olly
151 SWIG can now handle arbitrary expressions in the parameter list of
152 a method call. We don't actually need to parse expressions in this
153 context so we can just skip to the matching closing parenthesis.
154
1552024-09-25: olly
156 Add support for C99 _Bool. SWIG now treats _Bool as an alias for
157 the bool keyword when in C mode.
158
1592024-09-23: olly
160 #3031 Improve support for C++11 trailing return types. SWIG now
161 supports const references, const and non-const rvalue references,
162 and enum types with an explicit `enum`, `enum class` or `enum
163 struct`.
164
1652024-09-22: wsfulton
166 #3023 The binary executables in the Windows distribution are now
167 64-bit now instead of 32-bit. Any 32-bit Windows OS users will need
168 to build their own version using instructions in Windows.html or
169 the "Getting Started Guide" for Windows on the Wiki at
170 https://github.com/swig/swig/wiki/Getting-Started#windows.
171
1722024-09-21: wsfulton
173 #2879 Don't show warning SWIGWARN_LANG_SMARTPTR_MISSING (520) if
174 class is ignored.
175
1762024-09-21: olly
177 SWIG was ignoring `final` if specified after `noexcept`.
178
1792024-09-20: olly
180 [Javascript] Fix problems with v8 support. The tests and examples
181 now work, and configure can now successfully probe for v8 without
182 assistance on Debian and Ubuntu.
183
1842024-09-19: wsfulton
185 #2866 Fix incorrect variable setters being generated when wrapping
186 reference member variables. A setter is no longer generated if the
187 type of the reference member variable is non-assignable.
188
1892024-09-18: olly
190 Fix parse error for a misplaced Doxygen comment which is the only
191 thing in a class/struct.
192
1932024-09-18: olly
194 Fix parse error for %include/#include in a class/struct followed
195 by a member declaration.
196
1972024-09-16: olly
198 #2995 SWIG now has generic handling for converting integer and
199 boolean literal values for use in target language code, replacing
200 code to do with in many of the target language backends. This is
201 mainly an internal clean-up but it does fix a bug in the code it
202 replaces when wrapping code such as this:
203
204 typedef enum { T = (bool)1 } b;
205
206 With suitable enum wrapping settings, SWIG could incorrect wrap T
207 with value 0 in C#, D and Java.
208
209 Such cases now work correctly for D, but for C# and Java SWIG now
210 generates invalid C#/Java code because the C++ enum initialiser
211 expression isn't valid for initialising a C#/Java enum - this is
212 really an improvement over generating code which compiled but used
213 the wrong value!
214
215 If you are affected by this, use %csconstvalue/%javaconstvalue to
216 specify the value of such enumerators as a suitable C#/Java
217 expression.
218
2192024-09-16: olly
220 #2560 Document complex.i in the manual.
221
2222024-09-15: FredBonThermo
223 [C#] #2835 Support -doxygen option for converting doxygen comments
224 to XML formatted C# comments.
225
2262024-09-14: wsfulton
227 #2987 C++ reference errors when passing in a 'NULL' change of
228 behaviour. Most languages now use "NullReferenceError" in the
229 error message where they previously used "ValueError". Also
230 exception changes:
231
232 Guile: "swig-null-reference-error" instead of "swig-value-error"
233 MzScheme: "swig-null-reference-error" instead of "swig-value-error"
234 PHP: TypeError instead of ValueError
235 Python: Consistently raises TypeError instead of a mix of
236 ValueError and TypeError.
237 Ruby: Consistently raises NullReferenceError instead of a mix
238 of ArgumentError and NullReferenceErrorError.
239
240 The consistent raising of a TypeError instead of ValueError for
241 Python ensures that incorrectly passing 'None' into a C++ reference
242 argument will correctly convert the error into a NotImplemented
243 error for the rich comparisons implementations per PEP 207.
244
245 *** POTENTIAL INCOMPATIBILITY ***
246
2472024-09-13: vadz
248 [C] #2086 Add support for C as a target language. This support is
249 currently experimental.
250
2512024-09-12: olly
252 Remove remains of %nestedworkaround and the nestedworkaround
253 feature it uses, which were deprecated over 10 years ago in SWIG
254 3.0.0. Since then uses of these have done nothing except emit a
255 warning.
256
2572024-09-11: wsfulton
William S Fultoneab248c2025-04-15 23:03:19 +0100258 [C#, Java] #1188 Add the %interface_additional macro to the family
William S Fultonf84f80c2024-10-21 18:54:41 +0100259 of %interface macros for adding additional interfaces for the
260 %generated interface to extend/derive from.
261
2622024-09-11: olly
263 #197 #675 #1677 #2047 Fix incorrect inclusion of "enum " when
264 qualifying C++11 "enum class" enumerator names.
265
2662024-09-11: olly
267 [Perl] #630 Fix wrapping of C++11 enum class when -const command
268 line option is specified.
269
2702024-09-07: wsfulton
271 #2875 Fix swig-4.1.0 regression using the %interface family of
272 macros for multiple inheritance and common bases.
273
2742024-09-06: olly
275 [Python] Stop documenting to define SWIG_FILE_WITH_INIT - this does
276 not actually do anything (and apparently never has!)
277
2782024-09-05: wsfulton
279 #2845 Fix duplicate friend wrappers for friend declarations in
280 nested classes.
281
2822024-09-03: olly
283 #3010 Improve handling of zero bytes in input files. This is
284 certainly a corner case, but GCC and clang both accept zero bytes
285 at least in comments, and SWIG's current handling is to ignore
286 the zero byte and all following characters up to and including the
287 next newline, so for example if a // comment contains a zero byte
288 SWIG would quietly ignore the next line.
289
2902024-08-30: olly
291 #2996 Fix generic string literal handling to handle embedded zero
292 bytes. This allows such strings to work for C# (with %csconst), D
293 (with %dmanifestconst), Go and Java (with %javaconst). For other
294 target languages SWIG-generated wrappers still truncate such string
295 literals at a zero byte (which is probably the best we can do for
296 target languages where the native string can't contain zero bytes).
297
2982024-08-23: wsfulton
299 [Java] #2991 Document solutions for mismatch in C++ access
300 specifiers and Java access modifiers in an inheritance hierarchy.
301
3022024-08-19: wsfulton
303 [Python] #2993 Add missing std::filesystem namespace to
304 std_filesystem.i.
305
3062024-08-17: olly
307 #904 #1907 #2579 Fix string literal and character literal wrapping
308 bugs.
309
3102024-08-15: olly
311 Fix parsing of octal string escapes. We now stop when the next
312 character is digit 8 or 9, and stop after 3 octal digits even if
313 the next character is an octal digit.
314
3152024-08-15: olly
316 SWIG now gives an error for digits 8 and 9 in octal constants -
317 previously these were quietly accepted resulting in a bogus value.
318 C++11 binary constants are now treated similarly - only digits 0
319 and 1 were allowed before, but trying to use other digits now gives
320 a clearer error.
321
3222024-08-12: olly
323 #657 Allow unmatched ' and " in #error and #warning.
324
3252024-08-09: wsfulton
326 [Java] #409 Add the constantsmodifiers pragma so that the
327 visibility for the Java constants interface can be changed from
328 public to default.
329
3302024-08-02: vadz
331 [Python] #2966 Fix overloaded Doxygen comments. Sometimes the
332 Doxygen comments were not combined into one Pydoc comment.
333
3342024-08-01: olly
335 Fix wrapping of string constants containing bytes 0-8, 11, 12 or
336 14-31 followed by a digit '0' to '7'. We were emitting these bytes
337 as a one or two character octal escape sequence which when
338 interpreted would include the following character.
339
3402024-07-27: olly
341 #2087 Fix parsing of `noexcept` on a function pointer type used
342 as the type of a function parameter. We currently generate
343 invalid C++ code if we try to wrap the function parameter, but
344 at least the user can `%ignore` the parameter or the whole
345 function, whereas the parse error was hard to work around.
346
3472024-07-26: olly
348 Support parsing `noexcept(X)` in expressions, including deducing
349 its type (which is always `bool`).
350
3512024-07-21: wsfulton
352 [Python] Add missing slot for init in struct _specialization_cache
353 needed for python-3.13 builtin wrappers.
354
3552024-07-21: shadchin
356 [Python] #2968 Add missing tp_versions_used slot needed for
357 python-3.13.
358
3592024-07-19: olly
360 -Wallkw now includes keywords for Javascript.
361
3622024-07-19: vadz
363 [Javascript] #2940 Names of object properties can be keywords in
364 Javascript so don't auto-rename them to have a leading underscore.
365
3662024-07-18: olly
367 #1917 Stop removing `f` and `F` suffixes from float literals.
368 This was resulting in incorrect generated C# and Java code. For
369 some cases such as `#define CONSTANT 1.0f` this was a regression
370 introduced in 4.2.0 when we started more correctly wrapping these
371 as `float` rather than `double`.
372
3732024-07-15: vadz
374 #2941 Suppress warning WARN_PARSE_USING_UNDEF for ignored using
375 declarations.
376
3772024-07-03: wsfulton
378 #2860 Enhance Windows.html documentation for the popular Visual C++
379 compiler recommending users to correctly set the __cplusplus macro
380 in order to benefit from modern standards based features that SWIG
381 provides.
382
3832024-07-02: erezgeva
384 [Python, Ruby] #2870 Change the thread safety options for the
385 director code that manages C++ director pointer ownership. Please
386 define SWIG_THREADS to turn on thread safety. For Python, this can
387 also be done via the threads module option or -threads.
388 Implementation now includes a C++11 std::mutex option as priority
389 over WIN32 and pthread mutexes. See director_guard.swg for further
390 implementation details.
391
3922024-06-28: vadz
393 #2935 Fix instantiation of specialized template where the primary
394 template is a forward class template declaration.
395
3962024-06-16: wsfulton
397 #2927 Don't ignore overloaded friend functions that are also
398 declared constexpr.
399
4002024-06-15: wsfulton
401 [Python] Removed deprecated pytuplehlp.swg file and t_output_helper.
402 Use SWIG_AppendOutput as a direct replacement for t_output_helper.
403
404 *** POTENTIAL INCOMPATIBILITY ***
405
4062024-06-15: vadz
407 [Python] #2907 Fix returning null from functions with output
408 parameters. Ensures OUTPUT and INOUT typemaps are handled
409 consistently wrt return type.
410
411 New declaration of SWIG_Python_AppendOutput is now:
412
413 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj, int is_void);
414
415 The 3rd parameter is new and the new $isvoid special variable
416 should be passed to it, indicating whether or not the wrapped
417 function returns void. If SWIG_Python_AppendOutput is currently being
418 used and a completely backwards compatible (but technically incorrect)
419 solution is required, then pass 1 for the is_void parameter.
420
421 Also consider replacing with:
422
423 SWIG_AppendOutput(PyObject* result, PyObject* obj);
424
425 which calls SWIG_Python_AppendOutput with same parameters but adding $isvoid
426 for final parameter.
427
428 *** POTENTIAL INCOMPATIBILITY ***
429
4302024-06-15: wsfulton
431 #2907 Add $isvoid special variable which expands to 1 if the
432 wrapped function has a void return, otherwise expands to 0.
433
4342024-06-14: jschueller
435 #2863 Support Python 3.13 (currently in prerelease).
436
4372024-06-13: erezgeva
438 #2609 Fix Java typemap (const char *STRING, size_t LENGTH) to
439 marshall as Java String instead of Java byte[]. If the old
440 behaviour is required, replace with typemap (const void *BYTES,
441 size_t LENGTH).
442
443 Add multi-argument typemaps to most languages:
444
445 (const char *STRING, size_t LENGTH)
446
447 All languages now use a target language string type for this
448 typemap.
449
450 New multi-argument typemaps have been added to most target
451 languages for use with C raw data (cdata):
452
453 (const void *BYTES, size_t LENGTH) to
454
455 Statically typed languages use a byte array for this typemap, while
456 scripting languages remain using a string.
457
458 *** POTENTIAL INCOMPATIBILITY ***
459
460 * Raw C data: Go uses byte array and int64 for size.
461 Users can use the (const char *STRING, size_t LENGTH) typemaps for
462 strings.
463
4642024-06-06: olly
465 Support alignof(T) for arbitrary type T, and deduce the type of
466 alignof(T) as size_t.
467
4682024-06-06: olly
469 #2919 Support parsing `sizeof(X)` for any expression or type X by
470 skipping balanced parentheses. We don't need to actually parse X
471 since the type of sizeof is always size_t.
472
4732024-06-05: leakec
474 #2873 Fix -fvirtual and using declarations for inheriting base
475 class methods corner case.
476
4772024-05-31: wsfulton
478 [C#, D, Java, Javascript, Lua] Fix %nspace and %nspacemove for
479 nested classes and enums in a class. For example:
480
481 %nspace Space::OuterClass80;
482 namespace Space {
483 struct OuterClass80 {
484 struct InnerClass80 {
485 struct BottomClass80 {};
486 };
487 enum InnerEnum80 { ie80a, ie80b };
488 };
489 }
490
491 Previously the following were additionally required for some
492 languages:
493
494 %nspace Space::OuterClass80::InnerClass80;
495 %nspace Space::OuterClass80::InnerClass80::Bottom80;
496
497 Now the appropriate nspace setting is taken from the outer class.
498
499 A new warning has also been introduced to check and correct
500 conflicting nspace usage, for example if the following is
501 additionally added:
502
503 %nspacemove(AnotherSpace) Space::OuterClass80::InnerClass80;
504
505 The following warning appears as an inner class can't be moved
506 outside of the outer class:
507
508 Warning 406: Ignoring nspace setting (AnotherSpace) for 'Space::OuterClass80::InnerClass80',
509 Warning 406: as it conflicts with the nspace setting (Space) for outer class 'Space::OuterClass80'.
510
5112024-05-31: wsfulton
512 [C#, D, Java, Javascript, Lua] #2782 Enhance the nspace feature
513 with %nspacemove for moving a class or enum into a differently
514 named %target language equivalent of a namespace.
515
5162024-05-31: binaire10
517 [Ruby] #2906 Fix SWIG wrappers for std::map and std::vector to
518 work with Ruby's "select".
519
5202024-05-30: olly
521 #2914 Handle alternative operator names in C++ preprocessor
522 expressions. Handle full set of alternative operator names in
523 C++ expressions (previously only "and", "or" and "not" were
524 understood).
525
5262024-05-15: olly
527 #2868 Support C++17 fold expressions.
528
5292024-05-15: olly
530 #2876 Report error if parser stack depth exceeded. Previously SWIG
531 would quietly exit with status 0 in this situation.
532
5332024-04-12: pfusik
534 [Javascript] #2869 Fix JavaScript _wrap_getCPtr on 64-bit Windows
535
5362024-04-12: wsfulton
537 [Javascript, MzScheme, Python, Ruby] #202 Remove the vast majority
538 of the /*@SWIG:...*/ locator strings in the generated wrappers for
539 these 4 languages to help with reproducible builds.
540
5412024-04-08: thewtex
542 [Python] #2856 Include stdlib.h for more recent Python Stable ABI
543
5442024-03-28: olly
545 Fix preprocessor to handle C-style comment ending **/ in macro
546 argument.
547
5482024-03-27: wsfulton
549 [Python] #2844 Fix for using more than one std::string_view type in
550 a method.
551
5522024-03-27: wsfulton
553 [R] #2847 Add missing std::vector<long> and std::vector<long long>
554 typemaps which were missing depending on whether or not
555 SWIGWORDSIZE64 was defined.
556
5572024-03-25: wsfulton
558 [Python] #2826 Stricter stable ABI conformance.
559 1. Use Py_DecRef and Py_IncRef when Py_LIMITED_API is defined
560 instead of macro equivalents, such as Py_INCREF.
561 2. Don't use PyUnicode_GetLength from python-3.7 and later.
562 3. Use PyObject_Free instead of deprecated equivalents.
563
5642024-03-25: olly
565 #2848 Fix elision of comma before ##__VA_ARGS__ which we document
566 as supported but seems to have not worked since before 2009.
567
5682024-03-11: wsfulton
569 [C#] #2829 Improve handling and documentation of missing enum base
570 type information.
571
5722024-03-07: wsfulton
573 [Ocaml] Fix SWIGTYPE MOVE 'in' typemap to fix compilation error.
574
5752024-03-07: wsfulton
576 Add SWIGTYPE MOVE 'typecheck' typemaps to remove warning 472
577 (SWIGWARN_TYPEMAP_TYPECHECK_UNDEF).
578
5792024-03-06: wsfulton
580 Add support for std::unique_ptr & typemaps. Non-const inputs
581 implement move semantics from proxy class to C++ layer, otherwise
582 const inputs and all reference returns behave like any other lvalue
583 reference to a class.
584
5852024-03-06: wsfulton
586 [Javascript, MzScheme, Octave] Support NULL being passed into char*
587 typemaps.
588
5892024-03-06: christophe-calmejane,wsfulton
590 #2650 Add support for movable std::unique_ptr by adding in
591 std::unique_ptr && input typemaps. The std::unique && output
592 typemaps do not support move semantics by default and behave like
593 lvalue references.
594
5952024-03-06: wsfulton
596 Add missing use of move constructor instead of copy constructor
597 when passing movable types by value. This was previously
598 implemented only for parameters passed to a global function or
599 static member function and is now extended to parameters passed to
600 member methods as well as constructors.
601
6022024-03-01: olly
603 [Java] #2819 Suppress Java removal warnings for uses of
604 System.runFinalization(). SWIG will need to stop relying on
605 finalize methods, but we know that and meanwhile these warnings
606 make the testsuite output noisy. Fix use of deprecated form
607 of Runtime.exec() in the doxygen example.
608
6092024-02-28: wsfulton
610 #1754 Fix compilation errors in generated code when instantiating a
611 templated static method within a template (non-static methods and
612 constructors were always okay). For example:
613
614 template <typename T> class X {
615 template <class InputIterator>
616 static void fn(InputIterator first, InputIterator last) {
617 ...
618 }
619 };
620 class SimpleIterator { ... };
621
622 %extend X<int> {
623 %template(fn) fn<SimpleIterator>;
624 }
625
William S Fultond452b1b2024-02-25 21:31:35 +0000626Version 4.2.1 (24 Feb 2024)
627===========================
628
6292024-02-23: wsfulton
630 #2814 Correctly ignore duplicate template instantiation (when the
631 duplicate contains typedef'd template parameters).
632
6332024-02-22: erezgeva
634 [Ruby, Octave, R] #2284 Fix segfault shrinking STL containers.
635
6362024-02-22: simark
637 Fix -Wundef warning about testing the value of __cplusplus when
638 compiling SWIG-generated C code. Warning introduced by a change in
639 SWIG 4.2.0.
640
6412024-02-21: olly
642 #2808 [PHP] Fix memory leak when getting or setting a PHP
643 attribute which wraps a C++ member variable. Bug introduced in
644 SWIG 4.1.0.
645
6462024-02-18: wsfulton
647 #2745 Fix for wrapping STL containers that are static member variables
648 or global variables (most scripting languages). Previously a copy of the
649 STL container was made into a target language container when reading the
650 variable. Changes, such as adjusting an element or adding/erasing
651 elements, were made to the copy of the container rather the actual
652 underlying C++ container. Also applies to const reference STL static
653 members.
654
655 If you really need the old behaviour, add in the typemap that used
656 to provide it. For example, for std::list< int > and
657 const std::list< int >&, use:
658
659 %typemap(varout,noblock=1,fragment="SWIG_" "Traits" "_" {std::list< int >})
660 std::list< int >, const std::list< int >& {
661 $result = swig::from(static_cast< std::list< int > >($1));
662 }
663
664 *** POTENTIAL INCOMPATIBILITY ***
665
6662024-02-15: olly
667 Improve type deduction for enum values in expressions.
668
6692024-02-15: rlaboiss
670 #2799 [Octave] Add support for Octave 9.0; fix warnings about use
671 of deprecated Octave APIs with Octave 7 and later.
672
6732024-02-14: olly
674 SWIG now warns and ignores if %constant is used with an implicit
675 type which SWIG can't deduce.
676
6772024-02-13: olly
678 Fix type deduction for certain cases involving C-style casts, or
679 which are syntactically like a C-style cast applied to an unary
680 operator, such as: (7)*6
681
6822024-02-13: olly
683 #2796 Fix handling of enum initialised by expression including a
684 cast to a typedef-ed type. Regression introduced in 4.2.0.
685
6862024-02-09: wsfulton
687 #2794 Fix SwigType_isvariadic assertion to add support for variadic
688 templated functions in a template.
689
6902024-02-08: wsfulton
691 #2761 [Tcl] Fix assert in SWIG_Tcl_ConvertPtrFromString().
692
6932024-02-03: wsfulton
694 #1897 [C#, Java] Fix crash handling enums with same name in different
695 namespaces.
696
6972024-02-01: wsfulton
698 #2781 Correctly report line number warnings/errors for base classes that
699 are templates.
700
7012024-01-31: olly
702 Fix assertion failure and segfault trying to use %constant to
703 deduce the type of a "float _Complex" constant.
704
7052024-01-31: jim-easterbrook
706 #2771 [Python] builtin fixes to handle NULL values passed to slots using
707 functype: ssizeobjargproc and ternaryfunc.
708
7092024-01-31: olly
710 [Java] #2766 Fix segfault trying to wrap a constant whose type is unknown
711 to SWIG with "%javaconst(1);" enabled.
712
7132024-01-31: wsfulton
714 #2768 Fix seg fault handling upcasting when using %shared_ptr on some
715 templates.
716
7172024-01-31: olly
718 #2783 Fix incorrectly deduced type for function call. Regression
719 introduced in 4.2.0.
720
7212024-01-27: wsfulton
722 [Python] Fix compilation error when wrapping two or more classes that
723 have the same friend operator overload when the classes are in a namespace.
724
7252024-01-15: wsfulton
726 https://sourceforge.net/p/swig/bugs/960/
727 https://sourceforge.net/p/swig/bugs/807/
728 Fix so that friend operators within a namespace can be correctly ignored
729 or renamed.
730
7312024-01-15: wsfulton
732 Wrap friend functions that are defined or declared within a namespace.
733 Previously unqualified friend definitions/declarations in a namespace were
734 ignored.
735
736 The visibility of unqualified friend functions in C++ is somewhat quirky
737 and the documentation has been enhanced to aid wrapping of friends.
738
7392024-01-12: wsfulton
740 #2749 Fix seg fault handling friend constructor/destructor declarations.
741
7422024-01-12: olly
743 [Ruby, Tcl] #2751 Fix -external-runtime output to define
744 SWIG_snprintf (bug introduced in 4.2.0).
745
7462024-01-12: olly
747 Improve preprocessor warning for use of an undefined function-like
748 macro. SWIG now warns:
749
750 Warning 202: Could not evaluate expression 'MY_VERSION_AT_LEAST(1,2,3)'
751 Warning 202: Use of undefined function-like macro
752
753 instead of:
754
755 Warning 202: Could not evaluate expression 'MY_VERSION_AT_LEAST(1,2,3)'
756 Warning 202: Syntax error: expected operator
757
7582024-01-11: PaulObermeier
759 [Tcl] Improve support for Tcl 9.0. All examples and tests now pass
760 with Tcl 9.0.b1.
761
7622024-01-06: wsfulton
763 [Python] #2744 Regression fix - add in missing SwigPyIterator_T fragment for
764 SwigPyIteratorClosed_T when using %import on an instantiated std::map.
765
William S Fulton092f9c72023-12-31 00:33:38 +0000766Version 4.2.0 (30 Dec 2023)
767===========================
768
7692023-12-24: degasus
770 [Python] #2494 Fix integer overflow / undefined behavior for python
771 castmode on sizeof(long)==8 platforms for implicit conversions around
772 edge cases of LONG_MAX and ULONG_MAX, for example:
773
774 void as_l(long x); // C interface
775
776 Usage from Python:
777
778 lmaxd = math.nextafter(float(2**63), 0.0) # LONG_MAX == 2**63-1
779 # Now below correctly raises a TypeError due to the overflow
780 as_l(math.nextafter(lmaxd, float('inf')))
781
7822023-12-21: olly
783 [PHP] `%feature("php:allowdynamicproperties", 0) Foo;` is now handled as
784 the feature being off to match other boolean features. Previously
785 any value set was treated as on.
786
7872023-12-20: treitmayr
788 [Ruby] #2033 Fix missing checks for negative numbers when passing numbers
789 to unsigned long/unsigned long long C types.
790
7912023-12-20: crhilton
792 [C#] #2722 Add support the "cs:defaultargs" feature.
793
794 This adds a way to wrap C++ functions that have default arguments
795 with an equivalent C# function with default arguments, instead of
796 generating an overloaded C# method for each defaulted argument.
797
7982023-12-20: vadz, vadimcn, wangito33, wsfulton, clintonstimpson
799 [Python] #1613 #1687 #1727 #2190 #2727 #2428 Add support for the Python stable
800 ABI using default Python options. Code is generated that compiles when
801 setting the C macro Py_LIMITED_API to 0x03040000 (at C/C++ compile time).
802 Note that the -builtin, -fast (used by -O) options are not supported.
803
8042023-12-20: wsfulton
805 [Python] More efficient input string marshalling for Python 3.
806
807 Previously a copy of a string was made while converting from a Python 3
808 string to a char * or std::string. This copy is no longer needed making
809 string marshalling more efficient. Does not apply to the stable ABI
810 targetting Python < 3.10 where a copy is still required where the stable
811 ABI does not provide PyUnicode_AsUTF8AndSize.
812
8132023-12-20: wsfulton
814 #2190 Replace SWIG_Python_str_AsChar with SWIG_PyUnicode_AsUTF8AndSize.
815
816 SWIG_Python_str_AsChar has undefined behaviour when Py_LIMITED_API is defined
817 as it returns a pointer to a string in a PyBytes object that no longer exists.
818
819 SWIG_PyUnicode_AsUTF8AndSize is an efficient replacement, but requires a
820 different API and the caller to decrement the refcount on the intermediate
821 PyObject in the Py_LIMITED_API < 0x030A0000 implementation. The alternative
822 would have required copying the returned char * string as was done in a
823 previous implementation requiring a call to the defunct SWIG_Python_str_DelForPy3
824 function.
825
826 *** POTENTIAL INCOMPATIBILITY ***
827
8282023-12-14: PaulObermeier
829 [Tcl] #2730 Rename SWIG's Tcl_GetBoolFromObj() since Tcl 8.7 (TIP 618)
830 introduces a function with the same name.
831
832 [Tcl] #2729 Use Tcl_GetString() instead of Tcl_GetStringFromObj(..., NULL)
833 for compatibility with Tcl 9.
834
8352023-12-03: olly
836 [Ocaml] Remove -suffix command line option which has emitted a
837 deprecation warning since SWIG 3.0.4 - if you want to specify
838 a different filename extension for generated C++ files use -cppext
839 instead, which works for all SWIG target language backends.
840
8412023-12-01: saiarcot895
842 [Python] #2413 Prevent potential multi-threading crash; gracefully exit running
843 daemon threads on main thread exit.
844
8452023-11-24: wsfulton
846 Add support for parsing C++20 constexpr destructors.
847
8482023-11-19: olly
849 Fix handling of constant expressions containing < and > to not
850 drop parentheses around the subexpression as doing so can change
851 its value in some cases.
852
8532023-11-18: yasamoka, jmarrec
854 [Python] #2639 Add std_filesystem.i for wrapping std::filesystem::path
855 with pathlib.Path.
856
8572023-11-17: chrstphrchvz
858 [Tcl] #2711 Fix -Wmissing-braces warning in generated code.
859
8602023-11-17: chrstphrchvz
861 [Tcl] #2710 Stop using Tcl's CONST macro. It's no longer needed
862 and is set to be deprecated in Tcl 8.7, and removed in Tcl 9.0.
863
8642023-11-08: wsfulton
865 [C#] Replace empty() method with IsEmpty property for std::vector, std::list, std::map
866 containers for consistency across all containers.
867
868 The empty() method is actually still wrapped, but as a private proxy method. For backwards
869 compatibility, the method can be made public again using %csmethodmodifiers for all
870 vectors as follows:
871
872 %extend std::vector {
873 %csmethodmodifiers empty() const "public"
874 }
875 %include "std_vector.i"
876
877 or alternatively for each individual %template instantiation as follows:
878
879 %csmethodmodifiers std::vector<double>::empty() const "public"
880 %template(VectorDouble) std::vector<double>;
881
882
883 *** POTENTIAL INCOMPATIBILITY ***
884
8852023-11-08: wsfulton
886 [C#] Add std_unordered_set.i for wrapping std::std_unordered_set, implementing
887 C# System.Collections.Generic.ISet<>.
888
8892023-11-09: olly
890 #2591 SWIG now supports command line options -std=cXX and
891 -std=c++XX to specify the C/C++ standards version. The only effect
892 of these options is to set appropriate values for __STDC_VERSION__
893 and __cplusplus respectively, which is useful if you're wrapping
894 headers which have preprocessor checks based on their values.
895
8962023-11-09: olly
897 SWIG now defines __STDC__ to 1 to match the behaviour of ISO C/C++
898 compilers - previously it had an empty value.
899
900 *** POTENTIAL INCOMPATIBILITY ***
901
9022023-11-09: olly
903 When -c++ is used, SWIG now defines __cplusplus to be 199711L (the
904 value for C++98) by default - previously its value was set to
905 __cplusplus.
906
907 *** POTENTIAL INCOMPATIBILITY ***
908
9092023-11-08: emmenlau
910 #2480 [C#] Add std_unordered_map.i for wrapping std::std_unordered_map, implementing
911 C# System.Collections.Generic.IDictionary<>.
912
9132023-11-06: wsfulton
914 [D, Java] Add the dbegin option to the %module directive for generating code at
915 the beginning of every D file. Similarly javabegin for Java. This enables one
916 to add a common comment at the start of each D/Java file.
917
9182023-11-06: wsfulton
919 [C#] #2681 Support nullable reference types. A generic C# option to the
920 %module directive allows one to add in any code at the beginning of every
921 C# file. This can add the #nullable enable preprocessor directive at the beginning
922 of every C# file in order to enable nullable reference types as follows:
923
924 %module(csbegin="#nullable enable\n") mymodule
925
9262023-10-21: wsfulton
927 [Python] #1783 Don't swallow all exceptions into a NotImplemented return
928 when wrapping operators which are marked with %pythonmaybecall. Corrects the
929 implementation of PEP 207.
930
9312023-10-18: wsfulton
932 [C#, D] #902 Use the C++11 enum base, that is, the underlying enum
933 type.
934
935 For C#, it is used as the underlying type in the generated C# enum.
936 For D, it is used as the enum base type in the generated D enum.
937
9382023-10-16: wsfulton
939 #2687 Another using declarations fix for inheritance hierarchies more than
940 two deep and the using declarations are overloaded. Using declarations
941 from a base class' base were not available for use in the target
942 language when the using declaration was before a method declaration.
943
9442023-10-11: wsfulton
945 [C#, D, Go, Guile, Java, Javascript, Lua, Ocaml, R, Racket] #1680
946 carrays.i library modified to use size_t instead of int for the functions
947 provided by %array_functions and %array_class.
948
949 If the old types are required for backwards compatibility, use %apply to
950 restore the old types as follows:
951
952 %include "carrays.i"
953 %apply int { size_t nelements, size_t index }
954 ... %array_functions and %array_class ...
955 %clear size_t nelements, size_t index; # To be safe in case used elsewhere
956
957 *** POTENTIAL INCOMPATIBILITY ***
958
9592023-10-11: olly
960 [PHP] #2685 Fix testcase director_finalizer to work with PHP 8.3.
961
9622023-10-06: wsfulton
963 #2307 std::vector::capacity and std::vector::reserve signature changes.
964
965 Java api changes from:
966 public long capacity() { ... }
967 public void reserve(long n) { ... }
968 to:
969 public int capacity() { ... }
970 public void reserve(int n) { ... }
971 to fit in with the usual Java convention of using int for container
972 indexing and sizing.
973
974 The original api for std::vector::reserve can be also be made available via
975 %extend to add in an overloaded method as follows:
976
977 %include <std_vector.i>
978 %extend std::vector {
979 void reserve(jlong n) throw (std::length_error, std::out_of_range) {
980 if (n < 0)
981 throw std::out_of_range("vector reserve size must be positive");
982 self->reserve(n);
983 }
984 }
985
986 This change is partially driven by the need to seamlessly support the full
987 64-bit range for size_t generically, apart from the customisations for the
988 STL containers, by using:
989
990 %apply unsigned long long { size_t };
991 %apply const unsigned long long & { const size_t & };
992
993 *** POTENTIAL INCOMPATIBILITY ***
994
9952023-10-05: wsfulton
996 [C#] #2379 Defining SWIGWORDSIZE64 now applies the (unsigned)
997 long long typemaps to (unsigned) long for a better match on systems
998 where long is 64-bits. A new "Type mapping" section has been added into
999 the CSharp.html documentation covering this and marshalling of primitive
1000 types. C (unsigned) long handling remains as is by default, that is,
1001 marshall as 32-bit.
1002
1003 The INPUT[], OUTPUT[], INOUT[], FIXED[] typemaps for long and unsigned long
1004 in arrays_csharp.i can now be used and compiled on 64-bit platforms where
1005 sizeof(long) != sizeof(int). Requires SWIGWORDSIZE64 to be defined.
1006
10072023-09-27: wsfulton
1008 [Java] #646 #649 Defining SWIGWORDSIZE64 now applies the (unsigned)
1009 long long typemaps to (unsigned) long for a better match on systems
1010 where long is 64-bits.
1011
10122023-09-18: christophe-calmejane
1013 #2631 C++17 std::map fix for values that are not default constructible.
1014 Enhancements for all target languages except Python and Ruby.
1015
10162023-09-14: mmomtchev
1017 #2675 #2676 Temporary variable zero initialisation in the wrappers for
1018 consistency with handling pointers.
1019
10202023-09-11: emmenlau
1021 #2394 Add support to preprocessor for true and false. Note that this
1022 is for C++ not C.
1023
10242023-09-11: wsfulton
1025 [R] #2605 Complete transition to rtypecheck typemaps from hard coded
1026 logic. Also see entry dated 2022-10-28 for swig-4.1.1. The rtypecheck
1027 typemaps implement typechecking in R for each function parameter using
1028 functions such as is.numeric, is.character, is.logical, is.null etc.
1029
10302023-09-09: wsfulton
1031 https://sourceforge.net/p/swig/bugs/919/
1032
1033 Fix incorrect variable setters being generated when wrapping arrays.
1034 A setter is no longer generated if the type of the array members
1035 are non-assignable.
1036
10372023-09-09: wsfulton
1038 Non-assignable detection fixes when wrapping const member variables.
1039 Const member variables such as the following are non-assignable by
1040 by default:
1041
1042 char * const x;
1043 const int x;
1044 const int x[1];
1045
1046 but not:
1047
1048 const char * x;
1049
1050 Variable setters are not generated when wrapping these non-assignable
1051 variables and classes containing such non-assignable variables.
1052
10532023-09-07: wsfulton
1054 Non-assignable detection fixes when wrapping rvalue reference variables.
1055 Rvalue reference variables such as the following are non-assignable by
1056 by default:
1057
1058 X &&v;
1059
1060 Variable setters are not generated when wrapping these non-assignable
1061 variables and classes containing such non-assignable variables.
1062
10632023-09-06: wsfulton
1064 Non-assignable detection fixes when wrapping reference variables.
1065 Reference variables such as the following are non-assignable by
1066 by default:
1067
1068 int &v;
1069
1070 Variable setters are not generated when wrapping these non-assignable
1071 variables and classes containing such non-assignable variables.
1072
10732023-09-06: wsfulton
1074 Assignment operator detection fixes when wrapping static member
1075 variables.
1076
10772023-09-06: wsfulton
1078 #1416 Implicit assignment operator detection fixes.
1079
1080 A class that does not have an explicit assignment operator does not
1081 have an implicit assignment operator if a member variable is not
1082 assignable. Similarly should one of the base classes also not be
1083 assignable. Detection of these scenarios has been fixed so that when
1084 wrapping a variable that is not assignable, a variable setter is not
1085 generated in order to avoid a compiler error.
1086
1087 Template instantiation via %template is required in order for this to
1088 work for templates that are not assignable.
1089
10902023-09-03: wsfulton
1091 https://sourceforge.net/p/swig/bugs/1006/
1092 Fix incorrect variable setters being generated when the type of the
1093 variable is not assignable, due to variable type inheriting a private
1094 assignment operator further up the inheritance chain (further up than
1095 the immediate base).
1096
10972023-09-03: wsfulton
1098 [Guile, Ocaml, Perl] Don't attempt to generate a setter when wrapping
1099 variables which have a private assignment operator as assignment is not
1100 possible. This now matches the behaviour of all the other target languages.
1101
11022023-09-02: wsfulton
1103 Fix problems wrapping deleted destructors. Derived classes are not
1104 constructible, so don't attempt to generate default constructor or
1105 copy constructor wrappers.
1106
1107 struct StackOnly1 {
1108 // Only constructible on the stack
1109 ~StackOnly1() = delete;
1110 };
1111 struct StackOnlyDerived1 : StackOnly1 {
1112 // this class is not constructible due to deleted base destructor
1113 };
1114
11152023-09-02: wsfulton
1116 Fix %copyctor feature when used on classes with deleted copy constructors.
1117 A default constructor wrapper was sometimes incorrectly generated.
1118
11192023-09-02: wsfulton
1120 #1644 Fix wrapping types passed by value where the type has a deleted
1121 default constructor.
1122
11232023-08-16: shadchin
1124 [Python] #2665 Fix missing-field-initializers warning to provide support
1125 for python-3.12.
1126
11272023-08-09: olly
1128 [Ruby] Remove -feature command line option which has been
1129 deprecated since SWIG 1.3.32 in 2007. Use -initname instead.
1130
11312023-08-06: wsfulton
1132 Add support for using declarations to introduce templated member
1133 methods and for inheriting templated constructors, such as:
1134
1135 struct Base {
1136 // templated constructor
1137 template <typename T> Base(const T &t, const char *s) {}
1138 // templated member method
1139 template <typename T> void template_method(const T &t, const char *s) {}
1140 };
1141
1142 %template(Base) Base::Base<int>;
1143 %template(template_method) Base::template_method<double>;
1144
1145 struct Derived : Base {
1146 using Base::Base;
1147 using Base::template_method;
1148 };
1149
1150 Previously the templated methods and constructors were ignored and
1151 not introduced into the Derived class.
1152
11532023-08-04: wsfulton
1154 Fix using declarations for inheritance hierarchies more than
1155 two deep and the using declarations are overloaded. Using declarations
1156 from a base class' base were not available for use in the target
1157 language. For example in the code below, Using1::usingmethod(int i)
1158 was not wrapped for use in Using3:
1159
1160 struct Using1 {
1161 protected:
1162 void usingmethod(int i) {}
1163 };
1164 struct Using2 : Using1 {
1165 protected:
1166 void usingmethod(int i, int j) {}
1167 using Using1::usingmethod;
1168 };
1169 struct Using3 : Using2 {
1170 void usingmethod(int i, int j, int k) {}
1171 using Using2::usingmethod;
1172 };
1173
1174 Similarly for C++11 using declarations for inheriting constructors.
1175
11762023-08-02: wsfulton
1177 https://sourceforge.net/p/swig/bugs/932/
1178 Fix missing constructor generation due to abstract class test
1179 failure when a method is declared in the class along with a
1180 using declaration and the using declaration is declared before
1181 the method that implemented the pure virtual method, such as:
1182
1183 struct ConcreteDerived : AbstractBase {
1184 ConcreteDerived() {} // was not wrapped
1185 using AbstractBase::f;
1186 virtual void f(int n) override {}
1187 };
1188
11892023-08-02: olly
1190 [PHP] Implement overloading between different integer types and
1191 between double and float.
1192
11932023-07-29: wsfulton
1194 https://sourceforge.net/p/swig/bugs/678/
1195 Fix %copyctor used on class hierarchies with non-const copy
1196 constructors. Previously SWIG always attempted to call a copy
1197 constructor taking a const reference parameter instead of a
1198 non-const reference parameter.
1199
12002023-07-28: wsfulton
1201 #2541 Fix overloading of templated constructors and %copyctor.
1202
12032023-07-21: wsfulton
1204 Don't generate a default constructor wrapper when a class has a
1205 templated constructor, as there isn't actually an implied default
1206 constructor. For example:
1207
1208 struct TConstructor3 {
1209 template<typename T> TConstructor3(T val) {}
1210 };
1211
1212 Previously wrappers were generated for a non-existent default
1213 constructor which failed to compile.
1214
12152023-07-15: wsfulton
1216 C++11 using declarations for inheriting constructors has now been
1217 extended to support the directors feature.
1218
12192023-07-13: wsfulton
1220 C++11 using declarations for inheriting constructors support now
1221 also includes inheriting implicitly defined default constructors
1222 from the base class.
1223
12242023-07-04: wsfulton
1225 #2641 Add support for C++11 using declarations for inheriting
1226 constructors.
1227
12282023-06-30: wsfulton
1229 #2640 Fix syntax error parsing an expression which calls a function
1230 with no parameters within additional brackets.
1231
12322023-06-27: mmomtchev
1233 [Javascript] #2545 New Javascript generator targeting the Node.js
1234 binary stable ABI Node-API.
1235
12362023-06-27: olly
1237 [Java] Completely remove pragmas which were deprecated in 2002 and
1238 have triggered an error since SWIG 2.0:
1239
1240 moduleimport Use the moduleimports pragma
1241 moduleinterface Use the moduleinterfaces pragma
1242 modulemethodmodifiers Use %javamethodmodifiers
1243 allshadowimport Use %typemap(javaimports)
1244 allshadowcode Use %typemap(javacode)
1245 allshadowbase Use %typemap(javabase)
1246 allshadowinterface Use %typemap(javainterfaces)
1247 allshadowclassmodifiers Use %typemap(javaclassmodifiers)
1248 shadowcode Use %typemap(javacode)
1249 shadowimport Use %typemap(javaimports)
1250 shadowbase Use %typemap(javabase)
1251 shadowinterface Use %typemap(javainterfaces)
1252 shadowclassmodifiers Use %typemap(javaclassmodifiers)
1253
12542023-06-24: wsfulton
1255 #2616 https://sourceforge.net/p/swig/bugs/1102/ Fix directors and
1256 allprotected mode and using declarations. Previously SWIG either
1257 seg faulted or generated code that did not compile.
1258
12592023-06-20: olly
1260 #2486 Fix handling of template in array size, which was being
1261 rejected by SWIG because the type string contains '<' not followed
1262 by '('. Drop this check as it should be unnecessary now since the
1263 fixes that ensure that template parameters are enclosed within
1264 '<(' and ')>'.
1265
12662023-06-16: olly
1267 [Java] Remove deprecated command line options which have done
1268 nothing except emit a deprecation message since 2002 or before:
1269
1270 -jnic / -jnicpp JNI calling convention now automatic.
1271 -nofinalize Use javafinalize typemap instead.
1272 -proxy / -shadow Now on by default.
1273
12742023-06-16: olly
1275 [Guile] Drop support for -Linkage ltdlmod which was only useful
1276 for Guile <= 1.4 which we no longer support.
1277
12782023-06-15: olly
1279 [Guile] The -gh and -scm command line options have been removed.
1280 These have done nothing except emit a message since 2013 when
1281 SWIG dropped support for generating bindings which used GH.
1282
12832023-06-15: olly
1284 Remove pointer.i from the SWIG library. It's been a dummy file
1285 which has done nothing except %echo a deprecation message since
1286 2002. The replacement is cpointer.i.
1287
12882023-06-15: olly
1289 SWIG will no longer fall back to using the include path to find the
1290 input file, which has been deprecated and emitted a warning since
1291 SWIG 1.3.37 (2009-01-13). This makes the behaviour of SWIG the
1292 same as C/C++ compilers and works with ccache.
1293
12942023-06-15: olly
1295 Remove features deprecated in SWIG 1.x and 2.x. Most of these have
1296 emitted a deprecation warning or error for well over a decade and
1297 have replacements with fewer shortcomings so we expect users will
1298 have migrated away from them long ago, but in case you need
1299 them replacements are noted below:
1300
1301 %addmethods Use %extend instead.
1302 %attribute_ref Use %attributeref instead (NB: If called with
1303 4 parameters, the 3rd and 4th need switching).
1304 %disabledoc Use Doxygen support instead.
1305 %doconly Use Doxygen support instead.
1306 %enabledoc Use Doxygen support instead.
1307 %except Use %exception instead.
1308 %extern Use %import instead.
1309 %localstyle Use Doxygen support instead.
1310 %name Use %rename instead.
1311 %new Use %newobject instead.
1312 %out %apply OUTPUT typemap rule instead.
1313 %readonly Use %immutable instead.
1314 %readwrite Use %mutable instead.
1315 %section Use Doxygen support instead.
1316 %style Use Doxygen support instead.
1317 %subsection Use Doxygen support instead.
1318 %subsubsection Use Doxygen support instead.
1319 %text Use Doxygen support instead.
1320 %title Use Doxygen support instead.
1321 %typemap(except) Use %exception instead.
1322 %typemap(ignore) Use %typemap(in,numinputs=0) instead.
1323 %val Use typemaps instead.
1324 -debug_template Use -debug-template instead.
1325 -debug_typemap Use -debug-typemap instead.
1326 -dump_classes Use -debug-classes instead.
1327 -dump_memory Use -debug-memory instead.
1328 -dump_module Use -debug-module 4 instead.
1329 -dump_parse_module Use -debug-module 1 instead.
1330 -dump_parse_top Use -debug-top 1 instead.
1331 -dump_tags Use -debug-tags instead.
1332 -dump_top Use -debug-top 4 instead.
1333 -dump_tree Use -debug-top 4 instead.
1334 -dump_typedef Use -debug-typedef instead.
1335 -dump_xml Use -xmlout /dev/stdout instead.
1336 -make_default On by default since SWIG 1.3.7 (2001-09-03).
1337 -makedefault On by default since SWIG 1.3.7 (2001-09-03).
1338 -no_default Use %nodefaultctor/%nodedefaultdtor instead.
1339 -nodefault Use %nodefaultctor/%nodedefaultdtor instead.
1340 -noextern option On by default since SWIG 1.3.26 (2005-10-09).
1341 -noruntime Type sharing happens via target lang global.
1342 -runtime Type sharing happens via target lang global.
1343 -show_templates Use -debug-template instead.
1344 -tm_debug Use -debug-typemap instead.
1345 -xml out.xml Use -xml -o out.xml instead.
1346 BOTH typemap rule Use INOUT typemap rule instead.
1347 SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE)
1348 Use %intrusive_ptr(TYPE) instead.
1349 SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE)
1350 Use %intrusive_ptr(TYPE) instead.
1351 SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE)
1352 Use %intrusive_ptr_no_wrap(TYPE) instead.
1353 SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE)
1354 Use %intrusive_ptr_no_wrap(TYPE) instead.
1355 SWIG_SHARED_PTR(PROXYCLASS, TYPE)
1356 Use %shared_ptr(TYPE) instead.
1357 SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...)
1358 Use %shared_ptr(TYPE) instead.
1359 SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE)
1360 Use SWIG_STD_VECTOR_ENHANCED(CTYPE) instead.
1361 SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE)
1362 No longer required - remove uses.
1363 specialize_std_map_on_both
1364 No longer required - remove uses.
1365 specialize_std_map_on_key
1366 No longer required - remove uses.
1367 specialize_std_map_on_value
1368 No longer required - remove uses.
1369
13702023-06-15: olly
1371 [Guile] Fix freearg typemaps to go with char **INOUT and char
1372 *INOUT in typemaps. Previously the char **INOUT typemap would
1373 leak memory if must_free$argnum was true, and the char *INOUT
1374 typemap would generate code that didn't compile.
1375
13762023-06-07: olly
1377 #2630 Fix preprocessor handling of a slash immediately followed by
1378 a single quote, which wasn't getting recognised as starting a
1379 character literal.
1380
13812023-06-07: olly
1382 #2630 Fix parsing of <= and >= in templated lambda.
1383
1384 Skipping between matching delimiters is now done at the token level
1385 rather than the character level.
1386
13872023-06-02: mmomtchev
1388 [Javascript] #2622 Fix support for %typemap(default) and improve
1389 support for default arguments in general.
1390
13912023-06-01: olly
1392 [Perl] #2470 Fix some integer truncation warnings in generated
1393 wrappers.
1394
13952023-05-30: olly
1396 [Lua] Fix bug when passing a Lua number to a C++ function expected
1397 std::string. Order of evaluation of C++ function arguments is not
1398 defined, and if lua_rawlen() was called before lua_tostring() then
1399 it would return 0 (because the value was still a number) and an
1400 empty string would be passed.
1401
14022023-05-30: mmomtchev
1403 [Javascript] #2618 Fix handling of C++ pointer to member function.
1404
14052023-05-25: olly
1406 #1032 Allow typename disambiguator in:
1407
1408 using typename NodeT::links_type;
1409
14102023-05-25: olly
1411 SWIG now discriminates between long double, double and float
1412 constants. For example, this means that for target languages which
1413 support a separate float type (such as C# and D) this will now
1414 create a float constant instead of a double constant in the target
1415 language:
1416
1417 #define PI_ISH 3.1414f
1418
14192023-05-25: olly
1420 C++11 `auto` variables and `decltype()` can now deduce the
1421 type of some expressions which involve literals of built-in types.
1422
14232023-05-25: olly
1424 #1125 Support parsing C++11 auto variables. This uses the
1425 existing type deduction code from decltype so has the same
1426 limitations, and such variables will only actually be wrapped
1427 when SWIG can deduce the type.
1428
14292023-05-23: olly
1430 [Ruby] Fix deprecation warnings about ANYARGS when compiling
1431 C++ code for SWIG-generated Ruby wrappers with Ruby 3.x.
1432
1433 This is a recurrence of a problem fixed in 4.0.2. Our fix was
1434 conditional on RB_METHOD_DEFINITION_DECL being defined, but Ruby
1435 3.0 stopped defining this.
1436
14372023-05-23: olly
1438 #2606 Improve error output when SWIG reaches EOF while looking for
1439 a closing delimiter. This is reported with an error like:
1440
1441 Error: Missing '}'. Reached end of input.
1442
1443 We now exit after reporting this and so no longer report a second
1444 more generic error like:
1445
1446 Error: Syntax error in input(1).
1447
14482023-05-22: mmomtchev
1449 [Javascript] #2600 Improve test coverage by adding _runme.js files
1450 for 22 test cases.
1451
14522023-05-20: erezgeva
1453 [C#, D, Java, Javascript, Guile, Scilab] #2552 Implement argcargv.i
1454 library multi-argument typemaps.
1455
14562023-05-20: erezgeva
1457 [D] #56 #2538 #2570 The generated code now works with recent D releases:
1458 adds override keyword on overridden methods.
1459
1460 Support is now working using DMD, gcc D and LLVM D compilers.
1461
14622023-05-20: olly
1463 Support deducing the type for decltype(false) and
1464 decltype(true).
1465
14662023-05-19: olly
1467 #2446 Add support for auto without trailing return type, which is a
1468 C++14 feature.
1469
14702023-05-19: olly
1471 SWIG no longer defines preprocessor symbols corresponding to
1472 command line options (e.g. `-module blah` was resulting in
1473 `SWIGOPT_MODULE` being set to `blah`). This feature was added in
1474 2001 so that "[m]odules can look for these symbols to alter their
1475 code generation if needed", but it's never been used for that
1476 purpose in over 20 years, and has never been documented outside of
1477 CHANGES.
1478
14792023-05-18: olly
1480 #2591 Add new -U command line option to undefine a preprocessor
1481 symbol.
1482
14832023-05-18: olly
1484 #1589 #2335 Support parsing arbitrary expression in decltype.
1485
1486 Use parser error recovery to skip to the closing matching `)` and
1487 issue a warning that we can't deduce the decltype for the
1488 expression (like we already do for any expression which isn't a
1489 simple variable or similar).
1490
14912023-05-12: mmomtchev, erezgeva
1492 [Javascript] #2561 Support check typemaps for Javascript.
1493
14942023-05-12: olly
1495 [Java] #2556 Suppress Java removal warnings on finalize method.
1496 SWIG will need to stop relying on finalize methods, but we know
1497 that and meanwhile these warnings make the testsuite output very
1498 noisy.
1499
15002023-05-11: olly
1501 #302 #2079 #2474 Parse storage class more flexibly.
1502
1503 Previously we had a hard-coded list of allowed combinations in the
1504 grammar, but this suffers from combinatorial explosion, and results
1505 in a vague `Syntax error in input` error for invalid (and missing)
1506 combinations.
1507
1508 This means we now support a number of cases which are valid C++ but
1509 weren't supported, including `friend constexpr` and `virtual
1510 explicit`.
1511
15122023-05-08: olly
1513 #1567 Add support for std::string_view (new in C++17) for C#, Java,
1514 Lua, Perl, PHP, Python, Ruby and Tcl.
1515
15162023-05-08: olly
1517 [PHP] #2544 Wrap overloaded method with both static and non-static
1518 forms. We now wrap this as a non-static method in PHP, which means
1519 the static form is only callable via an object.
1520
1521 Previously this case could end up wrapped as static or non-static
1522 in PHP. If it was wrapped as static, attempting to call non-static
1523 overloaded forms would crash with a segmentation fault.
1524
15252023-05-06: mmomtchev, wsfulton
1526 #2550 Fix typedef/using declarations to a typedef struct/class.
1527
15282023-05-04: erezgeva
1529 [D] #2538 Drop support for D1/Tango, which was discontinued in
1530 2012. Wrappers for D2/Phobos are now generated by default, though
1531 the -d2 command line option is still accepted (and now ignored) for
1532 backward compatibility.
1533
1534 *** POTENTIAL INCOMPATIBILITY ***
1535
15362023-04-27: olly
1537 #2502 Allow using snprintf() instead of sprintf() in wrappers.
1538
1539 We aim to produce code that works with C90 or C++98 so we can't
1540 assume snprintf() is available, but it almost always is (even
1541 on systems from before it was standardised) so having a way to
1542 use it is helpful.
1543
1544 We enable this automatically if the compiler claims conformance
1545 with at least C99 or C++11. It can also be enabled manually by
1546 defining SWIG_HAVE_SNPRINTF. Define SWIG_NO_SNPRINTF to disable
1547 completely.
1548
1549 The fallback is to call sprintf() without a buffer size check,
1550 which is what we've done until now. Adding a check after the
1551 call seems of limited benefit - if the buffer was overflowed
1552 then it's too late to block it, and most of our uses either have a
1553 fixed maximum possible size or dynamically allocate a buffer that's
1554 large enough.
1555
15562023-04-26: mmomtchev
1557 [Javascript] Take into account numinputs when counting arguments.
1558
15592023-04-24: olly
1560 [PHP] Add throws typemaps for std:string* and const std::string*.
1561
15622023-04-23: olly
1563 [Javascript] #2453 The testsuite and examples now select which
1564 Javascript engine to test based on what was detected by configure.
1565 Previously they'd always test with node you specified a different
1566 engine (e.g. with `ENGINE=jsc` on the make command line). Now you
1567 only need to specify ENGINE if you have more than one engine
1568 installed.
1569
15702023-04-23: olly
1571 [Javascript] Turn on C++ output when wrapping for node, like
1572 we already do when wrapping for V8-without-node.
1573
1574 The testsuite was masking this bug by using SWIG options
1575 `-v8 -DBUILDING_NODE_EXTENSION=1` rather than `-node` when testing
1576 with nodejs, while the javascript examples were masking this by
1577 all getting processed with -c++.
1578
1579 This shouldn't be an incompatible change for users, as if you're
1580 wrapping a C API you'd have to be working around the problem before
1581 this change (like our testsuite and examples were), and this change
1582 shouldn't break your workaround - it just makes it unnecessary.
1583
15842023-04-21: mmomtchev
1585 [Javascript] Fix naming of internal C++ helper for wrapping
1586 variables for node to use the "getter" naming scheme rather
1587 than the function wrapping one. In practice this didn't actually
1588 cause problems because Node wrappers are always compiled as C++
1589 and the parameters are always different even if the names are
1590 the same.
1591
15922023-04-21: olly
1593 [PHP] Support INPUT,INOUT,OUTPUT for std::string&.
1594
1595 By default SWIG/PHP wraps std::string& as a pass-by-reference PHP
1596 string parameter, but sometimes such a parameter is only for input
1597 or only for output, so add support for the named typemaps that other
1598 target languages support.
1599
16002023-04-21: degasus
1601 #2519 Fix CanCastAsInteger range check to clear errno first to fix
1602 bogus failures for valid inputs.if errno is set.
1603
16042023-04-21: ZackerySpytz
1605 [OCaml] #1439 Fix reference typemaps for std::string
1606
16072023-04-21: olly
1608 #2183 Fix #ifdef and #ifndef to work inside a %define. Previously
1609 they were silently ignored in this context (but #if defined already
1610 worked here if you need a workaround which works for older
1611 versions).
1612
16132023-04-20: erezgeva
1614 [Go] #2533 Implement argcargv.i library for Go.
1615
16162023-04-19: davidcl
1617 [Scilab] Add support for Scilab 2023.x.
1618 Introduce a new `-gatewayxml6` option to generate XML with full
1619 function names.
1620
16212023-04-19: mmomtchev
1622 https://sourceforge.net/p/swig/bugs/1163/ #1882 #2525
1623 Fix preprocessor expansion when a macro expands to the name of
1624 another macro which takes parameters from the input following the
1625 original macro expansion.
1626
16272023-04-19: wildmaples
1628 [Ruby] #2527 Fix "undefining the allocator of T_DATA" warning seen
1629 with Ruby 3.2.
1630
16312023-04-18: davidcl
1632 [Scilab] #894 extract values with ":" for typemap (int* IN, int IN_SIZE)
1633
16342023-04-14: olly
1635 [PHP7] Support for PHP7 has been removed. PHP7 security support
1636 ended 2022-11-28 so it doesn't make sense to include support for
1637 it in the SWIG 4.2.x release series.
1638
1639 *** POTENTIAL INCOMPATIBILITY ***
1640
16412023-04-05: wsfulton
1642 [Python] #2515 Add support for all STL containers to be constructible from a Python set.
1643
1644 The previous implementation used the Python Sequence Protocol to convert from Python types
1645 to STL containers. The new implementation uses the Python Iterator Protocol instead and
1646 thereby can convert from a Python set too.
1647
16482023-03-25: alatina
1649 [Octave] #2512 Add support for Octave 8.1.
1650
16512023-03-22: wsfulton
1652 [C#] #2478 Minor enhancements to std::array wrappers in std_array.i.
1653
16542023-03-13: wsfulton
1655 Improved error checking when using %template to instantiate templates within
1656 the correct scope.
1657
1658 1. When a template is instantiated via %template and uses the unary scope
1659 operator ::, an error occurs if the instantiation is attempted within a
1660 namespace that does not enclose the instantiated template.
1661 For example, the following will now error as ::test::max is not enclosed within test1:
1662
1663 Error: '::test::max' resolves to 'test::max' and was incorrectly instantiated in
1664 scope 'test1' instead of within scope 'test'.
1665 namespace test1 {
1666 %template(maxchar) ::test::max<char>;
1667 }
1668
1669 2. SWIG previously failed to always detect a template did not exist when using
1670 %template. In particular when instantiating a global template incorrectly within
1671 namespace. The code below now correctly emits an error:
1672
1673 Error: Template 'test5::GlobalVector' undefined.
1674 namespace test5 {
1675 }
1676 template<typename T> struct GlobalVector {};
1677 %template(GVI) test5::GlobalVector<int>;
1678
16792023-03-13: wsfulton
1680 Error out if an attempt is made to define a class using the unary scope
1681 operator ::. The following is not legal C++ and now results in an error:
1682
1683 Error: Using the unary scope operator :: in class definition '::Space2::B' is invalid.
1684 namespace Space2 {
1685 struct B;
1686 }
1687 struct ::Space2::B {};
1688
16892023-03-08: wsfulton
1690 Fix duplicate const in generated code when template instantiation type is const
1691 and use of template parameter is also explicitly const, such as:
1692
1693 template <typename T> struct Conster {
1694 void cccc1(T const& t) {}
1695 };
1696 %template(ConsterInt) Conster<const int>;
1697
1698 Above previously led to generated code:
1699 (arg1)->cccc1((int const const &)*arg2);
1700 instead of
1701 (arg1)->cccc1((int const &)*arg2);
1702
17032023-03-01: wsfulton
1704 Partial template specialization fixes to support default arguments from the primary
1705 template's parameter list.
1706
1707 template<class Y, class T=int> struct X { void primary() {} };
1708 // Previously the specialization below resulted in:
1709 // Error: Inconsistent argument count in template partial specialization. 1 2
1710 template<class YY> struct X<YY*> { void special(YY*) {} };
1711
1712 // Both of these correctly wrap the partially specialized template
1713 %template(StringPtr) X<const char *>;
1714 %template(ShortPtr) X<short *, int>;
1715
17162023-02-15: wsfulton
1717 #1300 Further partial template specialization fixes.
1718 Fixes when templates are used as a template parameter in a partially specialized
1719 instantiation such as:
1720
1721 template<typename V> struct Vect {};
1722 template<class T, typename TT> class Foo { ... };
1723 template<class TS, typename TTS> class Foo<Vect<TS>, TTS> { ... };
1724 %template(VectInt) Vect<int>;
1725 %template(FooVectIntDouble) Foo<Vect<int>, double>; // was previously attempting to use primary template
1726
1727 Also fixes partial specialization where the same template parameter name is used twice,
1728 for example:
1729
1730 template<typename X, typename Y> struct H { ... };
1731 template<typename T> struct H<T, T> { ... };
1732 %template(HInts) H<int, int>; // was previously attempting to use primary template
1733
17342023-01-27: jschueller
1735 #2492 [python] Fix unused parameter warnings for self parameter in
1736 generated C/C++ wrapper code.
1737
17382023-01-14: wsfulton
1739 Fix deduction of partially specialized template parameters when the specialized
1740 parameter is non-trivial, used in a wrapped method and the type to %template uses
1741 typedefs. For example:
1742
1743 typedef double & DoubleRef;
1744 template <typename T> struct XX {};
1745 template <typename T> struct XX<T &> { void fn(T t) {} };
1746 %template(XXD) XX<DoubleRef>;
1747
1748 The type of the parameter in the instantiated template for fn is now correctly deduced
1749 as double.
1750
17512023-01-03: wsfulton
1752 #983 Fix seg fault when instantiating templates with parameters that are function
1753 parameters containing templates, such as:
1754
1755 %template(MyC) C<int(std::vector<int>)>;
1756
17572023-01-03: wsfulton
1758 Complete support for C++11 variadic function templates. Support was previously limited
1759 to just one template parameter. Now zero or more template parameters are supported
1760 in the %template instantiation.
1761
17622022-12-29: wsfulton
1763 #1863 Syntax error fixes parsing more elaborate parameter pack arguments that are
1764 used in function pointers, member function pointers:
1765
1766 template <typename... V> struct VariadicParms {
1767 void ParmsFuncPtrPtr(int (*)(V*...)) {}
1768 void ParmsFuncPtrPtrRef(int (*)(V*&...)) {}
1769 void ParmsFuncPtrPtrRValueRef(int (*)(V*&&...)) {}
1770 void ParmsFuncPtrRef(int (*)(V&...)) {}
1771 void ParmsFuncPtrRValueRef(int (*)(V&&...)) {}
1772
1773 void ParmsMemFuncPtrPtr(int (KlassMemFuncs::*)(V*...)) {}
1774 void ParmsMemFuncPtrPtrRef(int (KlassMemFuncs::*)(V*&...)) {}
1775 void ParmsMemFuncPtrPtrRValueRef(int (KlassMemFuncs::*)(V*&&...)) {}
1776 void ParmsMemFuncPtrRef(int (KlassMemFuncs::*)(V&...)) {}
1777 void ParmsMemFuncPtrRValueRef(int (KlassMemFuncs::*)(V&&...)) {}
1778 };
1779
1780 %template(VariadicParms0) VariadicParms<>;
1781 %template(VariadicParms1) VariadicParms<A>;
1782
1783 Also in various other places such as within noexcept specifiers:
1784
1785 template<typename T, typename... Args>
1786 void emplace(Args &&... args) noexcept(
1787 std::is_nothrow_constructible<T, Args &&...>::value);
1788
17892022-12-27: wsfulton
1790 Fix instantiation of variadic class templates containing parameter pack arguments that
1791 are function pointers.
1792
1793 template <typename... V> struct VariadicParms {
1794 void ParmsFuncPtrVal(int (*)(V...)) {}
1795 };
1796
1797 %template(VariadicParms0) VariadicParms<>;
1798 %template(VariadicParms1) VariadicParms<A>;
1799
18002022-12-23: wsfulton
1801 #1863 Fix syntax error parsing variadic templates containing parameter pack arguments that
1802 are function pointers.
1803
18042022-12-22: wsfulton
1805 Complete support for C++11 variadic class templates. Support was previously limited
1806 to just one template parameter. Now zero or more template parameters are supported.
1807
18082022-12-06: wsfulton
1809 #1636 Fix syntax error for misplaced Doxygen comment after struct/class member.
1810 Fix syntax error using Doxygen member groups syntax, "///*}", when used after
1811 final struct/class member.
1812
18132022-12-05: wsfulton
1814 #2023 Fix garbled Doxygen post comments in parameter lists.
1815 Fix syntax error parsing a trailing Doxygen comment in parameter lists.
1816
18172022-12-03: wsfulton
1818 #1609 Fix syntax error parsing of Doxygen comments after last enum item.
1819
18202022-12-03: wsfulton
1821 #1715 Fix syntax error parsing of unconventionally placed Doxygen post
1822 comments for enum items.
1823
18242022-12-02: wsfulton
1825 #624 #1021 Improved template template parameters support. Previously, specifying more
1826 than one simple template template parameter resulted in a parse error. Now
1827 multiple template template parameters are working including instantiation with
1828 %template. Example:
1829
1830 template <template<template<class> class, class> class Op, template<class> class X, class Y>
1831 class C { ... };
1832
18332022-11-26: wsfulton
1834 #1589 #1590 Slightly better decltype() support for expressions, such as:
1835
1836 int i;
1837 ... decltype(&i) ...
1838
1839 These result in a warning for non-trivial expressions which SWIG cannot evaluate:
1840
1841 Warning 344: Unable to deduce decltype for '&i'.
1842
1843 See 'Type Inference' in CPlusPlus.html for workarounds.
1844
18452022-11-22: wsfulton
1846 #366 #1037 Fix seg fault handling template parameter expressions
1847 containing '<=' or '>='.
1848
18492022-11-18: wsfulton
1850 Duplicate class template instantiations via %template now issue a warning and are ignored.
1851
1852 %template(Aint) A<int>;
1853 %template(Aint2) A<int>; // Now ignored and issues a warning
1854
1855 example.i:7: Warning 404: Duplicate template instantiation of 'A< int >' with name 'Aint2' ignored,
1856 example.i:6: Warning 404: previous instantiation of 'A< int >' with name 'Aint'.
1857
1858 A single empty template instantiation before a named instantiation is the one exception
1859 for allowing duplicate template instantiations as the empty template instantiation does not
1860 create a wrapper for the template, it merely adds the instantiation into SWIG's internal
1861 type system.
1862 Duplicate empty template instantiations are quietly ignored.
1863
1864 %template() B<int>;
1865 %template(Bint) B<int>; // OK
1866
1867 %template() C<int>;
1868 %template() C<int>; // Quietly ignored now
1869 %template(Cint) C<int>; // OK
1870
1871 Note that default template parameters are considered when looking for duplicates such as:
1872
1873 template <typename T, typename U = short> struct D {};
1874 %template(Dint) D<int>;
1875 %template(Dintshort) D<int, short>;
1876
1877 example.i:7: Warning 404: Duplicate template instantiation of 'D< int,short >' with name 'Dintshort' ignored,
1878 example.i:6: Warning 404: previous instantiation of 'D< int >' with name 'Dint'.
1879
1880 Note that the following always was ignored, but that was because the chosen name was a
1881 duplicate rather than the template being a duplicate:
1882
1883 %template(Eint) E<int>;
1884 %template(Eint) E<int>; // Always has been ignored as a redefined identifier
1885
1886 The old warning was:
1887
1888 example.i:7: Warning 302: Identifier 'Eint' redefined (ignored) (Renamed from 'E< int >'),
1889 example.i:6: Warning 302: previous definition of 'Eint' (Renamed from 'E< int >').
1890
1891 *** POTENTIAL INCOMPATIBILITY ***
1892
William S Fulton8047d5a2022-12-02 20:57:54 +00001893Version 4.1.1 (30 Nov 2022)
1894===========================
1895
18962022-11-29: bero
1897 Fix mismatch between #pragma GCC diagnostic push and pop statements
1898
18992022-11-26: wsfulton
1900 #2449 Fix undefined behaviour in ccache-swig calculating md4 hashes and possibly
1901 also handling errors when CCACHE_CPP2 is set.
1902
19032022-11-25: wsfulton
1904 #961 Fix syntax error parsing unnamed template parameters with a default value.
1905
19062022-11-25: olly
1907 #2447 Fix undefined behaviour in swig's parser when handling
1908 default parameter expressions containing method calls.
1909
19102022-11-13: olly
1911 [PHP] #2419 Update the documentation to reflect that SWIG 4.1.0
1912 dropped support for -noproxy when generating PHP wrappers.
1913
19142022-11-05: wsfulton
1915 #2417 Fix -swiglib for Windows when building with CMake.
1916
19172022-11-02: wsfulton
1918 #2418 Fix infinite loop handling non-type template parameters.
1919
1920 Fixes infinite loop due to () brackets in a non-type template
1921 parameter containing an expression.
1922
19232022-10-28: wsfulton
1924 [R] R rtypecheck typemaps
1925
1926 Further switch to use rtypecheck typemaps instead of hard coded logic.
1927 The full switch to typemaps is deferred until swig-4.2 as it can't be fully
1928 backwards compatible. For now a warning is provided to help the
1929 transition. It provides the full typemap that should be placed into
1930 a user's interface file, for example:
1931
1932 %typemap("rtype") int32_t * "integer"
1933 void testmethod(int32_t * i);
1934 void testmethod();
1935
1936 If there is no rtypecheck typemap for int32_t *, the warning shown is:
1937
1938 example.i:7: Warning 750: Optional rtypecheck code is deprecated. Add the
1939 following typemap to fix as the next version of SWIG will not work without it:
1940 %typemap("rtypecheck") int32_t * %{ (is.integer($arg) || is.numeric($arg)) %}
1941
1942 The warning is shown for any code that previously used "numeric", "integer" or
1943 "character" for the rtype typemap. Copying the rtypecheck typemap as
1944 shown into the user interface file will provide the appropriate fix and
1945 the warning will disappear. This is important to do as swig-4.2 will
1946 not be able to provide this helpful warning.
1947
19482022-10-27: wsfulton
1949 [R] Allow NULL to be used in overloaded functions taking shared_ptr.
1950 Also fixes special variable $argtype expansion in rtypecheck typemaps.
1951
19522022-10-26: wsfulton
1953 [R] Improve R wrapper error message when calling overloaded methods
1954 when incorrect types passed are passed to the overloaded methods.
1955
1956 Old unhelpful error message:
1957 Error in f(...) : could not find function "f"
1958
1959 Example of new improved error message:
1960 Error in use_count(k) :
1961 cannot find overloaded function for use_count with argtypes (NULL)
1962
19632022-10-26: wsfulton
1964 [R] #2386 Fix memory leak in R shared_ptr wrappers.
1965 Fix leak when a cast up a class inheritance chain is required.
1966
William S Fultonfe2d7812022-11-04 20:09:13 +00001967Version 4.1.0 (24 Oct 2022)
1968===========================
1969
19702022-10-24: wsfulton, AndLLA
1971 [R] #2386 Fix problems in shared_ptr wrappers where the class names
1972 were not consistent when using the shared_ptr template or the actual
1973 underlying type.
1974
19752022-10-24: wsfulton
1976 [R] Add support for special variable replacement in the $typemap()
1977 special variable macro for R specific typemaps (rtype, rtypecheck,
1978 scoercein, scoereout).
1979
19802022-10-24: wsfulton
1981 [R] Polymorphism in the wrappers was only working for C++ classes,
1982 now this works for C++ structs too.
1983
19842022-10-19: olly
1985 [Lua] #2126 Fix type resolution between multiple SWIG-wrapped
1986 modules.
1987
19882022-10-17: wsfulton
1989 [R] #2385 Add support for std::vector<std::vector<std::string>>.
1990
19912022-10-14: murillo128
1992 [Javascript] #2109 Tweak unsigned long and unsigned long long typemaps
1993 to create a v8::Number instead of v8::Integer if the value exceeds
1994 the size of v8::Integer. Note that the v8::Number value will be
1995 imprecise if the value is > MAX_SAFE_INTEGER.
1996
19972022-10-14: olly
1998 [R] Arrange that destructors of local C++ objects in the wrapper
1999 function get run on SWIG_fail (which calls Rf_error() which calls
2000 longjmp()).
2001
20022022-10-14: olly
2003 [Lua] Arrange that destructors of local C++ objects in the wrapper
2004 function get run on SWIG_fail (which calls lua_error() which calls
2005 longjmp()).
2006
20072022-10-13: wsfulton
2008 [R] Add missing SWIGTYPE *const& typemaps for supporting pointers
2009 by const reference.
2010
20112022-10-10: wsfulton
2012 #2160 Fix compile error when using templates with more than one template
2013 parameter and used as an input parameter in a virtual method in a
2014 director class (problem affecting most of the scripting languages).
2015
20162022-10-10: treitmayr, wsfulton
2017 [Python, Ruby] #1811 #1823 Fix invalid code generated in some cases when
2018 returning a pointer or reference to a director-enabled class instance.
2019 This previously only worked in very simple cases, now return types are
2020 resolved to fix. A bug in template instantiations using pointers also
2021 works now.
2022
20232022-10-06: wsfulton
2024 [CFFI] #1966 #2200 Remove code for Common Lisp CFFI. We dropped support
2025 for it in SWIG 4.0.0 by disabling it as the first stage. This is the
2026 final stage for complete removal as there has been no meaningful
2027 progress to revive it to the status of experimental language.
2028
20292022-10-06: olly
2030 [Python] #2390 Remove deprecated and apparently useless defarg.swg
2031
2032 The only documentation is in the file itself and describes a Python
2033 wrapper around the C function defined here, but digging though the
2034 git history this Python wrapper doesn't seem to have ever actually
2035 been generated by SWIG.
2036
2037 This file was also marked as deprecated in 2005.
2038
20392022-10-06: wsfulton
2040 [Java] #2048 Fix quoting for doxygen \image command to quote the output
2041 file name generated into the html src attribute.
2042
20432022-10-05: benjamin-sch
2044 [Python] added an interpreter counter to fix deinitialization
2045 issues if multiple subinterpreters are used
2046
20472022-10-05: olly, wsfulton
2048 #672 Add support for parsing C++11 final classes such as:
2049
2050 class X final {};
2051
2052 This no longer gives a syntax error.
2053
20542022-10-05: wsfulton
2055 [OCaml] Fix %rename for enum items. Previously the rename had no effect.
2056
20572022-10-05: olly
2058 #1465 Report errors in preprocessor expressions by default
2059
2060 Until now SWIG quietly ignored such errors unless -Wextra (or -Wall
2061 which implies -Wextra) was passed, but this is unhelpful as it tends
2062 to hide genuine problems. To illustrate this point, enabling this
2063 warning by default revealed a typo in the preproc_defined.i
2064 testcase in SWIG's own testsuite.
2065
2066 If you really don't want to see this warning, you can suppress it
2067 with command line option -w202 or by using this in your interface
2068 file:
2069
2070 %warnfilter(SWIGWARN_PP_EVALUATION);
2071
2072 Both will work with older versions of SWIG too.
2073
20742022-10-04: olly
2075 #1050 Consistently define SWIG_VERSION both at SWIG-time and in
2076 the generated wrapper. Best practice remains to check at SWIG-time
2077 where possible because that results in smaller generated wrapper
2078 sources.
2079
2080 SWIGGO and SWIGJAVASCRIPT are now defined in the generated wrappers
2081 to match behaviour for all other target languages.
2082
2083 The undocumented SWIGVERSION macro is no longer defined.
2084
20852022-09-29: olly
2086 #2303 SWIG's internal hash tables now use a better hash function.
2087
2088 The old hash function only considerd the last five characters
2089 plus the least significant bit of the last-but-sixth character,
2090 which as you might guess generated a lot of many-way collisions.
2091
2092 This change seems to give about a 4% reduction in wallclock time
2093 for processing li_std_list_wrap.i from the testsuite for Python.
2094 The hash collision rate for this example drops from 39% to 0!
2095
20962022-09-29: wsfulton
2097 #2303 Type tables are now output in a fixed order whereas previously
2098 the order may change with any minor input code change. This shouldn't
2099 affect users except SWIG_TypePrettyName may output a different C/C++
2100 typedef to a type - it's used mostly for showing errors when the type
2101 passed to a function is wrong.
2102
21032022-09-29: olly
2104 [PHP] Dynamic class properties are no longer supported by default.
2105
2106 Historically PHP has supported dynamic class properties and SWIG
2107 has implemented them too (because we implement the magic __get(),
2108 __set() and __isset() methods we need to include explicit
2109 handling).
2110
2111 PHP 8.2 deprecates dynamic class properties - initially they'll
2112 warn, and apparently they'll not work by default in PHP 9.0:
2113 https://wiki.php.net/rfc/deprecate_dynamic_properties
2114
2115 In PHP code dynamic properties can be enabled for a class by
2116 marking that class with the attribute `#[AllowDynamicProperties]`.
2117
2118 To follow this PHP change, in SWIG you now need to specify
2119 `%feature("php:allowdynamicproperties", 1) Foo;` (or
2120 `%feature("php:allowdynamicproperties", 1)` to enable it for
2121 all wrapped classes). Unknown features are ignored, so you can add
2122 it unconditionally and it'll work with older SWIG too.
2123
2124 *** POTENTIAL INCOMPATIBILITY ***
2125
21262022-09-19: wsfulton
2127 #1484 Fixes for class inheritance with the same name in different namespaces
2128 such as:
2129
2130 namespace A { class Bar {}; }
2131 namespace B { template<typename T, typename U> class Bar : public A::Bar {}; }
2132
21332022-09-19: wsfulton
2134 #2316 Remove swig.spec file and srcrpm makefile target. These are very out of date
2135 and don't seem to be used by RPM based Linux distributions which have their
2136 own version of swig.spec.
2137
21382022-09-17: wsfulton
2139 [Go, Guile, Racket, Scilab] Add throws typemaps for std::string so that thrown
2140 string exception messages can be seen.
2141
21422022-09-17: wsfulton
2143 [Racket] Add throws typemaps for char * so that thrown string exception
2144 messages can be seen from Racket.
2145
21462022-09-17: wsfulton
2147 [Javascript, Octave, R] Improve exceptions for %catches and exception
2148 specifications for native types. String exception messages are shown as
2149 the exception message instead of just the type of the exception.
2150
21512022-09-17: wsfulton
2152 Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr to
2153 fix overloading when using these types.
2154
21552022-09-17: wsfulton
2156 [Guile] Add error checking to SWIGTYPE and SWIGTYPE & in typemaps to prevent
2157 seg faults when passing #nil to these parameter types.
2158
21592022-09-16: wsfulton
2160 #999 Provide SWIGTYPE MOVE typemaps in swigmove.i for implementing full
2161 move semantics when passing parameters by value.
2162
21632022-08-31: wsfulton
2164 #999 Improve move semantics when using rvalue references.
2165 The SWIGTYPE && input typemaps now assume the object has been moved.
2166
2167 These typemaps have been changed assuming that after the function call,
2168 the rvalue reference parameter has been moved. The parameter's proxy class
2169 that owns the C++ object thus has the underlying pointer set to null
2170 so that the (moved from, but still valid) C++ object cannot be used again
2171 and the object is additionally deleted.
2172
2173 *** POTENTIAL INCOMPATIBILITY ***
2174
21752022-08-28: wsfulton
2176 [Octave] SWIG now marshals a C/C++ NULL pointer into the null matrix, [].
2177 SWIG has always marshalled the null matrix into a NULL pointer; this remains
2178 and now we have consistency in representing a NULL pointer.
2179
21802022-08-26: wsfulton
2181 [Racket] SWIG now marshals a C/C++ NULL pointer into a null value by calling
2182 scheme_make_null(), so that scheme's null? is true for a NULL C/C++ pointer value.
2183
21842022-08-18: wsfulton
2185 [Racket] Add support for std::unique_ptr in std_unique_ptr.i.
2186 Add support for std::auto_ptr in std_auto_ptr.i.
2187
21882022-08-13: wsfulton
2189 [Guile] Add support for std::unique_ptr in std_unique_ptr.i.
2190 Add support for std::auto_ptr in std_auto_ptr.i.
2191
21922022-08-11: wsfulton
2193 [Lua] Add support for std::unique_ptr in std_unique_ptr.i.
2194 Add support for std::auto_ptr in std_auto_ptr.i.
2195
21962022-08-05: wsfulton
2197 [D] Fix occasional undefined behaviour with inheritance hierarchies, particularly
2198 when using virtual inheritance as the pointers weren't correctly upcast from derived
2199 class to base class when stored in the base's proxy class.
2200
22012022-08-05: wsfulton
2202 [D] Add support for std::unique_ptr in std_unique_ptr.i.
2203 Add support for std::auto_ptr in std_auto_ptr.i.
2204
22052022-08-03: wsfulton
2206 [Javascript] Add support for std::unique_ptr in std_unique_ptr.i.
2207 Add support for std::auto_ptr in std_auto_ptr.i.
2208
22092022-08-02: wsfulton
2210 [Octave] Add support for std::unique_ptr in std_unique_ptr.i.
2211 Add support for std::auto_ptr in std_auto_ptr.i.
2212
22132022-08-01: wsfulton
2214 [Python] Add initialisers for additional members in PyHeapTypeObject
2215 (builtin mode) for Python-3.11 - _ht_tpname, _spec_cache.
2216
22172022-07-30: wsfulton
2218 C++20 has deprecated std::basic_string<>::reserve() and the C++11 method
2219 std::basic_string<>::shrink_to_fit() is a replacement that can be used.
2220 std_string.i and std_wstring.i provided wrappers for reserve with the following
2221 template instantiations:
2222
2223 %template(string) std::basic_string<char>;
2224 %template(wstring) std::basic_string<wchar_t>;
2225
2226 The reserve method is no longer wrapped, however the shrink_to_fit() method
2227 can be used as an alternative from the target language (the generated wrappers
2228 call reserve() instead if C++<=20).
2229
2230 Note that std::basic_string<>::reserve(size_t n) is still wrapped unchanged.
2231
2232 *** POTENTIAL INCOMPATIBILITY ***
2233
22342022-07-30: wsfulton
2235 [Tcl] Add support for std::unique_ptr in std_unique_ptr.i.
2236 Add support for std::auto_ptr in std_auto_ptr.i.
2237
22382022-07-27: ZackerySpytz, olly
2239 #1678 Support parsing C++20 templated lambdas.
2240
22412022-07-27: ZackerySpytz, olly
2242 #1622 Add support for the C++20 spaceship operator (<=>).
2243
22442022-07-26: olly
2245 [Tcl] https://sourceforge.net/p/swig/bugs/977/
2246 Fix handling of long long on 32-bit platforms. This fix raises
2247 SWIG's minimum supported Tcl version to 8.4.0 (which was released
2248 just under 20 years ago).
2249
22502022-07-26: olly
2251 Fix incorrect operator precedence in preprocessor expressions.
2252
22532022-07-25: olly
2254 Support for C++14 binary integer literals in preprocessor expressions.
2255
22562022-07-20: wsfulton
2257 [C#, Java] Ensure the order of interfaces generated in proxy interfaces for the
2258 %interface family of macros is the same as that parsed from the bases in C++.
2259
22602022-07-20: jicks, Ingener74, olly
2261 #422 [Python] Fix mishandling of a Python class inheriting from
2262 multiple SWIG-wrapped director classes.
2263
22642022-07-19: wsfulton
2265 #692 [C#, Java, Perl, Python, Ruby] std::unique_ptr and std::auto_ptr typemaps
2266 provided for inputs types in std_unique_ptr.i and std_auto_ptr.i.
2267
2268 Now these smart pointers can be used as input parameters to functions. A proxy
2269 class instance transfers memory ownership of the underlying C++ object from the
2270 proxy class to a smart pointer instance passed to the wrapped function.
2271
22722022-07-19: jschueller
2273 [Python] #2314 Drop support for Python 3.2.
2274
22752022-07-19: olly
2276 Remove remaining support code for classic macos, which has not been
2277 supported by Apple for over 20 years now.
2278
22792022-07-12: wsfulton
2280 #999 Performance optimisation for parameters passed by value that are C++11 movable.
2281 The C++ wrappers create a temporary variable for a parameter to be passed to a
2282 function. This is initially default constructed and then copy assigned from the
2283 instance being passed in from the target language. This is unchanged, however,
2284 when the temporary variable is passed to the wrapped function, it is now done using
2285 std::move. If the type is move constructible, the move constructor will be used
2286 instead of the copy constructor.
2287
22882022-07-12: wsfulton
2289 [Perl] Add std::auto_ptr support in std_auto_ptr.i library file.
2290
22912022-07-12: erezgeva
2292 [Perl] Add std::unique_ptr support in std_unique_ptr.i library file.
2293
22942022-07-07: jmarrec
2295 #1158 #2286 Add basic support for C++11 attributes. These are now
Olly Bettsf2945422023-01-27 11:21:47 +13002296 crudely ignored by SWIG's parser's tokeniser, which is better than
William S Fultonfe2d7812022-11-04 20:09:13 +00002297 failing with a parse error.
2298
22992022-07-05: ianlancetaylor
2300 [Go] #2245 Handle NULL pointers for string* conversions.
2301 Rearrange generation of director methods and rename
2302 receiver argument from p to swig_p.
2303
23042022-07-03: wsfulton
2305 #999 Performance optimisation for directors for classes passed by value. The directorin
2306 typemaps in the director methods now use std::move on the input parameter when
2307 copying the object from the stack to the heap prior to the callback into the target
2308 language, thereby taking advantage of move semantics if available.
2309
23102022-07-02: wsfulton
2311 #1722 [C#, Java, Python, Ruby] Add std::unique_ptr support. Ported from std::auto_ptr.
2312 Use the %unique_ptr(T) macro as follows for usage std::unique_ptr<T>. For example, for
2313 a class called Klass:
2314
2315 %include "std_unique_ptr.i"
2316 %unique_ptr(Klass)
2317
2318 Support is currently limited to only returning a std::unique_ptr from a function.
2319
23202022-06-29: wsfulton
2321 #999 #1044 Enhance SWIGTYPE "out" typemaps to use std::move when copying
2322 objects, thereby making use of move semantics when wrapping a function returning
2323 by value if the returned type supports move semantics.
2324
2325 Wrapping functions that return move only types 'by value' now work out the box
2326 without having to provide custom typemaps.
2327
2328 The implementation removed all casts in the "out" typemaps to allow the compiler to
2329 appropriately choose calling a move constructor, where possible, otherwise a copy
2330 constructor. The implementation also required modifying SwigValueWrapper to
2331 change a cast operator from:
2332
2333 SwigValueWrapper::operator T&() const;
2334
2335 to
2336
2337 #if __cplusplus >=201103L
2338 SwigValueWrapper::operator T&&() const;
2339 #else
2340 SwigValueWrapper::operator T&() const;
2341 #endif
2342
2343 This is not backwards compatible for C++11 and later when using the valuewrapper feature
2344 if a cast is explicitly being made in user supplied "out" typemaps. Suggested change
2345 in custom "out" typemaps for C++11 and later code:
2346
2347 1. Try remove the cast altogether to let the compiler use an appropriate implicit cast.
2348 2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the
2349 __cplusplus macro if all versions of C++ need to be supported.
2350
2351 *** POTENTIAL INCOMPATIBILITY ***
2352
23532022-06-15: wsfulton
2354 #2039 Add move assignment operator to SwigValueWrapper used by the
2355 valuewrapper feature.
2356
23572022-06-04: sethrj
2358 Enhance $typemap to support typemap attributes.
2359
2360 $typemap(method:attribute, typepattern)
2361
2362 For example:
2363
2364 %typemap(cstype, out="object") XClass "XClass"
2365 %typemap(cscode) BarClass %{
2366 $typemap(cstype:out, XClass) bar() {
2367 return null;
2368 }
2369
2370 which expands to
2371
2372 object bar() {
2373 return null;
2374 }
2375
23762022-05-30: wsfulton
2377 [C#, D] Add new special variable expansion: $imfuncname.
2378 Expands to the function name called in the intermediary class.
2379
23802022-05-30: LindleyF
2381 [Java] #2042 Add new special variable expansion: $imfuncname.
2382 Expands to the function name called in the intermediary class.
2383
23842022-05-28: jkuebart
2385 [Java] On some versions of Android, specifically Android 6,
2386 detaching the current thread from the JVM after every invocation
2387 causes a memory leak.
2388
2389 Offer SWIG_JAVA_DETACH_ON_THREAD_END to configure a behaviour
2390 where the JVM is only detached in the thread destructor.
2391
2392 See https://developer.android.com/training/articles/perf-jni#threads.
2393
23942022-05-27: xypron
2395 [Python] #2277 Define PY_SSIZE_T_CLEAN macro before #include "Python.h" as
2396 recommended in Python 3.7 and later.
2397
2398 To avoid this macro definition, add the following to your interface file so
2399 that SWIG_NO_PY_SSIZE_T_CLEAN is defined at the beginning of the C++ wrappers:
2400
2401 %begin %{
2402 #define SWIG_NO_PY_SSIZE_T_CLEAN
2403 %}
2404
24052022-05-26: rokups
2406 [C#] #1323 Modify SwigDerivedClassHasMethod for a more efficient director
2407 implementation when calling virtual methods that are not overridden.
2408
24092022-05-15: erezgeva, eiselekd
2410 [Lua, Perl, Octave, PHP, Tcl] #2275 #2276 #2283 Add argcargv.i library containing
2411 (int ARGC, char **ARGV) multi-argument typemaps.
2412
2413 Document this library in Typemaps.html.
2414
24152022-05-07: KrisThielemans
2416 [Python] Fix "too many initializers for 'PyHeapTypeObject'" errors
2417 using PyPy 3.8 and later.
2418
24192022-05-04: wsfulton
2420 [C#] Add C# wchar_t * director typemaps
2421
24222022-04-20: cminyard
2423 Fix an issue where newlines were not properly generated
2424 for godirectorin typemaps. If you have a virtual function
2425 not assigned to zero, in some cases it won't generate a
2426 newline and you will see errors:
2427 example.go:1508:3: expected ';', found swig_r
2428 when compiling the go code.
2429
2430 Also add an example of using goin and godirectorin and add
2431 a test for this situation.
2432
24332022-04-29: jason-daly, JerryJoyce, wsfulton
2434 [C#] #1233 Add wchar_t * and std::wstring Unicode string support on Linux.
2435
24362022-04-11: robinst
2437 #2257 Fix new Ruby 3.2 warning "undefining the allocator of T_DATA
2438 class swig_runtime_data".
2439
24402022-04-07: olly
2441 #1750 SWIG now recognises and ignores Doxygen group commands `@{` and `@}`.
2442
24432022-04-06: wsfulton
2444 ./configure now enables C++11 and later C++ standards testing by default (when
2445 running: 'make check').
2446
2447 The options to control this testing are the same:
2448
2449 ./configure --enable-cpp11-testing
2450 ./configure --disable-cpp11-testing
2451
2452 But the former is now the default and the latter can be used to turn off C++11 and
2453 later C++ standards testing.
2454
24552022-04-06: wsfulton
2456 [Python] #1635 The "autodoc" feature no longer overrides Doxygen comments
2457 in the generated docstring.
2458
2459 If a "docstring" feature is present it will still override a Doxygen comment.
2460 If the "autodoc" feature is also present, the combined "autodoc" and "docstring"
2461 will override the Doxygen comment. If no "docstring" is present then the
2462 "autodoc" feature will not be generated when there is a Doxygen comment.
2463
2464 This way the "autodoc" feature can be specified and used to provide documentation
2465 for 'missing' Doxygen comments.
2466
2467 *** POTENTIAL INCOMPATIBILITY ***
2468
24692022-04-01: olly
2470 Remove undocumented and non-functional -browse command line option.
2471
24722022-03-26: eltoder
2473 [Python] #1684 Use different capsule names with and without -builtin
2474
2475 Types generated with and without -builtin are not compatible. Mixing
2476 them in a common type list leads to crashes. Avoid this by using
2477 different capsule names: "type_pointer_capsule" without -builtin and
2478 "type_pointer_capsule_builtin" with.
2479
24802022-03-25: wsfulton
2481 The debug command line options that display parse tree nodes
2482 (-debug-module, -debug-top, -debug-symtabs) now display previously hidden
2483 linked list pointers which are useful for debugging parse trees.
2484
2485 Added new command line option -debug-quiet. This suppresses the display
2486 of most linked list pointers and symbol table pointers in the parse tree nodes.
2487
2488 The keys in the parse tree node are now shown in alphabetical order.
2489
24902022-03-24: wsfulton
2491 #2244 Fix using declaration in derived class bugs when all the base
2492 class's overloaded methods were overridden in the derived class -
2493 fixes "multiply defined" errors.
2494
24952022-03-23: wsfulton
2496 [Python] #1779 The -py3 option is deprecated and now has no effect on the
2497 code generated. Use of this option results in a deprecated warning.
2498 The related SWIGPYTHON_PY3 macro that this option defined is no longer generated.
2499
2500 Note that %pythonnondynamic feature generates a metaclass that works on both
2501 Python 2 and Python 3.
2502
25032022-03-21: wsfulton
2504 [Python] #1779 pyabc.i for abstract base classes now supports versions of
2505 Python prior to 3.3 by using the collection module for these older versions.
2506 Python-3.3 and later continue to use the collections.abc module.
2507 The -py3 option no longer has any effect on the %pythonabc feature.
2508
25092022-03-21: jschueller, jim-easterbrook, wsfulton
2510 [Python] #2137 C++ static member functions no longer generate a "flattened"
2511 name in the Python module. For example:
2512
2513 s = example.Spam()
2514 s.foo() # Spam::foo() via an instance
2515 example.Spam.foo() # Spam::foo() using class method
2516 example.Spam_foo() # Spam::foo() "flattened" name
2517
2518 The "flattened" name is no longer generated, but can be generated
2519 by using the new -flatstaticmethod option.
2520
2521 *** POTENTIAL INCOMPATIBILITY ***
2522
25232022-03-18: ianlancetaylor
2524 [Go] #337 Implement %extend base methods in child classes.
2525
25262022-03-17: olly
2527 [Python] #1779 SWIG's Python test-suite and examples are now
2528 run with Python 3 by default. To run them with Python 2, set
2529 PY2 to a non-empty value, e.g.:
2530
2531 make check-python-test-suite PY2=1
2532
25332022-03-16: olly
2534 [Go] #683 -intgosize is now optional - if not specified the
2535 generated C/C++ wrapper code will use ptrdiff_t for intgo and
2536 size_t for uintgo.
2537
25382022-03-15: ianlancetaylor
2539 [Go] Add typemaps for std::string*.
2540
25412022-03-15: ianlancetaylor
2542 [Go] Don't convert arrays to pointers if there is a "gotype"
2543 typemap entry.
2544
25452022-03-15: ianlancetaylor
2546 [Go] Add documentation note about Go and C++ exceptions.
2547
25482022-03-12: wsfulton
2549 #1524 %interface family of macros no longer contain the getter/setter
2550 methods for wrapping variables. The interface only contains
2551 virtual and non-virtual instance methods, that is, no static methods.
2552 Enums are also no longer added to the interface (affects Java only where
2553 they were missing from the proxy class, C# never had them in the interface).
2554
2555 *** POTENTIAL INCOMPATIBILITY ***
2556
25572022-03-12: wsfulton
2558 #1277 Fixes for the family of %interface macros, %interface,
2559 %interface_impl and %interface_custom fixes for overloaded methods
2560 in an inheritance chain.
2561
2562 When C++ methods are not able to be overloaded in a derived class,
2563 such as when they differ by just const, or the target language
2564 parameters types are identical even when the C++ parameter types
2565 are different, SWIG will ignore one of the overloaded methods with
2566 a warning. A %ignore is required to explicitly ignore one of the
2567 overloaded methods to avoid the warning message. Methods added
2568 in the derived classes due to one of the %interface macros are now
2569 similarly ignored/not added to the derived class.
2570
2571 The methods added to the derived classes can now also be modified
2572 via %feature and %rename.
2573
25742022-03-08: ianlancetaylor
2575 [Go] Treat a nil argument as a NULL pointer.
2576
25772022-03-08: ianlancetaylor
2578 [Go] Add documentation notes about thread local storage.
2579
25802022-03-08: olly
2581 #1006 SWIG now copes with an interface filename specified on the
2582 command line which contains a closing parenthesis `)`, and more
2583 generally with attributes to `%include` and `%import` which
2584 are quoted and contain parentheses.
2585
25862022-03-07: Omar Medina
2587 [Tcl] https://sourceforge.net/p/swig/bugs/1290/
2588 Fix SWIG_AsWCharPtrAndSize() to actually assign to result
2589 variable. It looks like SWIG/Tcl wide character handling is
2590 currently fundamentally broken except on systems which use wide
2591 characters as the system encoding, but this should fix wrapping
2592 functions which take a wide string as a parameter on Microsoft
2593 Windows.
2594
25952022-03-07: olly
2596 [Javascript] #682 Fix handling of functions which take void*.
2597
25982022-03-06: olly
2599 SWIG should now reliably exit with status 0 if the run was
2600 successful and status 1 if there was an error (or a warning and
2601 -Werror was in effect).
2602
2603 Previously in some situations SWIG would try to exit with the
2604 status set to the number of errors encountered, but that's
2605 problematic - for example if there were 256 errors this would
2606 result in exit status 0 on most platforms. Also some error
2607 statuses have special meanings e.g. those defined by <sysexits.h>.
2608 Also SWIG/Javascript tried to exit with status -1 in a few places
2609 (which typically results in exit status 255).
2610
26112022-03-05: wsfulton
2612 #1441 Fix using declaration in derived class incorrectly introducing a method
2613 from a base class when the using declaration is declared before the method
2614 declaration. Problem occurred when within a namespace and the parameter types
2615 in the method signatures were not fully qualified.
Olly Bettsf2945422023-01-27 11:21:47 +13002616
William S Fultonfe2d7812022-11-04 20:09:13 +000026172022-03-05: ianlancetaylor
2618 [Go] Treat non-const references as pointers.
2619
26202022-03-05: ianlancetaylor
2621 In SWIG Go testsuite, fail test if "go build" fails.
2622
26232022-03-03: olly
2624 #1901 #2223 SWIG should now always exit cleanly if memory
2625 allocation fails, including removing any output files created
2626 during the current run.
2627
2628 Previously most places in the code didn't check for a NULL return
2629 from malloc()/realloc()/calloc() at all, typically resulting in
2630 undefined behaviour; some places used assert() to check for a NULL
2631 return (which is a misuse of assert() and such checks disappear if
2632 built with NDEBUG defined leaving us back with undefined
2633 behaviour).
2634
26352022-03-03: olly
2636 #891 Report errors for typemap attributes without a value
2637 (previously SWIG segfaulted) and for typemap types with a value
2638 (previously the value was quietly ignored).
2639
2640 The old way of specifying a language name in the typemap attributes
2641 is no longer supported (it has been deprecated for 16 years).
2642
26432022-03-02: geographika, wsfulton
2644 [Python] #1951 Add Python variable annotations support.
2645
2646 Both function annotations and variable annotations are turned on using the
2647 "python:annotations" feature. Example:
2648
2649 %feature("python:annotations", "c");
2650
2651 struct V {
2652 float val;
2653 };
2654
2655 The generated code contains a variable annotation containing the C float type:
2656
2657 class V(object):
2658 val: "float" = property(_example.V_val_get, _example.V_val_set)
2659 ...
2660
2661 Python 3.5 and earlier do not support variable annotations, so variable
2662 annotations can be turned off with a "python:annotations:novar" feature flag.
2663 Example turning on function annotations but not variable annotations globally:
2664
2665 %feature("python:annotations", "c");
2666 %feature("python:annotations:novar");
2667
2668 or via the command line:
2669
2670 -features python:annotations=c,python:annotations:novar
2671
2672 *** POTENTIAL INCOMPATIBILITY ***
2673
26742022-02-27: wsfulton
2675 [Python] #735 #1561 Function annotations containing C/C++ types are no longer
2676 generated when using the -py3 option. Function annotations support has been
2677 moved to a feature to provide finer grained control. It can be turned on
2678 globally by adding:
2679
2680 %feature("python:annotations", "c");
2681
2682 or by using the command line argument:
2683
2684 -features python:annotations=c
2685
2686 Also see entry dated 2022-03-02, regarding variable annotations.
2687
2688 *** POTENTIAL INCOMPATIBILITY ***
2689
26902022-02-26: wsfulton
2691 #655 #1840 Add new warning WARN_LANG_USING_NAME_DIFFERENT to warn when a
2692 method introduced by a using declaration in a derived class cannot
2693 be used due to a conflict in names.
2694
26952022-02-24: olly
2696 #1465 An invalid preprocessor expression is reported as a pair of
2697 warnings with the second giving a more detailed message from the
2698 expression evaluator. Previously SWIG prefixed the second message
2699 with "Error:" - that was confusing as it's actually only a warning
2700 by default so we've now dropped this prefix.
2701
2702 Before:
2703
2704 x.i:1: Warning 202: Could not evaluate expression '1.2'
2705 x.i:1: Warning 202: Error: 'Floating point constant in preprocessor expression'
2706
2707 Now:
2708
2709 x.i:1: Warning 202: Could not evaluate expression '1.2'
2710 x.i:1: Warning 202: Floating point constant in preprocessor expression
2711
27122022-02-23: olly
2713 #1384 Fix a preprocessor expression evaluation bug. A
2714 subexpression in parentheses lost its string/int type flag and
2715 instead used whatever type was left in the stack entry from
2716 previous use. In practice we mostly got away with this because
2717 most preprocessor expressions are integer, but it could have
2718 resulted in a preprocessor expression incorrectly evaluating as
2719 zero. If -Wextra was in use you got a warning:
2720
2721 Warning 202: Error: 'Can't mix strings and integers in expression'
2722
27232022-02-21: davidcl
2724 [Scilab] Improve 5.5.2, 6.0.0 and 6.1.0 support.
2725
2726 For Scilab 5, long names are reduced to small names preserving the
2727 class prefix and accessor suffix (get or set).
2728
2729 For Scilab 6, long names with the class prefix and accessor suffix
2730 should be used on the user code.
2731
2732 The `-targetversion` option has been removed as the generated code
2733 now detects the Scilab version in loader.sce or builder.sce.
2734
2735 *** POTENTIAL INCOMPATIBILITY ***
2736
27372022-02-20: wsfulton
2738 Fix %warnfilter warning suppress for warning 315 SWIGWARN_PARSE_USING_UNDEF.
2739
27402022-02-17: olly
2741 [PHP] https://sourceforge.net/p/swig/bugs/1211/
2742 Fix to call cleanup code in exception situations and not to invoke
2743 the freearg typemap twice in certain situations.
2744
27452022-02-15: olly
2746 #300 #368 Improve parser handling of % followed immediately by
2747 an identifier. If it's not a recognised directive the scanner
2748 now emits MODULO and then rescans what follows, and if the parser
2749 then gives a syntax error we report it as an unknown directive.
2750 This means that `a%b` is now allowed in an expression, and that
2751 things like `%std::vector<std::string>` now give an error rather
2752 than being quietly ignored.
2753
27542022-02-11: adr26
2755 [Python] #2154 Fix memory leak.
2756
2757 SWIG python objects were being freed after the corresponding SWIG
2758 module information was destroyed in Python 3, causing leaks when as
2759 a result the object destructor could not be invoked. To prevent this
2760 misordering, SWIG python objects now obtain a reference to the
2761 Python capsule wrapping the module information, so that the module
2762 information is correctly destroyed after all SWIG python objects
2763 have been freed (and corresponding destructors invoked).
2764
27652022-02-10: olly
2766 [Tcl] https://sourceforge.net/p/swig/bugs/1207/
2767 https://sourceforge.net/p/swig/bugs/1213/
2768
2769 Fix Tcl generic input typemap for std::vector.
2770
27712022-02-07: sethrj
2772 #2196 Add alternative syntax for specifying fragments in typemaps.
2773
2774 New syntax:
2775 %typemap("in", fragment="frag1", fragment="frag2", fragment="frag3") {...}
2776 which is equivalent to:
2777 %typemap(in, fragment="frag1,frag2,frag3") {...}
2778
2779
27802022-02-07: olly
2781 #1806 Remove support for the "command" encoder, which was mostly
2782 intended for use in `%rename` - most uses can be achieved using
2783 the "regex" encoder, so we recommend using that instead.
2784
2785 The "command" encoder suffers from a number of issues - as the
2786 documentation for it admitted, "[it] is extremely slow compared to
2787 all the other [encoders] as it involves spawning a separate process
2788 and using it for many declarations is not recommended" and that it
2789 "should generally be avoided because of performance
2790 considerations".
2791
2792 But it's also not portable. The design assumes that `/bin/sh`
2793 supports `<<<` but that's a bash-specific feature so it doesn't
2794 work on platforms where `/bin/sh` is not bash - it fails on
2795 Debian, Ubuntu and probably some other Linux distros, plus most
2796 non-Linux platforms. Microsoft Windows doesn't even have a
2797 /bin/sh as standard.
2798
2799 Finally, no escaping of the passed string is done, so it has
2800 potential security issues (though at least with %rename the input
2801 is limited to valid C/C++ symbol names).
2802
28032022-02-06: olly
2804 #2193 -DFOO on the SWIG command line now sets FOO to 1 for
2805 consistency with C/C++ compiler preprocessors. Previously
2806 SWIG set FOO to an empty value.
2807
2808 Existing invocations of SWIG with `-DFOO` where the empty value
2809 matters can be updated to `-DFOO=` which should work with both
2810 old and new releases of SWIG.
2811
2812 *** POTENTIAL INCOMPATIBILITY ***
2813
28142022-02-06: sethrj
2815 #2194 Classes that are non-assignable due to const data or const
2816 reference members are now automatically detected.
2817
28182022-02-04: friedrichatgc
2819 [Octave] #1672 Fix for isobject for Octave 4.4 - 6.0.
2820
28212022-02-03: olly
2822 [C#] #283 #998 Fix memory leak in directorin typemap for
2823 std::string.
2824
28252022-02-03: olly
2826 [Python] #967 Make `self` parameter available to user typemaps.
2827
28282022-02-03: teythoon
2829 [Python] #801 Fix -Wunused-parameter warnings with builtin,
2830
28312022-02-03: teythoon
2832 #801 Fix -Wstrict-prototypes warnings in generated pointer
2833 functions.
2834
28352022-02-03: olly
2836 #660 https://sourceforge.net/p/swig/bugs/1081/
2837 Default parameter values containing method calls are now parsed and
2838 handled - e.g. `x->foo(3,4)` and `y.z()`.
2839
28402022-02-02: olly
2841 [Ruby] https://sourceforge.net/p/swig/bugs/1136/ Fix remove of prefix
2842 from method name to only remove it at the start.
2843
28442022-02-01: olly
2845 #231 Handle returning an object by reference in a C++ trailing
2846 return type.
2847
28482022-02-01: davidcl
2849 [Scilab] #745 use SWIG_<module>_Init() as a C module init function.
2850
28512022-02-01: olly
2852 [OCaml] #2083 Fix to work when CAML_SAFE_STRING is on, which it is
2853 by default in recent Ocaml releases.
2854
28552022-01-31: mreeez
2856 https://sourceforge.net/p/swig/bugs/1147/
2857 Fix copyToR() generated for a struct in a namespace.
2858
28592022-01-29: fschlimb
2860 #655 Better handling of using declarations.
2861
28622022-01-29: dontpanic92
2863 [Go] #676 Fix code generated for a C++ class with a non-capitalised
2864 name.
2865
28662022-01-26: trex58
2867 #1919 #1921 #1923 Various fixes for AIX portability.
2868
28692022-01-26: olly
2870 #1935 Don't crash on an unclosed HTML tag in a doxygen comment
2871 when -doxygen is specified.
2872
28732022-01-25: olly
2874 Constant expressions now support member access with `.` such as
2875 `foo.bar`. Previous this only worked in a case like `x->foo.bar`.
2876
28772022-01-25: olly
2878 #2091 Support most cases of `sizeof` applied to an expression
2879 in constant expressions. Previously there was only support for
2880 `sizeof(<type>)` and expressions which syntactically look like a
2881 type (such as `sizeof(foo)`).
2882
28832022-01-25: olly
2884 #80 #635 https://sourceforge.net/p/swig/bugs/1139/
2885 Add support for parsing common cases of `<` and `>` comparisons
2886 in constant expressions. Adding full support for these seems hard
2887 to do without introducing conflicts into the parser grammar, but in
2888 fact all reported cases have had parentheses around the comparison
2889 and we can support that with a few restrictions on the left side of
2890 `<`.
2891
28922022-01-25: wsfulton
2893 New warning 327 for extern templates, eg:
2894
2895 extern template class std::vector<int>;
2896 extern template void Func<int>();
2897
2898 results in warning
2899
2900 example.i:3: Warning 327: Extern template ignored.
2901 example.i:4: Warning 327: Extern template ignored.
2902
2903 Extern template classes previously resulted in warning 320.
2904
29052022-01-24: romintomasetti
2906 #2131 #2157 C++11 extern function template parsing error fix.
2907
29082022-01-21: wsfulton
2909 #2120 #2138 Replace legacy PCRE dependency with PCRE2.
2910 This requires changes for building SWIG from source. See updated
2911 html documentation in Preface.html and Windows.html. Updated
2912 instructions are also shown when running ./configure if PCRE2 is not
2913 found. Note that debian based systems can install PCRE2 using:
2914
2915 apt install libpcre2-dev
2916
2917 Note that https://github.com/swig/swig/wiki/Getting-Started also has
2918 updated information for building from source.
2919
29202022-01-19: olly
2921 [PHP] #2027 Automatically generate PHP type declarations for PHP 8.
2922 The generate code still compiles for PHP 7.x, but without type
2923 declarations since PHP 7.x has much more limited type declaration
2924 support.
2925
29262022-01-18: olly
2927 [Perl] #1629 Perl 5.8.0 is now the oldest version we aim to support.
2928
29292022-01-14: wsfulton
2930 [Python] Fix %callback and specifying the callback function as a
2931 static member function using Python staticmethod syntax, such as
2932 Klass.memberfunction instead of Klass_memberfunction when using
2933 -builtin and -fastproxy.
2934
29352022-01-11: wsfulton
2936 [Python] Accept keyword arguments accessing static member functions when
2937 using -builtin and kwargs feature and Python class staticmethod syntax.
2938 The missing keyword argument support was only when using the
2939 class staticmethod syntax, such as Klass.memberfunction, and not when
2940 using the flat static method syntax, such as Klass_memberfunction.
2941
29422022-01-04: juierror
2943 [Go] #2045 Add support for std::array in std_array.i.
2944
29452021-12-18: olly
2946 [PHP] Add PHP keyword 'readonly' (added in 8.1) to the list SWIG
2947 knows to automatically rename. This keyword is special in that PHP
2948 allows it to be used as a function (or method) name.
2949
29502021-12-07: vstinner
2951 [Python] #2116 Python 3.11 support: use Py_SET_TYPE()
2952
29532021-12-05: rwf1
2954 [Octave] #2020 #1893 Add support for Octave 6 up to and including 6.4.
2955 Also add support for compiling with -Bsymbolic which is used by default
2956 by mkoctfile.
2957
29582021-12-02: jsenn
2959 [Python] #2102 Fixed crashes when using embedded Python interpreters.
2960
29612021-11-12: wsfulton
2962 [Javascript] v8 and node only. Fix mismatched new char[] and free()
2963 when wrapping C code char arrays. Now calloc is now used instead of
2964 new char[] in SWIG_AsCharPtrAndSize.
2965
29662021-10-03: ajrh1
2967 [Perl] #2074: Avoid -Wmisleading-indentation in generated code
2968 when using gcc11.
2969
29702021-10-03: jschueller
2971 [CMake] #2065: Add option to enable or disable PCRE support.
2972
29732021-09-16: ianlancetaylor
2974 [Go] Improved _cgo_panic implementation.
2975
29762021-09-16: ianlancetaylor
2977 [Go] Don't use crosscall2 for panicking. Instead rely on documented
2978 and exported interfaces.
2979
29802021-09-14: ianlancetaylor
2981 [Go] Remove -no-cgo option (long unsupported in Go)
2982
29832021-05-04: olly
2984 [PHP] #2014 Throw PHP exceptions instead of using PHP errors
2985
2986 PHP exceptions can be caught and handled if desired, but if they
2987 aren't caught then PHP exits in much the same way as it does for a
2988 PHP error.
2989
2990 In particular this means parameter type errors and some other cases
2991 in SWIG-generated wrappers now throw a PHP exception, which matches
2992 how PHP's native parameter handling deals with similar situations.
2993
2994 `SWIG_ErrorCode()`, `SWIG_ErrorMsg()`, `SWIG_FAIL()` and `goto thrown;`
2995 are no longer supported (these are really all internal implementation
2996 details and none are documented aside from brief mentions in CHANGES
2997 for the first three). I wasn't able to find any uses in user interface
2998 files at least in FOSS code via code search tools.
2999
3000 If you are using these:
3001
3002 Use `SWIG_PHP_Error(code,msg);` instead of `SWIG_ErrorCode(code);
3003 SWIG_ErrorMsg(msg);` (which will throw a PHP exception in SWIG >= 4.1
3004 and do the same as the individual calls in older SWIG).
3005
3006 `SWIG_FAIL();` and `goto thrown;` can typically be replaced with
3007 `SWIG_fail;`. This will probably also work with older SWIG, but
3008 please test with your wrappers if this is important to you.
3009
3010 *** POTENTIAL INCOMPATIBILITY ***
3011
30122021-05-17: adr26
3013 [Python] #1985 Fix memory leaks:
3014
3015 1. Python object references were being incorrectly retained by
3016 SwigPyClientData, causing swig_varlink_dealloc() never to run / free
3017 memory. SwigPyClientData_New() / SwigPyClientData_Del() were updated
3018 to fix the object reference counting, causing swig_varlink_dealloc()
3019 to run and the memory swig_varlink owns to be freed.
3020
3021 2. SwigPyClientData itself was not freed by SwigPyClientData_Del(),
3022 causing another heap leak. The required free() was added to
3023 SwigPyClientData_Del()
3024
3025 3. Fix reference counting/leak of python cached type query
3026
3027 4. Fix reference counting/leak of SwigPyObject dict (-builtin)
3028
3029 5. Python object reference counting fixes for out-of-memory
3030 scenarios were added to: SWIG_Python_RaiseOrModifyTypeError(),
3031 SWIG_Python_AppendOutput(), SwigPyClientData_New(),
3032 SwigPyObject_get___dict__() and SwigPyObject_format()
3033
3034 6. Add error handling for PyModule_AddObject() to
3035 SWIG_Python_SetModule() (failure could be caused by OOM or a name
3036 clash caused by malicious code)
3037
30382021-05-13: olly
3039 [UFFI] #2009 Remove code for Common Lisp UFFI. We dropped support
3040 for it in SWIG 4.0.0 and nobody has stepped forward to revive it in
3041 over 2 years.
3042
30432021-05-13: olly
3044 [S-EXP] #2009 Remove code for Common Lisp S-Exp. We dropped
3045 support for it in SWIG 4.0.0 and nobody has stepped forward to
3046 revive it in over 2 years.
3047
30482021-05-13: olly
3049 [Pike] #2009 Remove code for Pike. We dropped support for it in
3050 SWIG 4.0.0 and nobody has stepped forward to revive it in over 2
3051 years.
3052
30532021-05-13: olly
3054 [Modula3] #2009 Remove code for Modula3. We dropped support for it
3055 in SWIG 4.0.0 and nobody has stepped forward to revive it in over 2
3056 years.
3057
30582021-05-13: olly
3059 [CLISP] #2009 Remove code for GNU Common Lisp. We dropped support
3060 for it in SWIG 4.0.0 and nobody has stepped forward to revive it in
3061 over 2 years.
3062
30632021-05-13: olly
3064 [Chicken] #2009 Remove code for Chicken. We dropped support for it
3065 in SWIG 4.0.0 and nobody has stepped forward to revive it in over 2
3066 years.
3067
30682021-05-13: olly
3069 [Allegrocl] #2009 Remove code for Allegro Common Lisp. We dropped
3070 support for it in SWIG 4.0.0 and nobody has stepped forward to
3071 revive it in over 2 years.
3072
30732021-05-04: olly
3074 [PHP] #1982 #1457 https://sourceforge.net/p/swig/bugs/1339/
3075 SWIG now only use PHP's C API to implement its wrappers, and no
3076 longer generates PHP code to define classes. The wrappers should
3077 be almost entirely compatible with those generated before, but
3078 faster and without some previously hard-to-fix bugs.
3079
3080 The main notable difference is SWIG no longer generates a .php
3081 wrapper at all by default (only if %pragma(php) code=... or
3082 %pragma(php) include=... are specified in the interface file).
3083 This also means you need to load the module via extension=...
3084 in php.ini, rather than letting the dl() in the generated
3085 .php wrapper load it (but dl() has only worked for command-line
3086 PHP for some years now).
3087
3088 *** POTENTIAL INCOMPATIBILITY ***
3089
30902021-04-30: olly
3091 #1984 Remove support for $source and $target.
3092 These were officially deprecated in 2001, and attempts to use them have
3093 resulted in a warning (including a pointer to what to update them to)
3094 for most if not all of that time.
3095
30962021-04-27: wsfulton
3097 #1987 [Java] Fix %interface family of macros for returning by const
3098 pointer reference.
3099
31002021-04-19: olly
3101 Fix use of uninitialised variable in the generated code for an
3102 empty typecheck typemap, such as the dummy one we include for
3103 std::initializer_list.
3104
31052021-04-12: olly
3106 #1777 [Python] Specifying -py3 now generates a check for Python
3107 version >= 3.0.
3108
31092021-03-26: olly
3110 [PHP] Add PHP keywords 'fn' (added in 7.4) and 'match' (added in
3111 8.0) to the list SWIG knows to automatically rename.
3112
31132021-03-23: wsfulton
3114 #1942 [Python] Fix compilation error in wrappers when using -builtin
3115 and wrapping varargs in constructors.
3116
31172021-03-22: goto40
3118 #1977 Fix handling of template template parameters.
3119
31202021-03-21: olly
3121 #1929, #1978 [PHP] Add support for PHP 8.
3122
31232021-03-19: wsfulton
3124 #1610 Remove -ansi from default compilation flags.
3125
31262021-03-19: dot-asm
3127 #1934 [Java] Clean up typemaps for long long arrays.
3128
31292021-03-19: olly
3130 #1527 [PHP] Improve PHP object creation in directorin case.
3131 Reportedly the code we were using in this case gave segfaults in
3132 PHP 7.2 and later - we've been unable to reproduce these, but the
3133 new approach is also simpler and should be bit faster too.
3134
31352021-03-18: olly
3136 #1655 [PHP] Fix char* typecheck typemap to accept PHP Null like the
3137 corresponding in typemap does.
3138
31392021-03-18: olly
3140 #1900, #1905 [PHP] Fix wrapping of overloaded directed methods with
3141 non-void return.
3142
31432021-03-11: murillo128
3144 #1498 [Javascript] Support type conversion.
3145
31462021-03-06: nshmyrev
3147 #872 [Javascript] Various typemap issues in arrays_javascript.i fixed.
3148
31492021-03-03: vaughamhong
3150 #577 [Javascript] Implemented SetModule/GetModule for JSC to allow type sharing
3151 across modules.
3152
31532021-03-01: xantares, Oliver Buchtala, geographika
3154 #1040 Add support for building SWIG with CMake. See documentation in Windows.html.
3155
31562021-03-01: vadz
3157 #1952 Fix incorrect warning "Unknown Doxygen command: ."
3158
31592021-02-28: p2k
3160 #969 [Javascript] v8/node - prevent crash calling a constructor without new keyword.
3161
31622021-02-28: alecmev
3163 #405 #1121 [Javascript] Fix OUTPUT typemaps on methods that don't return void.
3164 The output value is appended to the return value.
3165
31662021-02-26: murillo128, wsfulton
3167 #1269 [Javascript] Fix handling of large positive unsigned long and
3168 unsigned long long values.
3169
31702021-02-24: tomleavy, yegorich, tungntpham
3171 #1746 [Javascript] Add support for Node v12, v14 and v16.
3172 SWIG support for Node is now for v6 and later only.
3173
31742020-02-09: ZackerySpytz
3175 #1872 Fix typos in attribute2ref macros.
3176
31772020-10-10: wsfulton
3178 [Javascript] Fix so that ccomplex.i interface to file can be used.
3179
31802020-10-10: wsfulton
3181 #252 complex can now be used as a C identifier and doesn't give a syntax error.
3182
31832020-10-10: lpsinger
3184 #1770 Correct C complex support.
3185 _Complex is now parsed as a keyword rather than complex as per the C99 standard.
3186 The complex macro is available in the ccomplex.i library file along with other
3187 complex number handling provided by the complex.h header.
3188
31892020-10-07: ZackerySpytz
3190 [Python] #1812 Fix the error handling for the PyObject_GetBuffer() calls in
3191 pybuffer.i.
3192
31932020-10-07: treitmayr
3194 #1824 Add missing space in director method declaration returning
3195 const pointer.
3196
31972020-10-07: adelva1984
3198 #1859 Remove all (two) exceptions from SWIG executable.
3199
32002020-09-25: wsfulton
3201 [C#, Java] #1874 Add ability to change the modifiers for the interface
3202 generated when using the %interface macros.
3203
3204 For C# use the 'csinterfacemodifiers' typemap.
3205 For Java use the 'javainterfacemodifiers' typemap.
3206
3207 For example:
3208
3209 %typemap(csinterfacemodifiers) X "internal interface"
3210
32112020-09-24: geefr
3212 [C#] #1868 Fix wchar_t* csvarout typemap for member variable wrappers.
3213
32142020-08-28: wsfulton
3215 [Java] #1862 Fix crashes in swig_connect_director during director class construction
3216 when using the director class from multiple threads - a race condition initialising
3217 block scope static variables. The fix is guaranteed when using C++11, but most
3218 compilers also fix it when using C++03/C++98.
3219
32202020-08-16: wsfulton
3221 [Python] Add missing initializer for member '_heaptypeobject::ht_module' when using
3222 -builtin to complete Python 3.9 support.
3223
32242020-08-16: wsfulton
3225 [Python] Remove PyEval_InitThreads() call for Python 3.7 and later as Python calls
3226 it automatically now. This removes a deprecation warning when using Python 3.9.
3227
32282020-08-15: wsfulton
3229 [Python] All Python examples and tests are written to be Python 2 and Python 3
3230 compatible, removing the need for 2to3 to run the examples or test-suite.
3231
32322020-08-13: wsfulton
3233 [C#] Add support for void *VOID_INT_PTR for member variables.
3234
32352020-07-29: chrisburr
3236 #1843 [Python] Compilation error fix in SwigPyBuiltin_SetMetaType when using PyPy.
3237
32382020-06-14: ZackerySpytz
3239 #1642 #1809 Fix virtual comparison operators in director classes by removing an
3240 incorrect space in the function name (for example, operator= = is now operator==).
3241
William S Fulton470d1922020-06-08 20:47:47 +01003242Version 4.0.2 (8 Jun 2020)
3243==========================
3244
32452020-06-07 vigsterkr
3246 [Ruby] #1717 Nil fix mangling strings
3247
32482020-06-07 vadz
3249 #1748 Fix doxygen comments quoting issue
3250
32512020-06-07 munoah
3252 #1800 Escape spaces in file paths for dependencies (-M -MM etc)
3253
32542020-06-06 andreas-schwab
3255 [Ruby] #1801 Fix encoding on big endian systems when wrapping std::wstring.
3256
32572020-05-31 kwwette
3258 [Octave] #1789 error handling improvements and return error code on exit for SWIG wrapped modules.
3259
32602020-05-30 msteinbeck
3261 [D] #1593 Replace broken imports when using newer versions of D.
3262
32632020-05-29: ZackerySpytz
Zackery Spytz899c9b82022-10-24 10:54:47 -07003264 [Python] #1716 Performance improvements when converting strings when using Python >= 3.3.
William S Fulton470d1922020-06-08 20:47:47 +01003265
32662020-05-28: ZackerySpytz
3267 #1776 Quite dramatically decrease run times when generating very large interface files by changing
3268 some internal memory pool sizes.
3269
32702020-05-28: mcfarljm
3271 #1788 Fix handling of Doxygen \endlink command.
3272
32732020-05-24: vapier
3274 [Javascript] #1796 Fix pkg-config invocation in configure.
3275
32762020-04-30: kwwette
3277 [Octave] Fix exception raising for newer Octave versions
3278 Since (at least) Octave 5.1.0, the Octave error() function now raises a C++ exception,
3279 which if uncaught immediately exits a SWIG wrapper function, bypassing any cleanup code
3280 that may appear after a "fail:" label. This patch adds a "try { ... } catch(...) { }"
3281 block around the contents of SWIG wrapper functions to first execute the cleanup code
3282 before rethrowing any exception raised. It is backward compatible with earlier versions
3283 of Octave where error() does not raise an exception, which will still branch to the
3284 "fail:" block to execute cleanup code if an error is encountered.
3285
3286 Note that the new "try { ... } catch(...) { }" block will localise any local variables
3287 used in typemaps that were NOT declared through SWIG's %typemap(...) syntax, so it's
3288 possible this could break existing SWIG wrappers which were implicitly sharing local
3289 variables between typemaps. This can be fixed, however, by declaring local variables
3290 which need to be shared between typemaps through SWIG's %typemap(...) syntax.
3291
32922020-02-18: ryannevell
3293 [Lua] #1728 Add support for LUA lightuserdata to SWIG_Lua_ConvertPtr.
3294
32952020-02-18: dmach
3296 [Ruby] #1725 Fix gcc -Wcatch-value warnings.
3297
32982020-02-14: treitmayr
3299 #1724 Fix wrapping of abstract user-defined conversion operators.
3300
33012020-02-13: ddurham2
3302 [Python] #1512 Fix memleak when using STL containers of shared_ptr objects.
3303
33042020-02-06: wsfulton
3305 [Python] #1673 #1674 Fix setting 'this' when extending a proxy class with __slots__.
3306
33072020-01-31: vadz
3308 [Ruby] #1651 Add std::auto_ptr<> typemaps.
3309
33102020-01-31: ZackerySpytz
Zackery Spytz899c9b82022-10-24 10:54:47 -07003311 [Python] #1700 The Python C API functions PyBytes_AsStringAndSize() and
3312 PyString_AsStringAndSize() are now checked for failure.
William S Fulton470d1922020-06-08 20:47:47 +01003313
33142020-01-31: vadz
3315 [Python] #1710 Fix crash parsing empty docstrings.
3316
33172020-01-30: Alzathar
3318 [R] #910 #914 Fix R memory leak on exception.
3319
33202020-01-30: richardbeare
3321 [R] #1511 Fix bug wrapping functions. These were previously incorrectly wrapped as if
3322 they were variables. This happened when 'get' or 'set' was in the name of the function
3323 or method, but sometimes also in some other circumstances. If you were using R
3324 attribute syntax to access these methods, you'll need to switch to calling them as R
3325 methods.
3326
3327 *** POTENTIAL INCOMPATIBILITY ***
3328
33292020-01-24: etse-dignitas, wsfulton
3330 [C#, D, Java] #1533 Fix upcasting for shared_ptr's of templated types.
3331
33322020-01-16: mcfarljm
3333 #1643 #1654 When using -doxygen, fix segfault when nameless parameters or vararg parameters
3334 are used.
3335
33362020-01-16: mcfarljm
3337 #1632 #1659 Fix newline handling for doxygen "///" comments.
3338
33392020-01-14: mcfarljm
3340 #1647 #1656 Fix crash handling empty doxygen comments.
3341
33422020-01-14: mcfarljm
3343 #1608 Improve doxygen support.
3344 - Add support for \param[] commands such as: \param[in].
3345 - Optional arguments are marked as 'optional' in pydoc.
3346 - Improve support for \code commands so that other languages are supported as code blocks.
3347 Support added for java, c and py. For example Python: \code{.py} ... \endcode
3348 - Fix doxygen handling of \em and \p tags for Python.
3349
33502020-01-13: wsfulton
3351 [Python] #1595 Python -builtin constructors silently ignored keyword arguments.
Olly Betts3bf1da42022-09-29 18:17:32 +13003352 Instead of silently ignoring them, now a "TypeError: f() takes no keyword arguments"
William S Fulton470d1922020-06-08 20:47:47 +01003353 exception is thrown if keyword arguments are used. Hence constructors and normal methods/
3354 functions behave in the same way. Note, -keyword should be used with -builtin to obtain
3355 keyword argument support.
3356
33572020-01-05: jschueller shadchin
3358 [Python] #1670 #1696 Add missing field initializers introduced in python 3.8:
3359 tp_vectorcall and tp_print.
3360
33612020-01-05: friedrichatgc
3362 [Octave] #1688 Change swig_this() to use size_t instead of long for compatibility
3363 with Windows 64 bit.
3364
33652020-01-05: treitmayr
3366 [Ruby] #1692 #1689 Add support for Ruby 2.7
3367
33682019-12-30: treitmayr
3369 [Ruby] #1653 #1668 Fix code generated when using -globalmodule option.
3370
33712019-12-29: ZackerySpytz
3372 [OCaml] #1686 Fix compilation errors with OCaml 4.09.0.
3373
33742019-12-10: wsfulton
3375 #1679 Fix parsing of C++11 identifiers with special meaning (final and override) when
3376 they are used as part of the scope name of an identifier, such as a namespace name.
3377
33782019-11-26: wsfulton
3379 [C#] #1628 'out' or 'ref' used in a cstype typemap was not always stripped out in parts
3380 of director code generation.
3381
33822019-11-01: wsfulton
3383 [Python] #1595 Fix bug in support for keyword arguments (kwargs feature or -keyword)
3384 when using -builtin. The fix is in the argument error checking when wrapping zero
3385 argument constructors only.
3386
William S Fultonc48d11a2019-08-22 06:55:39 +01003387Version 4.0.1 (21 Aug 2019)
3388===========================
3389
33902019-08-20: TekuConcept
3391 [Javascript] #1535 Add %native support to Javascript.
3392
33932019-08-20: bkotzz
3394 [Java] #1616 Add SWIG_JavaIllegalStateException to support throwing
3395 java.lang.IllegalStateException from JNI code.
3396
33972019-08-19: sjml
3398 [Lua] #1596 tostring output changes to show the underlying C/C++ pointer.
3399
34002019-08-08: rokups
3401 [C#, Java] #1601 Fix invalid code generated for "%constant enum EnumType.
3402
34032019-08-07: wsfulton
3404 [Python] Fix method overloading of methods that take STL containers of different
3405 types. The following usage (using std::vector) would fail when using -builtin:
3406
3407 %include <std_string.i>
3408 %include <std_vector.i>
3409
3410 %inline %{
3411 struct X {};
3412 %}
3413
3414 %template(VectorX) std::vector<X>;
3415 %template(VectorInt) std::vector<int>;
3416
3417 %inline %{
3418 using namespace std;
3419 string VectorOverload(vector<X> v);
3420 string VectorOverload(vector<int> v);
3421 %}
3422
3423 The following would incorrectly fail:
3424
3425 s = VectorOverload([1, 2, 3])
3426
3427 With:
3428
3429 Traceback (most recent call last):
3430 File "runme3.py", line 20, in <module>
3431 ret = VectorOverload([1, 2, 3])
3432 TypeError: Wrong number or type of arguments for overloaded function 'VectorOverload'.
3433 Possible C/C++ prototypes are:
3434 VectorOverload(std::vector< Number,std::allocator< Number > >)
3435 VectorOverload(std::vector< int,std::allocator< int > >)
3436
Olly Betts3bf1da42022-09-29 18:17:32 +13003437 The problem was due to some error handling that was not cleared during typechecking.
William S Fultonc48d11a2019-08-22 06:55:39 +01003438 In this case an error was not cleared when the elements in the list failed the
3439 typecheck for converting to X. Only occurs in Python 3+.
3440
3441 In some combinations of overloaded methods, the following type of error message would
3442 occur:
3443
3444 RuntimeError: in sequence element 0
3445
3446 The above exception was the direct cause of the following exception:
3447
3448 Traceback (most recent call last):
3449 File "runme3.py", line 23, in <module>
3450 check(VectorOverload(v), "vector<X>")
3451 SystemError: <built-in function VectorOverload> returned a result with an error set
3452
34532019-08-01: wsfulton
3454 #1602 Fix regression in 4.0.0 where a template function containing a parameter
3455 with the same name as the function name led to the parameter name used in the
3456 target language being incorrectly modified.
3457
34582019-07-29: wsfulton
3459 Remove all generated files on error. Previously generated files were not removed,
3460 potentially breaking Makefiles using file dependencies, especially when -Werror
3461 (warnings as errors) was used.
3462
34632019-07-23: smithx
3464 [C#] #1530 #1532 Fix marshalling of std::wstring to C#.
3465
34662019-07-18: gicmo
3467 [Python] #1587 Python 3.8 support - remove use of deprecated PyObject_GC_UnTrack.
3468
34692019-07-18: cher-nov
3470 [Python] #1573 Generated Python code uses consistent string quoting style - double
3471 quotes.
3472
34732019-07-16: geefr
3474 [C#] #616 #1576 Fix C# bool INPUT[], bool OUTPUT[], bool INOUT[] typemaps to marshall
3475 as 1-byte.
3476
34772019-07-12: vadz
3478 [C#, Java] #1568 #1583 Fix std::set<> typemaps for primitive types.
3479
34802019-07-12: vadz
3481 #1566 #1584 Regression in 4.0.0 - fix missing value for first item of enums with
3482 trailing comma.
3483
34842019-07-11: mcfarljm
3485 #1548 #1578 Fix segfault in Doxygen parser parsing empty lines in some commands like
3486 \code.
3487
34882019-07-09: IsaacPascual
3489 [C#, Java] #1570 Fix name of generated C#/Java classes for %interface macros
3490 in swiginterface.i when wrapping nested C++ classes.
3491
34922019-07-05: wsfulton
3493 [Python] #1547 Whitespace fixes in Doxygen translated comments into pydoc comments
3494 for Sphinx compatibility.
3495
34962019-06-28: wsfulton
3497 [MzScheme, OCaml] #1559 $arg and $input were incorrectly substituted in the
3498 argout typemap when two or more arguments were present.
3499
35002019-06-24: wsfulton
3501 [Python, Ruby] #1538 Remove the UnknownExceptionHandler class in order to be
3502 C++17 compliant as it uses std::unexpected_handler which was removed in C++17.
3503 This class was intended for director exception handling but was never used by
3504 SWIG and was never documented.
3505
3506 *** POTENTIAL INCOMPATIBILITY ***
3507
35082019-06-06: bkotzz
3509 [Java] #1552 Improve performance in Java std::vector constructor wrapper that takes
3510 a native Java array as input.
3511
35122019-06-03: olly
3513 [Python] Fix regression in implicit_conv handling of tuples,
3514 introduced in SWIG 4.0.0. Fixes #1553, reported by Alexandre
3515 Duret-Lutz.
3516
35172019-05-24: wsfulton
3518 [Octave] Fix detection of Octave on MacOS.
3519
35202019-05-24: opoplawski
3521 [Octave] #1522 Adapt OCTAVE_LDFLAGS for Octave 5.1.
3522
35232019-05-22: ferdynator
3524 [PHP] #1528 Don't add a closing '?>' PHP tag to generated files.
3525 PSR-2 says it MUST be omitted for files containing only PHP.
Olly Betts76b700d2022-10-19 07:35:31 +13003526
William S Fulton6a917232019-04-28 21:01:21 +01003527Version 4.0.0 (27 Apr 2019)
3528===========================
3529
35302019-04-24: vadz
3531 #1517 Fix crash if "@return" Doxygen tag was used on a node without any return type.
3532
35332019-04-24: vadz
3534 #1515 Fix parsing of enums with trailing comma when using -doxygen.
3535
35362019-04-19: ianlancetaylor
3537 [Go] #1055 When generating Go code, make -cgo the default. Add new -no-cgo option
3538 to disable the default.
3539
35402019-04-19: pbecherer
3541 [Tcl] #1508 Fix Visual Studio 2015 and later compilation errors due to snprintf macro
3542 definition.
3543
35442019-04-09: wsfulton
3545 [C#] Fix FxCop warning CA2002 in SWIGPendingException - a lock on a reference of
3546 type 'Type'.
3547
35482019-03-30: wsfulton
3549 [Java, D] Add the parameters typemap attribute to the javadestruct,
3550 javadestruct_derived, ddispose, ddispose_derived typemaps to mirror enhanced
3551 flexibility in the csdisposing and csdisposing_derived (C#) typemaps. If provided
3552 the contents are generated as the delete/dispose method's parameters declaration.
3553
35542019-03-30: wsfulton
3555 [C#] #421 Fix FxCop warning CA1063 by implementing the recommended Dispose methods for
3556 the IDisposable interface. Previously just the Dispose() method was generated.
3557 Now the Dispose() and Dispose(bool disposing) methods are generated.
3558 Changes are required if custom "csfinalize", "csdestruct" or "csdestruct_derived"
3559 typemaps are being used. Details in #421 on Github. SWIG will error out if one of
3560 the "csfinalize, "csdestruct" or "csdestruct_derived" typemaps are found. Example
3561 error message:
3562
3563 foo.h:60: Error: A deprecated csfinalize typemap was found for Foo, please remove
3564 it and replace all csdestruct, csdestruct_derived and csfinalize typemaps by the
3565 csdispose, csdispose_derived, csdisposing and csdisposing_derived typemaps.
3566
3567 *** POTENTIAL INCOMPATIBILITY ***
3568
35692019-03-25: Liryna
3570 [C#] #1143 Add std_list.i for std::list support.
3571 The C# std::list<T> wrappers are made to look and feel like a C#
3572 System.Collections.Generic.LinkedList<> collection.
3573 The IEnumerable<> interface is implemented in the proxy class.
3574 The ICollection<> interface can also be implemented to provide enhanced functionality
3575 whenever a C++ operator== is available. This is the case for when T is a
3576 primitive type or a pointer. If T does define an operator==, then use the
3577 SWIG_STD_LIST_ENHANCED macro to obtain this enhanced functionality, for example:
3578
3579 SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass)
3580 %template(ListKlass) std::list<SomeNamespace::Klass>;
3581
35822019-03-18: richardbeare
3583 [R] #1328 Non-trivial enums are working now. The enum values are now obtained from
3584 the C/C++ layer. const reference enums and C++11 enum classes are also now working.
3585
35862019-03-14: mochizk
3587 [Javascript] #1500 Fix compilation errors due to deprecating V8 API in Node.js.
3588 New V8 API is used if node.js >= v10.12, or if V8 >= v7.0.
3589
35902019-03-12: vadz
3591 [C#] #1495 Add std_set.i for std::set support.
3592
35932019-03-11: dirteat,opoplawski
3594 [Octave] Fix compilation errors in Octave 5.1.
3595
3596 error: format not a string literal and no format arguments [-Werror=format-security]
3597
35982019-02-28: wsfulton
3599 [Java] std::vector improvements for types that do not have a default constructor.
3600
3601 The std::vector wrappers have been changed to work by default for elements that are
3602 not default insertable, i.e. have no default constructor. This has been achieved by
3603 not wrapping:
3604
3605 vector(size_type n);
3606
3607 Previously the above had to be ignored via %ignore.
3608
3609 If the above constructor is still required it can be added back in again via %extend:
3610
3611 %extend std::vector {
3612 vector(size_type count) { return new std::vector< T >(count); }
3613 }
3614
3615 Alternatively, the following wrapped constructor could be used as it provides near-enough
3616 equivalent functionality:
3617
3618 vector(jint count, const value_type& value);
3619
3620 *** POTENTIAL INCOMPATIBILITY ***
3621
36222019-02-25: wsfulton
3623 [Python] Fix compile errors wrapping overloaded functions/constructors where a vararg
3624 function is declared after a non-vararg function.
3625
36262019-02-23: zphensley42
3627 Use fully qualified name 'java.lang.Object' instead of 'Object' in generated code to
3628 avoid clashes with wrapped C++ classes called 'Object'.
3629
36302019-02-23: gtbX
3631 [Java] #1035 Add (const char *STRING, size_t LENGTH) typemaps in addition to the non-const
3632 typemaps (char *STRING, size_t LENGTH) which does not attempt to write back to the const
3633 string.
3634
36352019-02-22: tamuratak
3636 [Ruby] #984 Add support for RTypedData introduced in Ruby 1.9.3.
3637
36382019-02-22: ZackerySpytz
3639 #1483 Fix compilation failures when a director class has final methods.
3640
36412019-02-21: wsfulton
3642 [Java] #1240 Suppress Java 9 deprecation warnings on finalize method.
3643
36442019-02-21: ZackerySpytz
3645 #1480 Fix some rejections of valid floating-point literals.
3646
36472019-02-19: wsfulton
3648 #1475 Fix regression parsing gcc preprocessor linemarkers in the form:
3649
3650 # linenum filename flags
3651
36522019-02-18: jakecobb
3653 [Python] #945 #1234 Elements in std::vector memory access fix.
3654
3655 Accessing an element in a std::vector obtains a reference to the element via an
3656 iterator pointing to the element in the container. If the vector is garbage collected,
3657 the SWIG wrapper containing the pointer to the element becomes invalid. The fix is
3658 to obtain a back-reference to the container by the wrapper to the element in the Python
3659 layer to prevent the garbage collector from destroying the underlying container.
3660
36612019-02-17: wsfulton
3662 Fix typemap matching to expand template parameters when the name contains
3663 template parameters. In the %typemap below the type is T and the name is X<T>::make
3664 and the name now expands correctly to X< int >::make
3665
3666 template<typename T> struct X {
3667 %typemap(out) T X<T>::make "..."
3668 T make();
3669 };
3670
3671 %template(Xint) X<int>;
3672
36732019-02-16: wsfulton
3674 Fix parser error containing multiple #define statements inside an enum.
3675
3676 The second #define fails to parse:
3677
3678 enum FooEnum {
3679 ENUM1 = 0,
3680 ENUM2 = 1,
3681
3682 #define MACRO_DEF1 "Hello"
3683 #define MACRO_DEF2 "World!"
3684
3685 ENUM3 = 2,
3686 ENUM4 = 3,
3687 };
3688
3689 Bug mentioned at https://sourceforge.net/p/swig/patches/333/
3690
36912019-02-14: wsfulton
3692 Add some missing copy constructors into STL containers.
3693
36942019-02-14: bkotzz
3695 [Java] #1356 Add STL containers:
3696 std::unordered_map
3697 std::unordered_set
3698 std::set
3699
37002019-02-14: bkotzz
3701 [Java] #1356 std::map wrappers have been modified. Now the Java proxy class
3702 extends java.util.AbstractMap. The std::map container looks and feels much like
3703 a java.util.HashMap from Java.
3704
3705 A few members have changed their names. If the old method signatures are needed,
3706 then copy std_map.i from swig-3.0.12 and use that instead. Alternatively,
3707 add the old missing methods to the new methods by using the following %proxycode:
3708
3709 %extend std::map {
3710 %proxycode %{
3711 // Old API
3712 public boolean empty() {
3713 return isEmpty();
3714 }
3715 public void set($typemap(jboxtype, K) key, $typemap(jboxtype, T) x) {
3716 put(key, x);
3717 }
3718 public void del($typemap(jboxtype, K) key) {
3719 remove(key);
3720 }
3721 public boolean has_key($typemap(jboxtype, K) key) {
3722 return containsKey(key);
3723 }
3724 %}
3725 }
3726
3727 *** POTENTIAL INCOMPATIBILITY ***
3728
37292019-02-13: ZackerySpytz
3730 #1469 Add support for C++17 hexadecimal floating literals.
3731
37322019-02-11: wsfulton
3733 [OCaml] #1437 OCaml has been give the 'Experimental' language status. The examples work
3734 and most of the test-suite is also working, so it is quite close to being a 'Supported' language.
3735
37362019-02-10: ZackerySpytz
3737 #1464 Add support for C++14 binary integer literals.
3738
37392019-02-10: ZackerySpytz
3740 #1450 Add support for C++11 UCS-2 and UCS-4 character literals. Also, add support for
3741 C++17 UTF-8 character literals.
3742
37432019-02-10: wsfulton
3744 [MzScheme] #1437 MzScheme/Racket is now an 'Experimental' language. The examples work
3745 and a large portion of the test-suite is also working.
3746
37472019-02-10: wsfulton
3748 [MzScheme] Destructor wrappers were not being generated.
3749
37502019-02-10: wsfulton
3751 [MzScheme] Static variable wrappers fixed - $argnum was not expanded.
3752
37532019-02-10: sethrj
3754 #1452 Fix %apply for anonymous template instantiations
3755
37562019-02-09: olly
3757 [PHP] Fix access to already released memory during PHP module
3758 shutdown, which often didn't cause visible problems, but could
3759 result in segmentation faults, bus errors, etc. Fixes #1170,
3760 reported by Jitka Plesníková.
3761
37622019-02-09: olly
3763 [PHP] A renamed constructor is now wrapped as a static method in
3764 PHP.
3765
37662019-02-08: olly
3767 [PHP] Don't generate code which references $r when $r hasn't been
3768 defined. This could happen in overloaded methods which returned
3769 void and took at least one const std::string& parameter.
3770
37712019-02-08: olly
3772 [PHP] The generated code is now compatible with PHP 7.3, and the
3773 testsuite now runs cleanly with this version too.
3774
37752019-02-05: wsfulton
3776 #1437 SWIG now classifies the status of target languages into either 'Experimental' or
3777 'Supported'. This status is provided to indicate the level of maturity to expect when using
3778 a particular target language as not all target languages are fully developed. Details are
3779 in the Introduction.html chapter of the documentation.
3780
37812019-02-04: wsfulton
3782 [CFFI] #1447 Common Lisp CFFI has been disabled as a target language in SWIG as part of a
3783 clean up to remove target languages that have been neglected/not functional.
3784
37852019-02-04: wsfulton
3786 [Allegrocl] #1447 Allegro Common Lisp has been disabled as a target language in SWIG as part of a
3787 clean up to remove target languages that have been neglected/not functional.
3788
37892019-02-04: wsfulton
3790 [Chicken] #1447 CHICKEN has been disabled as a target language in SWIG as part of a
3791 clean up to remove target languages that have been neglected/not functional.
3792
37932019-02-04: wsfulton
3794 [CLISP] #1447 GNU Common Lisp has been disabled as a target language in SWIG as part of a
3795 clean up to remove target languages that have been neglected/not functional.
3796
37972019-02-04: wsfulton
3798 [S-EXP] #1447 Common Lisp S-Exp has been disabled as a target language in SWIG as part of a
3799 clean up to remove target languages that have been neglected/not functional.
3800
38012019-02-04: wsfulton
3802 [UFFI] #1447 Common Lisp UFFI has been disabled as a target language in SWIG as part of a
3803 clean up to remove target languages that have been neglected/not functional.
3804
38052019-02-04: wsfulton
3806 [Pike] #1447 Pike has been disabled as a target language in SWIG as part of a
3807 clean up to remove target languages that have been neglected/not functional.
3808
38092019-02-04: wsfulton
3810 [Modula3] #1447 Modula3 has been disabled as a target language in SWIG as part of a
3811 clean up to remove target languages that have been neglected/not functional.
3812
38132019-02-02: ahnolds
3814 [Python] Documentation enhancements for Python:
3815
3816 #728 Fixed the handling of autodoc when using -fastproxy.
3817
3818 #1367 Added documentation to wrapped member variables using the
3819 property(... doc="...") construct.
3820
3821 Only show a single documentation entry for functions with default arguments when
3822 using autodoc.
3823
3824 Fixed a bug where a cached doxygen docstring could be deleted while still in use,
3825 causing swig to segfault.
3826
38272019-01-31: olly
3828 SWIG now requires a target language to be specified instead of
3829 defaulting to wrapping for Tcl. Specifying swig --help without
3830 a target language now just shows the generic help. The -nolang
3831 option has been removed.
3832
38332019-01-28: ZackerySpytz
3834 [OCaml] #1429 Remove support for OCaml versions < 3.12.0.
3835
3836 *** POTENTIAL INCOMPATIBILITY ***
3837
38382019-01-22: vadz
3839 [Ruby, Octave] #1424 Improve autodoc parameter naming.
3840
38412019-01-22: vadz
3842 [Python] #1271 #1423 Always include default parameter values in autodoc strings.
3843
38442019-01-19: vadz
3845 #1272, #1421 When a function's parameter is a keyword, the name of the paramater is
3846 no longer simply changed to argN, where N is the argument number. Instead the
3847 parameter name is changed to the renaming rules for keywords that normally apply to
3848 symbols such as classes/functions etc. Note that unlike other symbol renaming,
3849 parameter renaming does not issue a warning when the parameter is renamed. This
3850 change only affects languages where the parameter names are actually used, for example,
3851 Java function parameter lists in the proxy class or Python documentation comments.
3852
38532019-01-18: wsfulton
3854 #1420 Fix gdb debugger functions 'swigprint' and 'locswigprint' from swig.gdb to
3855 work with newer versions of gdb-8. Fixes errors when debugging SWIG source with gdb:
3856
3857 (gdb) swigprint n
3858 Undefined command: "Printf". Try "help".
3859
38602019-01-16: wsfulton
3861 Python static method wrapper changes
3862
3863 - Static method wrappers were using the 'fastproxy' approach by default.
3864 This is inconsistent with instance method wrappers. The fastproxy approach
3865 is now turned off by default to be consistent with instance methods.
3866 Static method wrappers can now also be controlled using the -fastproxy and
3867 -olddefs options.
3868
3869 Example:
3870
3871 struct Klass {
3872 static int statmethod(int a = 2);
3873 };
3874
3875 generates by default:
3876
3877 class Klass(object):
3878 ...
3879 @staticmethod
3880 def statmethod(a=2):
3881 return _example.Klass_statmethod(a)
3882
3883 instead of the following (which can be restored by using -fastproxy):
3884
3885 class Klass(object):
3886 ...
3887 statmethod = staticmethod(_example.Klass_statmethod)
3888
3889 - Modernise wrappers for static methods to use decorator syntax - @staticmethod.
3890
3891 - Add missing runtime test for static class methods and using the actual class method.
3892
38932019-01-12: ZackerySpytz
3894 [OCaml] #1403 #1194 Fix compilation problems for OCaml >= 4.03.0 due to OCaml using
3895 int64_t instead of int64.
3896
38972019-01-11: ZackerySpytz
3898 [OCaml] #1400 Fix the getters and setters of non-static member variables.
3899
39002019-01-07: wsfulton
3901 #358 Add VOID to windows.i
3902
39032019-01-05: wsfulton
3904 #948 #1019 #1273 Fix for C++11 raw strings where the delimiters were mistakenly left
3905 in the string contents in situations where the string was copied into generated code.
3906 For example, %constant, the "docstring" feature and for C#/Java/D constants turned on
3907 with %javaconst/%csconst/%dmanifestconst.
3908
39092019-01-05: wsfulton
3910 [Ruby] #538. Fix Ruby support for %feature("docstring").
3911
39122019-01-03: wsfulton
3913 #1202 Fix overloading of non-pointer class types in scripting languages when overloaded
3914 with a pointer and a NULL scripting language equivalent is used, eg None in Python.
3915
3916 The implementation changes the SWIGTYPE, SWIGTYPE& and SWIGTYPE&& typecheck typemaps to
3917 prevent accepting a conversion to a NULL pointer.
3918
39192019-01-03: ZackerySpytz
3920 [OCaml] #1386 Fix the OCaml examples and test suite for out-of-source builds.
3921
39222019-01-01: wsfulton
3923 [Python] #639 remove duplicate proxy method definitions for global function wrappers.
3924
3925 Global functions previously generated two definitions, eg:
3926
3927 def foo():
3928 return _example.foo()
3929 foo = _example.foo
3930
3931 The first definition is replaced by the second definition and so the second definition
3932 is the one used when the method is actually called. Now just the first definition is
3933 generated by default and if the -fastproxy command line option is used, just the second
3934 definition is generated. The second definition is faster as it avoids the proxy Python
3935 method as it calls the low-level C wrapper directly. Using both -fastproxy and -olddefs
3936 command line options will restore the previously generated code as it will generate both
3937 method definitions.
3938
3939 With this change, the wrappers for global C/C++ functions and C++ class methods now work
3940 in the same way wrt to generating just a proxy method by default and control via
3941 -fastproxy/-olddefs options.
3942
39432018-12-20: hasinoff,wsfulton
3944 [Java] #1334 Set Java thread name to native thread name when using directors.
3945
3946 Default is to use name "Thread-XXX" and is still works like this by default. However,
3947 adding the following will turn on the thread name setting (works for more recent
3948 versions of Linux and MacOS):
3949
3950 %begin %{
3951 #define SWIG_JAVA_USE_THREAD_NAME
3952 %}
3953
39542018-12-20: chlandsi
3955 [Python] #1357. Fix overriding __new__ in Python 3.6.
3956
3957 Fixes SystemError: Objects/tupleobject.c:81: bad argument to internal function"
3958
39592018-12-16: wsfulton
3960 [Python] #848 #1343 The module import logic has changed to stop obfuscating real ImportError
3961 problems. Only one import of the low-level C/C++ module from the pure Python module is
3962 attempted now. Previously a second import of the low-level C/C++ module was attempted
3963 after an ImportError occurred and was done to support 'split modules'. A 'split module' is
3964 a configuration where the pure Python module is a module within a Python package and the
3965 low-level C/C++ module is a global Python module. Now a 'split module' configuration is
3966 no longer supported by default. This configuration can be supported with a simple
3967 customization, such as:
3968
3969 %module(package="mypackage", moduleimport="import $module") foo
3970
3971 or if using -builtin:
3972
3973 %module(package="mypackage", moduleimport="from $module import *") foo
3974
3975 instead of
3976
3977 %module(package="mypackage") foo
3978
3979 See the updated Python chapter titled "Location of modules" in the documentation.
3980
39812018-12-11: tlby
3982 [Perl] #1374 repair EXTEND() handling in typemaps
3983
39842018-12-06: vadz
3985 #1359 #1364 Add missing nested class destructor wrapper when the nested class is
3986 inside a template. Removes associated bogus 'Illegal destructor name' warning. Only
3987 occurred when the nested class' destructor is explicitly specified.
3988
39892018-12-04: adr26
3990 [Python] #1368 #1369 Access Violation in tp_print caused by mismatched Python/extension
3991 CRT usage
3992
3993 Remove all use of tp_print, as this API uses a FILE*, which can be
3994 mismatched when modules are built with different C libraries from
3995 the main python executable.
3996
3997 This change also brings consistent output between Python 2 and 3 for the 'cvar' SWIG
3998 object (that contains the global variables) and SWIG packed objects (such as callback
3999 constants).
4000
40012018-12-04: wsfulton
4002 [Python] #1282 Fix running 'python -m' when using 'swig -builtin'
4003
4004 Similar to the earlier PEP 366 conforming fix for non-builtin.
4005
40062018-11-29: adr26
4007 [Python] #1360 Leak of SWIG var link object
4008
4009 Fix reference counting on _SWIG_globals to allow var link to be freed on module unload.
4010
40112018-11-28: wsfulton
4012 [Python] When using -builtin, the two step C-extension module import is now
4013 one step and the wrapped API is only available once and not in an underlying
4014 module attribute like it is without -builtin. To understand this, consider a
4015 module named 'example' (using: %module example). The C-extension is compiled into
4016 a Python module called '_example' and a pure Python module provides the actual
4017 API from the module called 'example'. It was previously possible to additionally
4018 access the API from the module attribute 'example._example'. The latter was an
4019 implementation detail and is no longer available. It shouldn't have been used, but
4020 if necessary it can be resurrected using the moduleimport attribute described in the
4021 Python chapter of the documentation. If both modules are provided in a Python
4022 package, try:
4023
4024 %module(moduleimport="from . import _example\nfrom ._example import *") example
4025 or more generically:
4026 %module(moduleimport="from . import $module\nfrom .$module import *") example
4027
4028 and if both are provided as global modules, try:
4029
4030 %module(moduleimport="import _example\nfrom _example import *") example
4031 or more generically:
4032 %module(moduleimport="import $module\nfrom $module import *") example
4033
4034 The module import code shown will appear in the example.py file.
4035
40362018-11-24: vadz
4037 #1358 Fix handling of abstract base classes nested inside templates
4038
4039 Correct detecting of whether a derived class method overrides a pure virtual
4040 base class method when both classes are nested inside a template class: this
4041 notably didn't work correctly for methods taking parameters of the base class
4042 type.
4043
40442018-11-22: rupertnash
4045 [Python] #1282 Make generated module runnable via python -m (PEP 366 conforming)
4046
4047 Previously any SWIG generated modules in a package would fail with an ImportError
4048 when using 'python -m' for example 'python -m mypkg.mymodule'.
4049
4050 This fix also allows the SWIG generated module to be placed into a directory and
4051 then renamed __init__.py to convert the module into a package again. This ability
4052 stopped working in swig-3.0.9. However, only Python 2.7 or 3.3 and later work. If
4053 Python 3.2 support is needed, use moduleimport in %module to customise the import
4054 code.
4055
40562018-11-13: wsfulton
4057 #1340 Remove -cppcast and -nocppcast command line options (this was an option
4058 available to the scripting language targets).
4059
4060 The -cppcast option is still turned on by default. The -nocppcast option
4061 to turn off the use of c++ casts (const_cast, static_cast etc) has been
4062 removed. However, defining SWIG_NO_CPLUSPLUS_CAST will still generate C casts
4063 instead of C++ casts for C++ wrappers.
4064
4065 *** POTENTIAL INCOMPATIBILITY ***
4066
40672018-11-13: wsfulton
4068 [Python] #1340 Remove -outputtuple and -nooutputtuple command line options.
4069
4070 Both the command line and %module options of the same name have been
4071 removed. These were undocumented. The -outputtuple option returned a
4072 Python tuple instead of a list, mostly typically in the OUTPUT
4073 typemap implementations.
4074
4075 It unclear why a tuple instead of a list return type is needed and
4076 hence this option has been removed as part of the simplification of
4077 the SWIG Python command line options for SWIG 4.
4078
40792018-11-13: wsfulton
4080 [Python] #1340 Remove -noproxyimport command line option.
4081
4082 This option turned off the insertion of Python import statements
4083 derived from a %import directive. For example given:
4084
4085 %module module_b
4086 %import "module_a.i"
4087
4088 then module_b.py will contain:
4089
4090 import module_a
4091
4092 *** POTENTIAL INCOMPATIBILITY ***
4093
40942018-10-29: AlexanderGabriel
4095 [PHP] The following PHP7 reserved keywords are now only renamed by
4096 SWIG when used as function names in the API being wrapper:
4097 __halt_compiler array die echo empty eval exit include include_once
4098 isset list print require require_once return unset
4099
41002018-10-22: olly,wsfulton
4101 [Python] #1261 #1340 Turn on many optimisation options by default and rationalise the
4102 number of command line options.
4103
4104 There were an unnecessary number of command line options and many of these have now
4105 been removed in a drive for simplification. Some were needed to support older versions
4106 of Python (2.6 and earlier).
4107
4108 Many of the options could be turned on individually and when using -O. Previously -O
4109 resulted in turning on a set of options:
4110
4111 -modern -fastdispatch -nosafecstrings -fvirtual -noproxydel
4112 -fastproxy -fastinit -fastunpack -fastquery -modernargs -nobuildnone
4113
4114 Now -O results in turning on this reduced set:
4115
4116 -fastdispatch -fastproxy -fvirtual
4117
4118 The following options are now on by default, a deprecated warning is displayed if they
4119 are used:
4120 -fastinit Class initialisation code done in C/C++ rather than in Python code.
4121 -fastquery Python dictionary used for lookup of types.
4122 -fastunpack Faster unpacking of function arguments in C/C++ wrappers.
4123 -modern Use Python 2.3 features such as object and property.
4124 -modernargs Use Python 2.3 C APIs for unpacking arguments in tuples.
Olly Bettsa8091572023-10-25 09:35:33 +13004125 -noproxydel Stop generating a proxy __del__ method for backwards compatibility.
William S Fulton6a917232019-04-28 21:01:21 +01004126 -safecstrings No discernable difference
4127
4128 The following options have been removed altogether:
4129 -aliasobj0
4130 -buildnone
4131 -classptr
4132 -new_repr
4133 -newrepr
4134 -noaliasobj0
4135 -nobuildnone
4136 -nocastmode
4137 -nodirvtable
4138 -noextranative
4139 -nofastinit
4140 -nofastproxy
4141 -nofastquery
4142 -nomodern
4143 -nomodernargs
4144 -nooutputtuple
4145 -nosafecstrings
4146 -old_repr
4147 -oldrepr
4148 -proxydel
4149
4150 -new_vwm is no longer supported. Use the -newvwm alias instead.
4151
4152 *** POTENTIAL INCOMPATIBILITY ***
4153
41542018-10-22: olly
4155 [Python] #1261 Remove command line option no longer needed as Python 2.3 and earlier
4156 are no longer supported:
4157
4158 -classic
4159
41602018-10-09: wsfulton
4161 [D, Go, Guile, Lua, Mzscheme, Ocaml, Perl5, Php, Scilab, Tcl]
4162 Allow wrapping of std::map using non-default comparison function.
4163
41642018-10-09: vadz
4165 [Java] #1274 Allow wrapping of std::map using non-default comparison function.
4166
41672018-10-04: wsfulton
4168 [Python] #1126 Fix C default arguments with -builtin and -fastunpack and -modernargs.
4169 Problem occurred when there is just one (defaulted) parameter in the parameter list.
4170
41712018-09-24: wsfulton
4172 [Python] #1319 C++11 hash tables implementation is finished now (including for -builtin):
4173 std::unordered_map
4174 std::unordered_set
4175 std::unordered_multimap
4176 std::unordered_multiset
4177
41782018-09-21: wsfulton
4179 [Python] Fix when using -builtin and wrapping std::map, std::set, std::unordered_map or
4180 std::unordered_set to ensure __contains__ is called. This is a wrapper for the STL
4181 container's find method. Without it, Python will do its own slower sequence search.
4182
41832018-09-19: wsfulton
4184 [Python] Fix functors (wrapped as __call__) when using -builtin -modern -fastunpack.
4185
41862018-09-02: andreas.gaeer,tkrasnukha
4187 [Python] #1321 Fix assert in PyTuple_GET_SIZE in debug interpreter builds of python-3.7
4188 when calling tp_new.
4189
41902018-09-01: ChristopherHogan
4191 [Guile] #1288 Fix garbage collection for guile >= 2.0.12.
4192
41932018-08-31: wsfulton
4194 [Python] #1319 C++11 hash tables support:
4195 std::unordered_map
4196 std::unordered_set
4197 std::unordered_multimap
4198 std::unordered_multiset
4199 is now compiling and working (sorting using -builtin not fully functional yet though).
4200
42012018-08-20: wkalinin
4202 #1305 Fix nested structure symbol tables in C mode to fix member name conflicts
4203 in different structs with the same nested struct member name.
4204
42052018-08-18: wsfulton
4206 [Python] #688 Fix makefile recursion when running python test-suite.
4207
42082018-08-18: wsfulton
4209 [Python] #1310 Re-implement Python -fastproxy option.
4210
4211 The previous implementation failed with Python 3 and abstract base clases.
4212 The new implementation replaces the Python 2 implementation using
4213 new.instancemethod with the C API PyMethod_New to match the equivalent Python 3
4214 implementation which uses PyInstanceMethod_New.
4215
4216 The new approach runs slightly faster. See #1310.
4217
42182018-08-12: gmazzamuto
4219 [Python] #1283 Update pybuffer.i library to use new-style Python buffer C API.
4220
42212018-08-12: brianhatwood,wsfulton
4222 [Java] #1303 #1304 Fix crash in directors when using OUTPUT and INOUT typemaps in typemaps.i and
4223 passing NULL pointers in C++ to director method overloaded and implemented in Java.
4224
42252018-08-10: wsfulton
4226 [Python] #1293 Improve TypeError message inconsistencies between default and fastdispatch
4227 mode when handling overloaded C++ functions. Previously the error message did not always
4228 display the possible C/C++ prototypes in fastdispatch mode.
4229
42302018-08-02: furylynx,jacobwgillespie,p2k
4231 [Javascript] #1290, #968. Add support for NodeJS versions 2-10.
4232
42332018-07-31: wsfulton
4234 [Python] #1293 Overloaded C++ function wrappers now raise a TypeError instead
4235 of NotImplementedError when the types passed are incorrect. This change means
4236 there is now consistency with non-overloaded function wrappers which have always
4237 raised TypeError when the incorrect types are passed. The error message remains
4238 the same and is for example now:
4239
4240 TypeError: Wrong number or type of arguments for overloaded function 'f'.
4241 Possible C/C++ prototypes are:
4242 f(int)
4243 f(char const *)
4244
4245 instead of:
4246
4247 NotImplementedError: Wrong number or type of arguments for overloaded function 'f'.
4248 Possible C/C++ prototypes are:
4249 f(int)
4250 f(char const *)
4251
4252 *** POTENTIAL INCOMPATIBILITY ***
4253
42542018-06-23: wsfulton
4255 [Python] #718 Fix pythonnondynamic feature for modern classes
4256
4257 Fixes nondynamic mode when an instance variable is set with the same
4258 name as a class variable in a class derived from a SWIG proxy class.
4259 This corner case set an instance variable instead of raising an AttributeError.
4260
4261 Also fix %pythonnondynamic in Python 3 with -modern. The metaclass
4262 containing the implementation was previously not being applied in Python 3.
4263
42642018-07-17: petrmitrichev,wsfulton
4265 [Python] #1275 #1279 Initialize function-local statics (singletons) that call Python
4266 code during Python module initialization in order to avoid deadlocks with subsequent
4267 multi-threaded usage.
4268
42692018-06-15: wsfulton
4270 [Python] Fix seg fault using Python 2 when passing a Python string, containing
4271 invalid utf-8 content, to a wstring or wchar * parameter. A TypeError is thrown instead, eg:
4272
4273 %include <std_wstring.i>
4274 void instring(const std::wstring& s);
4275
4276 instring(b"h\xe9llooo") # Python
4277
42782018-06-15: wsfulton
4279 [Python] Python 3.7 support: Replace use of deprecated PyUnicode_GetSize with
4280 PyUnicode_GetLength to remove deprecated warnings compiling the C/C++ wrappers.
4281
42822018-06-12: wsfulton
4283 [Python] Python 3.7 support: The %pythonabc feature in pyabc.i now uses base classes
4284 collections.abc.MutableSequence
4285 collections.abc.MutableMapping
4286 collections.abc.MutableSet
4287 instead of
4288 collections.MutableSequence
4289 collections.MutableMapping
4290 collections.MutableSet
4291 as the latter are deprecated in Python 3.7 and are due to be removed in Python 3.8.
4292 The classes in collections.abc.* are available from Python 3.3 onwards. If you
4293 require support for Python 3.2, then copy the pyabc.i file and modify by removing
4294 the few instances of the .abc sub-module.
4295
4296 *** POTENTIAL INCOMPATIBILITY ***
4297
42982018-06-12: olly,wsfulton
4299 [Python] #701 Remove support for Python versions < 2.7 and 3.0 and 3.1.
4300
4301 *** POTENTIAL INCOMPATIBILITY ***
4302
43032018-06-11: olly
4304 [Python] Fix new GCC8 warnings in generated code by avoiding casts
4305 between incompatible function types where possible, and by
4306 suppressing the warning when it's due to the design of Python's C
4307 API. Fixes #1259.
4308
43092018-06-08: philippkraft
4310 [Python] Stop exposing <CLASS>_swigregister to Python. It's not
4311 useful for user Python code to call this, and it just clutters the
4312 API unnecessarily. Fixes #1225.
4313
43142018-06-07: cmfoil, kabbi, Jamie Kirkpatrick, markok314, vadz, wsfulton, Yann Diorcet
4315 #170 Doxygen documentation support added. This allows translation of Doxygen comments
4316 into JavaDoc and PyDoc documentation. It is enabled via the -doxygen command line
4317 option. See the Doxygen.html chapter in the documentation for further information.
4318
43192018-06-07: olly
4320 [PHP] We've finally removed support for %pragma(php4) which was
4321 deprecated back in 2008. Use %pragma(php) instead, which has been
4322 supported since at least 2005.
4323
4324 *** POTENTIAL INCOMPATIBILITY ***
4325
43262018-06-07: olly
4327 [PHP5] Support for PHP5 has been removed. PHP5 is no longer
4328 actively supported by the PHP developers and security support for
4329 it ends completely at the end of 2018, so it doesn't make sense
4330 to include support for it in the upcoming SWIG 4.0.0 release.
4331
4332 *** POTENTIAL INCOMPATIBILITY ***
4333
43342018-06-06: olly
4335 [Lua] Improve configure probes for Lua headers and libs used in testsuite.
4336
43372018-05-15: kwwette
4338 [Octave] add support for version 4.4
4339 - Should not introduce any user-visible incompatibilities
4340
43412018-05-15: wsfulton
4342 [C#, D, Java] Fix lookup of csconstruct, dconstruct and javaconstruct typemaps.
4343 The C++ namespace was previously ignored when looking up the typemap.
4344
43452018-05-15: wsfulton
4346 [Javascript] Fix generated C++ code when using %nspace on namespaces that are more
4347 than two levels deep.
4348
43492018-05-14: wsfulton
4350 Issue #1251 Add support for C++17 nested namespace definitions,
4351 for example:
4352 namespace A::B { ... }
4353
43542018-05-11: wsfulton
4355 [C#, D, Java] Add support so that the %csmethodmodifiers, %dmethodmodifiers,
4356 %javamethodmodifiers can modify the method modifiers for the destructor wrappers
4357 in the proxy class: dispose, Dispose, delete. With this feature, it is now possible
4358 to make a C# proxy class sealed, eg when wrapping a class X, the virtual method modifiers
4359 can be removed using:
4360
4361 %typemap(csclassmodifiers) X "public sealed class"
4362 %csmethodmodifiers X::~X "public /*virtual*/";
4363
43642018-04-18: olly
4365 [Python] Suppress new pycodestyle warning:
4366 E252 missing whitespace around parameter equals
4367
43682018-04-07: goatshriek
4369 [Ruby] #1213 Fix ruby %alias directive for global C/C++ functions.
4370
43712018-04-03: olly
4372 [Ruby] Fix to pass Qnil instead of NULL to rb_funcall(), which silences GCC
4373 -Wconversion-null warning (on by default with recent GCC).
4374
43752018-03-09: wsfulton
4376 [Java] #1184 Fix swigReleaseOwnership() and swigTakeOwnership() regression
4377 for non-director classes. Restores a dynamic_cast which was previously removed.
4378
43792018-03-07: llongi
4380 Github PR #1166 - Fix preprocessor handling of macros with commas
4381 in a // comment.
4382
43832018-02-18: JPEWdev
4384 Patch #1164 - Add support for a command-line options file, also sometimes
4385 called a response file. This is useful if the command-line options exceed
4386 the system command-line length limit. To use, put the command-line options
4387 into a file, then provide the file name prefixed with @, for example using
4388 a file called args.txt:
4389
4390 swig @args.txt
4391
43922018-02-11: wsfulton
4393 [Javascript] #1187 Fix compilation error wrapping std::complex via
4394 std_complex.i.
4395
43962018-01-30: smarchetto
4397 [Scilab] add type name argument in SWIG_ptr() function to cast from pointer address to typed pointers
4398
43992018-01-16: wsfulton
4400 Expressions following a preprocessor directive must now be separated by whitespace
4401 or non-numeric characters. This syntax change makes the SWIG preprocessor work like
4402 the C preprocessor in this area.
4403
4404 For example, the following code used be accepted as valid syntax:
4405 #if1
4406 #define ABC 123
4407 #endif
4408
4409 Now you get an error:
4410 example.h:1: Error: Unknown SWIG preprocessor directive: if1 (if this is a block of
4411 target language code, delimit it with %{ and %})
4412 example.h:3: Error: Extraneous #endif.
4413
4414 The following is the correct syntax:
4415 #if 1
4416 #define ABC 123
4417 #endif
4418
4419 The following of course also works:
4420 #if(1)
4421 #define ABC 123
4422 #endif
4423
4424 *** POTENTIAL INCOMPATIBILITY ***
4425
44262018-01-15: wsfulton
4427 Fix issue #1183. Floating point exception evaluating preprocessor expressions
4428 resulting in division by zero.
4429
44302018-01-14: wsfulton
4431 Fix issue #1172. Seg fault parsing invalid exponents in the preprocessor.
4432
44332018-01-12: Liryna
4434 [C#] Patch #1128. Add ToArray function to std::vector wrappers.
4435
44362018-01-12: wsfulton
4437 [Java] Fix issue #1156. Add missing throws clause for interfaces when using the
4438 %interface family of macros.
4439
44402018-01-05: wsfulton
4441 Fix default arguments using expressions containing -> syntax error. Problem reported on
4442 swig-user mailing list.
4443
44442017-12-30: wsfulton
4445 [Python] Replace pep8 with pycodestyle for checking the Python code style when
4446 running Python tests.
4447
44482017-12-30: davedissian
4449 Fixed a symbol lookup issue when encountering a typedef of a symbol from the tag
4450 namespace to the global namespace when the names are identical, such as 'typedef
4451 struct Foo Foo;'.
4452
44532017-12-13: wsfulton
4454 [Perl] add missing support for directorfree typemaps.
4455
44562017-12-13: wsfulton
4457 Issue #1167 Fix directorout typemaps which were causing undefined behaviour when
4458 returning pointers by reference.
4459
44602017-12-08: olly
Olly Betts1dd5d502019-03-01 23:11:13 +13004461 [PHP] Use ZEND_MODULE_GLOBALS_ACCESSOR to access globals so the
4462 generated code builds when PHP was built with ZTS enabled.
William S Fulton6a917232019-04-28 21:01:21 +01004463
44642017-12-04: wsfulton
4465 [Python] Add missing checks for failures in calls to PyUnicode_AsUTF8String. Previously a
4466 seg fault could occur when passing invalid UTF8 strings (low surrogates), eg passing
4467 u"\udcff" to the C layer (Python 3).
4468
44692017-11-24: joequant
4470 [R] Fix #1124 and return R_NilValue for null pointers
4471
44722017-11-29: wsfulton
4473 [Java] director exception handling improvements.
4474
4475 When a director method throws an exception and it is caught by DirectorException
4476 and passed back to Java using Swig::DirectorException::throwException, the Java
4477 stack trace now contains the original source line that threw the exception.
4478
4479 Deprecate Swig::DirectorException::raiseJavaException, please replace usage with
4480 Swig::DirectorException::throwException.
4481
4482 *** POTENTIAL INCOMPATIBILITY ***
4483
44842017-10-26: wsfulton
4485 Add support for C++11 ref-qualifiers when using directors.
4486
44872017-10-26: wsfulton
4488 Fix generated code when using directors and methods returning const ref pointers.
4489
44902017-10-26: wsfulton
4491 [C#, D, Java, Octave, R, Scilab] Port director typemaps to these additional languages.
4492 Issue #700.
4493
44942017-10-26: radarsat1
4495 [Ruby Python] Patch #1029 - Correct handling of null using directors and shared_ptr.
4496
44972017-10-10: joequant
4498 [R] pass enum expressions to R. This will generate
4499 incorrect files when there is an arithmetic expression
4500 in the enum, but this is better than silently generating
4501 incorrect code
4502
45032017-10-09: olly
4504 [PHP] Fix incorrect wrapper code generated when there's a
4505 combination of overloading, parameters with a default value
4506 and %newobject. Fixes https://sourceforge.net/p/swig/bugs/1350/
4507
45082017-10-09: olly
4509 Remove GCJ support. It isn't in a good state and doesn't seem to
4510 be used, and GCC7 dropped GCJ. Closes
4511 https://sourceforge.net/p/swig/bugs/823/
4512
45132017-10-07: olly
4514 Fix preprocessor handling of empty macro arguments to match that of
4515 C/C++ compilers. Fixes issue #1111 and
4516 https://sourceforge.net/p/swig/bugs/826/
4517
45182017-10-06: wsfulton
4519 [Python] Issue #1108. Fix platform inconsistency in Python default argument handling.
4520 32 bit and 64 bit compiled versions of SWIG generated different Python files
4521 when default arguments were outside the range of 32 bit signed integers.
4522 The default arguments specified in Python are now only those that are in the
4523 range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.
4524
45252017-10-02: wsfulton
4526 [C#] Fix std::complex types passed by value.
4527
45282017-10-02: wsfulton
4529 [Javascript, Python, Ruby] Issue #732 - Missing type information for std::complex
4530 in std_complex.i meant that previously std::complex always had to be fully qualified
4531 in order to be wrapped with the appropriate typemaps.
4532
45332017-10-01: joequant
4534 allow R package names with docs
4535 allowing multiple get accessors in R
4536 fix smart-pointer and NAMESPACE support
4537 constructors now returning smart pointers (if class
4538 declared as such)
4539 smart-pointer classes deriving from parent smart-pointers
4540
45412017-09-29: wsfulton
4542 Issue #1100 - Allow an instantiated template to have the same name in the target
4543 language as the C++ template name, for example, this is now possible:
4544
4545 template<typename T> struct X { ... };
4546 %template(X) X<int>;
4547
45482017-09-23: wsfulton
4549 Issue #1098. Fix overloading of shared_ptr with underlying pointer types, eg:
4550
4551 void m(std::shared_ptr<T> p);
4552 void m(T &p);
4553 void m(T *p);
4554
4555 Only the first method is wrapped and the others are ignored/shadowed.
4556 The implementation is done via a new attribute in the 'typecheck' typemap called
4557 'equivalent'. If specified, it must contain the equivalent pointer type for overloading
4558 and can only be used for the special SWIG_TYPECHECK_POINTER precedence level.
4559 The shared_ptr 'typecheck' typemaps have been modified accordingly.
4560 Here is a simplified version:
4561
4562 %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="T *")
4563 T,
4564 T CONST &,
4565 T CONST *,
4566 T *CONST&,
4567 std::shared_ptr< T >,
4568 std::shared_ptr< T > &,
4569 std::shared_ptr< T > *,
4570 std::shared_ptr< T > *&
4571 { ... }
4572
4573 Overloading with any of these types will result in SWIG ignoring all but the first
4574 overloaded method by default. Without the 'equivalent' attribute, wrapping the overloaded
4575 methods resulted in types being shadowed (scripting languages) or code that did not
4576 compile (statically typed languages).
4577
45782017-09-19: futatuki
4579 [Python] #1003 Add --with-2to3=/path/to/2to3 option to configure.
4580
45812017-09-18: wsfulton
4582 Fix type promotion wrapping constant expressions of the form:
4583 # define EXPR_MIXED1 (0x80 + 11.1) - 1
4584 This was previously an integral type instead of a floating point type.
4585
45862017-09-17: wsfulton
4587 Fix generated code for constant expressions containing wchar_t L literals such as:
4588 # define __WCHAR_MAX (0x7fffffff + L'\0')
4589 # define __WCHAR_MIN (-__WCHAR_MAX - 1)
4590
45912017-09-10: mlamarre
4592 [Python] Patch #1083. Define_DEBUG to 1 to do exactly like Visual Studio
4593 /LDd, /MDd or /MTd compiler options.
4594
45952017-08-25: wsfulton
4596 Issue #1059. Add support for C++11 ref-qualifiers on non-static member functions.
4597 Members with lvalue ref-qualifiers such as:
4598
4599 struct RQ {
4600 void m1(int x) &;
4601 void m2(int x) const &;
4602 };
4603
4604 are wrapped like any other member function. Member functions with rvalue ref-qualifiers
4605 are ignored by default, such as:
4606
4607 struct RQ {
4608 void m3(int x) &&;
4609 void m4(int x) const &&;
4610 };
4611
4612 example.i:7: Warning 405: Method with rvalue ref-qualifier m3(int) && ignored.
4613 example.i:8: Warning 405: Method with rvalue ref-qualifier m4(int) const && ignored.
4614
4615 These can be unignored and exposed to the target language, see further documentation in
4616 CPlusPlus11.html.
4617
46182017-08-16: wsfulton
4619 Fix #1063. Add using declarations to templates into typedef table.
4620
4621 Using declarations to templates were missing in SWIG's internal typedef tables.
4622 This led to a few problems, such as, templates that did not instantiate and generated
4623 C++ code that did not compile as SWIG did not know what scope the template was
4624 in. This happened mostly when a using declaration was used on a template type in a
4625 completely unrelated namespace.
4626
46272017-08-16: wsfulton
4628 Fix type lookup in the presence of using directives and using declarations.
4629
4630 Fix some cases of type lookup failure via a combination of both using directives and
4631 using declarations resulting in C++ code that did not compile as the generated type was
4632 not fully qualified for use in the global namespace. Example below:
4633
4634 namespace Space5 {
4635 namespace SubSpace5 {
4636 namespace SubSubSpace5 {
4637 struct F {};
4638 }
4639 }
4640 using namespace SubSpace5;
4641 using SubSubSpace5::F;
4642 void func(SubSubSpace5::F f);
4643 }
4644
46452017-08-16: wsfulton
4646 Issue #1051. %template scope enforcement and class definition fixes.
4647
4648 The scoping rules around %template have been specified and enforced.
4649 The %template directive for a class template is the equivalent to an
4650 explicit instantiation of a C++ class template. The scope for a valid
4651 %template instantiation is now the same as the scope required for a
4652 valid explicit instantiation of a C++ template. A definition of the
4653 template for the explicit instantiation must be in scope where the
4654 instantiation is declared and must not be enclosed within a different
4655 namespace.
4656
4657 For example, a few %template and C++ explicit instantiations of std::vector
4658 are shown below:
4659
4660 // valid
4661 namespace std {
4662 %template(vin) vector<int>;
4663 template class vector<int>;
4664 }
4665
4666 // valid
4667 using namespace std;
4668 %template(vin) vector<int>;
4669 template class vector<int>;
4670
4671 // valid
4672 using std::vector;
4673 %template(vin) vector<int>;
4674 template class vector<int>;
4675
4676 // ill-formed
4677 namespace unrelated {
4678 using std::vector;
4679 %template(vin) vector<int>;
4680 template class vector<int>;
4681 }
4682
4683 // ill-formed
4684 namespace unrelated {
4685 using namespace std;
4686 %template(vin) vector<int>;
4687 template class vector<int>;
4688 }
4689
4690 // ill-formed
4691 namespace unrelated {
4692 namespace std {
4693 %template(vin) vector<int>;
4694 template class vector<int>;
4695 }
4696 }
4697
4698 // ill-formed
4699 namespace unrelated {
4700 %template(vin) std::vector<int>;
4701 template class std::vector<int>;
4702 }
4703
4704 When the scope is incorrect, an error now occurs such as:
4705
4706 cpp_template_scope.i:34: Error: 'vector' resolves to 'std::vector' and
4707 was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
4708
4709 Previously SWIG accepted the ill-formed examples above but this led to
4710 numerous subtle template scope problems especially in the presence of
4711 using declarations and using directives as well as with %feature and %typemap.
4712
4713 Actually, a valid instantiation is one which conforms to the C++03
4714 standard as C++11 made a change to disallow using declarations and
4715 using directives to find a template.
4716
4717 // valid C++03, ill-formed C++11
4718 using std::vector;
4719 template class vector<int>;
4720
4721 Similar fixes for defining classes using forward class references have
4722 also been put in place. For example:
4723
4724 namespace Space1 {
4725 struct A;
4726 }
4727 namespace Space2 {
4728 struct Space1::A {
4729 void x();
4730 }
4731 }
4732
4733 will now error out with:
4734
4735 cpp_class_definition.i:5: Error: 'Space1::A' resolves to 'Space1::A' and
4736 was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.
4737
4738 Previously some symbols would have been instantiated in the wrong scope and led
4739 to lots of scope problems involving SWIG typemaps, features, renames etc.
4740 You will need to correct the scope used in other SWIG directives which do not
4741 support 'using declarations' and 'using directives'. For example, if you previously had:
4742
4743 %rename(Zap) vector<int>::clear;
4744 using namespace std;
4745 %template(VectorInt) vector<int>;
4746
4747 Prior versions of SWIG incorrectly instantiated vector<int> in the global namespace
4748 and so the %rename matched. Now the template is instantiated in the correct namespace,
4749 so is fully qualified as std::vector<int>. The other SWIG directives need correcting as
4750 they do not follow 'using declarations' and 'using directives'. Change it to:
4751
4752 %rename(Zap) std::vector<int>::clear;
4753 using namespace std;
4754 %template(vin) vector<int>;
4755
4756
4757 *** POTENTIAL INCOMPATIBILITY ***
4758
47592017-08-16: wsfulton
4760 Fix scope lookup for template parameters containing unary scope operators.
4761
4762 Fixes cases like:
4763
4764 namespace Alloc {
4765 template<typename T> struct Rebind {
4766 typedef int Integer;
4767 };
4768 }
4769 %template(RebindBucket) Alloc::Rebind< Bucket >;
4770 OR
4771 %template(RebindBucket) Alloc::Rebind< ::Bucket >;
4772
4773 Alloc::Rebind< Bucket >::Integer Bucket1();
4774 Alloc::Rebind< ::Bucket >::Integer Bucket2();
4775 Alloc::Rebind<::template TemplateBucket<double>>::Integer Bucket3();
4776
47772017-08-16: wsfulton
4778 For templates only, the template parameters are fully resolved when
4779 handling typemaps. Without this, it is too hard to have decent rules
4780 to apply typemaps when parameter types are typedef'd and template
4781 parameters have default values.
4782
4783 Fixes %clear for typedefs in templates, eg:
4784
4785 %typemap("in") XXX<int>::Long "..."
4786 template typename<T> struct XXX {
4787 typedef long Long;
4788 };
4789 %clear XXX<int>::Long;
4790
4791 as the typemap was previously incorrectly stored as a typemap for long
4792 instead of XXX<int>::Long.
4793
47942017-08-05: olly
4795 [C++11] Allow static_assert at the top level (and disallow it right
4796 after template<T>). Fixes issue 1031 reported by Artem V L.
4797
47982017-08-02: wsfulton
4799 Fix incorrectly shown warning when an empty template instantiation was used on a
4800 class used as a base class and that base class was explicitly ignored with %ignore.
4801 Example of the warning which will no longer appear:
4802
4803 Warning 401: Base class 'Functor< int,int >' has no name as it is an empty
4804 template instantiated with '%template()'. Ignored.
4805
48062017-07-17: fflexo
4807 [Java] #674 Add std_list.i to add support for std::list containers. The Java proxy
4808 extends java.util.AbstractSequentialList and makes the C++ std::list container look
4809 and feel much like a java.util.LinkedList from Java.
4810
48112017-07-07: wsfulton
4812 [Python] Fix display of documented template types when using the autodoc
4813 feature. For example when wrapping:
4814
4815 %feature("autodoc");
4816 template<typename X> struct T {};
4817 %template(TInteger) T<int>;
4818
4819 the generated documentation contains:
4820 """Proxy of C++ T< int > class."""
4821 instead of:
4822 """Proxy of C++ T<(int)> class."""
4823 and
4824 """__init__(TInteger self) -> TInteger"""
4825 instead of
4826 """__init__(T<(int)> self) -> TInteger"""
4827
48282017-06-27: nihaln
4829 [PHP] Update the OUTPUT Typemap to add return statement to the
4830 PHP Wrapper.
4831
48322017-06-27: nihaln
4833 [PHP] Update the enum and value examples to use the OO wrappers
4834 rather than the flat functions produced with -noproxy. There's
4835 not been a good reason to use -noproxy for since PHP5 OO wrapping
4836 was fixed back in 2005.
4837
48382017-06-23: m7thon
4839 [Python] fix and improve default argument handling:
4840
4841 1. Fix negative octals. Currently not handled correctly by `-py3`
4842 (unusual case, but incorrect).
4843 2. Fix arguments of type "octal + something" (e.g. `0640 | 04`).
4844 Currently drops everything after the first octal. Nasty!
4845 3. Fix bool arguments "0 + something" (e.g. `0 | 1`) are always
4846 "False" (unusual case, but incorrect).
4847 4. Remove special handling of "TRUE" and "FALSE" from
4848 `convertValue` since there's no reason these have to match
4849 "true" and "false".
4850 5. Remove the Python 2 vs. Python 3 distinction based on the
4851 `-py3` flag. Now the same python code is produced for default
4852 arguments for Python 2 and Python 3. For this, octal default
4853 arguments, e.g. 0644, are now wrapped as `int('644', 8)`. This
4854 is required, as Python 2 and Python 3 have incompatible syntax
4855 for octal literals.
4856
4857 Fixes #707
4858
48592017-06-21: futatuki
4860 #1004 - Fix ccache-swig executable name to respect configure's --program-prefix and
4861 --program-suffix values if used.
4862
48632017-06-21: tamuratak
4864 [Ruby] #911 - Add std::wstring support.
4865
48662017-06-19: wsfulton
4867 [Python] Fix handling of rich comparisons when wrapping overloaded operators:
4868
4869 operator< operator<= operator> operator>= operator== operator!=
4870
4871 Previously a TypeError was always thrown if the type was not correct. NotImplemented
4872 is now returned from these wrapped functions if the type being compared with is
4873 not correct. The subsequent behaviour varies between different versions of Python
4874 and the comparison function being used, but is now consistent with normal Python
4875 behaviour. For example, for the first 4 operator overloads above, a TypeError
4876 'unorderable types' is thrown in Python 3, but Python 2 will return True or False.
4877 NotImplemented should be returned when the comparison cannot be done, see PEP 207 and
4878 https://docs.python.org/3/library/constants.html#NotImplemented
4879
4880 Note that the bug was only present when overloaded operators did not also have a
4881 function overload.
4882
4883 Fixes SF bug #1208 (3441262) and SF patch #303.
4884
4885 *** POTENTIAL INCOMPATIBILITY ***
4886
48872017-06-17: fabrice102
4888 [Go] Fix Go callback example. Fixes github #600, #955, #1000.
4889
48902017-06-16: wsfulton
4891 Make sure warning and error messages are not split up by other processes writing to
4892 stdout at the same time.
4893
48942017-06-16: wsfulton
4895 [R] Fix wrapping function pointers containing rvalue and lvalue reference parameters.
4896
48972017-06-13: olly
4898 [Perl] Fix testsuite to work without . in @INC - it was removed in
4899 Perl 5.26 for security reasons, and has also been removed from
4900 older versions in some distros. Fixes #997 reported by lfam.
4901
49022017-06-03: wsfulton
4903 Fix %import on a file containing a file scope %fragment forced inclusion to not
4904 generate the fragment contents as %import should not result in code being generated.
4905 The behaviour is now the same as importing code insertion blocks.
4906 Wrapping FileC.i in the following example will result in no generated code, whereas
4907 previously "#include <limits.h>" was generated:
4908
4909 // FileA.i
4910 %fragment("<limits.h>", "header") %{
4911 #include <limits.h>
4912 %}
4913
4914 %{
4915 #include <stdio.h>
4916 %}
4917 %fragment("<limits.h>");
4918
4919 // FileC.i
4920 %import "FileA.i"
4921
4922 *** POTENTIAL INCOMPATIBILITY ***
4923
49242017-05-26: Volker Diels-Grabsch, vadz
4925 [Java] #842 Extend from java.util.AbstractList<> and implement java.util.RandomAccess for
4926 std::vector wrappers. This notably allows to iterate over wrapped vectors in a natural way.
4927 Note that boxed types are now used in the Java layer when wrapping vector of C primitive
4928 types, for example. This may introduce some subtle incompatibilities due to some
4929 differences in how Java converts boxed types and unboxed types. For example,
4930
4931 int i=0;
4932 double d1 = i; // ok
4933 Double d2 = i; // error: incompatible types: int cannot be converted to Double
4934
4935 This can be a problem when calling the add and set functions. A suggested backwards
4936 compatible workaround is to use something like (shown for std::vector<double>:
4937
4938 #if defined(SWIGJAVA)
4939 // Add in old api that uses non-boxed types
4940 %extend std::vector<double> {
4941 %proxycode %{
4942 public void add(double x) {
4943 add(Double.valueOf(x));
4944 }
4945 public void set(int i, double val) {
4946 set(i, Double.valueOf(val));
4947 }
4948 %}
4949 }
4950 #endif
4951
4952 %include "std_vector.i"
4953 %template(VectorDouble) std::vector<double>;
4954
4955 *** POTENTIAL INCOMPATIBILITY ***
4956
49572017-05-30: davidcl
4958 [Scilab] #994 Undefined symbol error when loading in Scilab 6
4959
49602017-05-25: asibross
4961 [Java] #370 #417 Missing smart pointer handling in Java director extra methods
4962 swigReleaseOwnership() and swigTakeOwnership().
4963
49642017-05-23: wsfulton
4965 [Java] #230 #759 Fix Java shared_ptr and directors for derived classes java compilation
4966 error.
4967
4968 For shared_ptr proxy proxy classes, add a protected method swigSetCMemOwn for modifying
4969 the swigCMemOwn and swigCMemOwnDerived member variables which are used by various other
4970 methods for controlling memory ownership.
4971
49722017-05-21: Sghirate
4973 [Java, C#, D] #449 Remove unnecessary use of dynamic_cast in directors to enable
4974 non-RTTI compilation.
4975
49762017-05-21: wsfulton
4977 [Python] #993 Fix handling of default -ve unsigned values, such as:
4978 void f(unsigned = -1U);
4979
49802017-05-20: jschueller
4981 [Python] #991 Fix E731 PEP8 warning: do not assign a lambda expression
4982
49832017-05-16: nihal95
4984 [PHP] Add %pragma version directive to allow the version of the
4985 extension to be set. Patch #970, fixes #360.
4986
49872017-05-13: yag00
4988 Patch #975 - Add support for noexcept on director methods.
4989
49902017-04-27: redbrain
4991 Issue #974, Patch #976 - Fix preprocessor handling of macros with commas in a comment.
4992
49932017-04-25: jleveque
4994 [Lua] #959 - Fix Visual Studio C4244 conversion warnings in Lua wrappers.
4995
49962017-04-21: tamuratak
4997 [Ruby] #964 - Add shared_ptr director typemaps.
4998
49992017-04-20: wsfulton
5000 [Ruby] #586, #935 Add assert for invalid NULL type parameter when calling SWIG_Ruby_NewPointerObj.
5001
50022017-04-20: tamuratak
5003 [Ruby] #930, #937 - Fix containers of std::shared_ptr.
5004 Upcasting, const types (eg vector<shared_ptr<const T>>) and NULL/nullptr support added.
5005
50062017-04-12: smarchetto
5007 [Scilab] New parameter targetversion to specify the Scilab target version (5, 6, ..) for code generation
5008 With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)
5009
50102017-03-24: tamuratak
5011 [Ruby] Fix #939 - Wrapping std::vector<bool> fix due to incorrect null checks
5012 on VALUE obj.
5013
50142017-03-17: vadz
5015 [C#] #947 Add support for std::complex<T>
5016
50172017-03-17: wsfulton
5018 [Go] Fix handling of typedef'd function pointers and typedef'd member function pointers
5019 such as:
5020
5021 typedef int (*FnPtr_td)(int, int);
5022 int do_op(int x, int y, FnPtr_td op);
5023
50242017-03-16: wsfulton
5025 Add support for member const function pointers such as:
5026
5027 int fn(short (Funcs::* parm)(bool)) const;
5028
5029 Also fix parsing of references/pointers and qualifiers to member
5030 pointers such as:
5031
5032 int fn(short (Funcs::* const parm)(bool));
5033 int fn(short (Funcs::* & parm)(bool));
5034
50352017-03-10: wsfulton
5036 Extend C++11 alternate function syntax parsing to support const and noexcept, such as:
5037
5038 auto sum1(int x, int y) const -> int { return x + y; }
5039 auto sum2(int x, int y) noexcept -> int { return x + y; }
5040
50412017-02-29: tamuratak
5042 [Ruby] #917 - Add Enumerable module to all container class wrappers. It was missing
5043 for std::list, std::multiset, std::unordered_multiset and std::unordered_map.
5044
50452017-02-27: assambar
5046 [C++11] Extend parser to support throw specifier in combination
5047 with override and/or final.
5048
50492017-02-10: tamuratak
5050 [Ruby] #883 - Add support for C++11 hash tables:
5051 std::unordered_map
5052 std::unordered_set
5053 std::unordered_multimap
5054 std::unordered_multiset
5055
50562017-02-08: jcsharp
5057 [C#] #887 Improve std::vector<T> wrapper constructors -
5058 Replace constructor taking ICollection with IEnumerable and also add IEnumerable<T>
5059 constructor to avoid the boxing and unboxing overhead of the original constructor,
5060 when the type parameter is a value type.
5061
Olly Bettsccf8fe02017-03-22 15:43:14 +13005062Version 3.0.12 (27 Jan 2017)
William S Fulton2ab08e42017-01-28 00:23:59 +00005063============================
5064
50652017-01-27: wsfulton
5066 [C#] #882 Fix missing filename in error messages when there is a problem
5067 writing out C# files.
5068
50692017-01-27: briancaine
5070 [Guile] #744 Fix compilation errors in Guile wrappers - regression
5071 introduced in swig-3.0.11.
5072
50732017-01-24: andrey-starodubtsev
5074 [Java] Apply #704 - director typemap improvements.
5075 Memory leak fixes, add support for "directorargout" typemap and
5076 add director support to typemaps.i.
5077
50782017-01-24: wsfulton
5079 Enhance %extend to extend a class with template constructors, eg:
5080
5081 struct Foo {
5082 %extend {
5083 template<typename T>
5084 Foo(int a, T b) {
5085 ...
5086 }
5087 }
5088 };
5089 %template(Foo) Foo::Foo<double>;
5090
50912017-01-22: wsfulton
5092 Issue #876 Enhance %extend to extend a class with template methods, eg:
5093
5094 struct Foo {
5095 %extend {
5096 template<typename T>
5097 void do_stuff(int a, T b) {
5098 ...
5099 }
5100 }
5101 };
5102 %template(do_stuff_inst) Foo::do_stuff<double>;
5103
5104 Similarly for static template methods.
5105
51062017-01-22: kwwette
5107 [Octave] add support for version 4.2
5108 - The Octave API now uses some C++11 features. It is recommended to use
5109 the mkoctfile program supplied by Octave to compile the SWIG-generated
5110 wrapper code, as mkoctfile will ensure the correct C++ compiler/options
5111 are used. Otherwise, the value of `mkoctfile -p CXX` should be parsed
5112 for any -std=* flags which might be present.
5113 - Octave has dropped support for << and >> operators, so SWIG now
5114 ignores them.
5115 - The Octave error() function now raises C++ exceptions to propagate
5116 Octave errors, so %exception directives may need to be modified.
5117 For convenience the SWIG_RETHROW_OCTAVE_EXCEPTIONS macro can be used
5118 to rethrow any Octave exceptions for Octave itself to handle, e.g.:
5119
5120 try {
5121 $action // may call error()
5122 }
5123 SWIG_RETHROW_OCTAVE_EXCEPTIONS // error() exceptions are rethrown
5124 catch(...) {
5125 ... // all other exceptions
5126 }
5127
5128 *** POTENTIAL INCOMPATIBILITY ***
5129
51302017-01-16: wkalinin
5131 [C#] Fix #733 regression introduced in swig-3.0.9.
5132 Missing virtual function override in C# layer when using %import.
5133
51342017-01-16: fschlimb
5135 Fix #813 template symbol name lookup bug when typedef names are the same but in different
5136 namespaces.
5137
51382017-01-15: wsfulton
5139 [C# D Java]
5140 The SWIG library no longer uses the javatype, dtype or cstype typemaps, thereby
5141 completely freeing them up for users to use without having to replicate the library
5142 code that they previously added. The code previously generated by these typemaps
5143 has been replaced by the new %proxycode directive. Their use in the library code
5144 was fairly minimal:
5145
5146 C# cstype: std_array.i std_map.i std_vector.i
5147 D dtype: std_vector.i
5148 Java javatype: arrays_java.i
5149
51502017-01-14: wsfulton
5151 The %extend directive can now optionally support one of the 'class', 'struct' or 'union'
5152 keywords before the identifier name, for example:
5153
5154 struct X { ... };
5155 %extend struct X { ... }
5156
5157 Previously this had to specified as:
5158
5159 struct X { ... };
5160 %extend X { ... }
5161
51622017-01-13: wsfulton
5163 [C# D Java] Add new %proxycode directive which is a macro for %insert("proxycode").
5164 This is a way of adding pure C#/D/Java code into the appropriate proxy class, eg:
5165
5166 %extend Proxy2 {
5167 %proxycode %{
5168 public int proxycode2(int i) {
5169 return i+2;
5170 }
5171 %}
5172 }
5173
5174 %inline %{
5175 struct Proxy2 {};
5176 %}
5177
5178 There will then be a pure Java/C#/D method called proxycode2 in the Proxy2 class.
5179
51802016-12-31: ajrheading1
5181 Issue #860 - Remove use of std::unary_function and std::binary_function
5182 which is deprecated in C++11.
5183
51842016-12-30: olly
5185 [PHP7] Register internal 'swig_runtime_data_type_pointer' constant
5186 as "CONST_PERSISTENT" to avoid segmentation fault on module unload.
5187 Fixes #859 reported by Timotheus Pokorra. Thanks also to Javier Torres
5188 for a minimal reproducer.
5189
William S Fulton12e1ab02016-12-30 23:49:46 +00005190Version 3.0.11 (29 Dec 2016)
5191============================
5192
51932016-12-24: wsfulton
5194 [C#] Add %feature("csdirectordelegatemodifiers") to enable customization
5195 of the delegate access modifiers generated in director classes.
5196 Fixes issue #748.
5197
51982016-12-23: wsfulton
5199 [Python] Fix builtin "python:slot" feature failing for tp_hash when using
5200 hashfunc closure with a "Wrong type for hash function" for Python 2.
5201 Issue #843.
5202
52032016-12-21: joequamt
5204 Changed generation of functions so that only functions
5205 that end in _set generate accessor functions rather than
5206 looking for "set".
5207 Change generation of operators to not have underscores
5208 to start in R. Users need to provide custom names for these operator overloads.
5209
52102016-12-21: olly
5211 Fix isfinite() checks to work with all C++11 compilers.
5212 Fixes issues #615, #788 and #849.
5213
52142016-12-20: wsfulton
5215 %namewarn unnecessarily caused keyword warnings for non-instantiated template classes
5216 and duplicate warnings for instantiated template classes when keywords were used.
5217 Issue #845.
5218
52192016-12-18: ezralanglois
5220 [Python, Ruby, Octave] Memory leak fix on error in std::pair wrappers.
5221 Issue #851.
5222
52232016-12-18: wsfulton
5224 Zero initialize arrays when using %array_class and %array_functions.
5225
52262016-12-18: t-ikegami
5227 [Python] Fix #446
5228 Python %array_class of carrays.i failed with -builtin option.
5229
William S Fulton05da0682017-01-27 19:08:10 +000052302016-12-16: briancaine
William S Fulton12e1ab02016-12-30 23:49:46 +00005231 [Guile] Patch #744 Added support for Guile's native pointer functionality
5232
52332016-12-01: wsfulton
5234 [Python] Issue #769.
5235 Add optional moduleimport attribute to %module so that the
5236 default module import code can be overridden. See the "Searching for the wrapper module"
5237 documentation in Python.html. Example:
5238
5239 %module(moduleimport="import _foo") foo
5240
5241 $module also expands to the low-level C/C++ module name, so the following is the
5242 same as above
5243
5244 %module(moduleimport="import $module") foo
5245
52462016-11-30: olly
5247 [PHP] Add support for PHP7. PHP5's C extension API has changed
5248 substantially so you need to use -php7 to specify you want PHP7
5249 compatible wrappers. The default extension for generated wrappers
5250 is now .cxx (to match SWIG's default for every other language - to
5251 generate foo_wrap.cpp you can run SWIG with -cppext cpp). Fixes
5252 issue #571.
5253
5254 As part of this change, the language subdirectory for PHP5 has
5255 changed from "php" to "php5" - if you are making use of the search
5256 path feature where the language subdirectory of each directory
5257 is also searched, you'll need to update your bindings. A simple
5258 fix which works for older and newer SWIG is to add a symlink:
5259 ln -s php php5
5260
5261 *** POTENTIAL INCOMPATIBILITY ***
5262
52632016-11-30: olly
5264 [PHP] Only emit one copy of each distinct arginfo. Previously we
5265 emitted a separate one for every wrapped function, but typically
5266 many functions have the same number of parameters and combinations
5267 of parameters passed by reference or not.
5268
5269 This change significantly reduces both the size of the generated
5270 wrapper, and of the compiled PHP extension module (e.g. by ~6% for
5271 the stripped extension module for Xapian's PHP7 bindings).
5272
52732016-11-28: wsfulton
5274 Fix %rename override of wildcard %rename for templates. For example:
5275
5276 %rename(GlobalIntOperator) *::operator bool; // wildcard %rename
5277
5278 %rename(XIntOperator) X::operator bool; // fix now overrides first %rename above
5279 OR
5280 %rename(XIntOperator) X<int>::operator bool; // fix now overrides first %rename above
5281
5282 template<typename T> struct X {
5283 operator bool();
5284 ...
5285 };
5286 %template(Xint) X<int>;
5287
5288 This also fixes %rename override of global %rename for templates. For example:
5289
5290 // Global rename to make all functions start with a lower case letter
5291 %rename("%(firstlowercase)s", %$isfunction ) "";
5292 %rename(woohoo) W::Woo; // fix now overrides above %rename
5293
5294 template<typename T> struct W {
5295 W Woo();
5296 ...
5297 };
5298 %template(Wint) W<int>;
5299
5300 The above also introduces a possibly unexpected change. Many of the STL containers
5301 provided by SWIG use %rename to rename some methods, eg in std::vector, push_back
5302 is renamed to add in Java. Previously this intended rename did not happen when using
5303 using global %rename rules and the method would remain as push_back, but is now
5304 renamed to add. Some more info in issue #856.
5305
5306 *** POTENTIAL INCOMPATIBILITY ***
5307
53082016-11-26: m7thon
5309 [Python] Issue #709 - improved wrapping of division operators
5310 'from __future__ import division' now works in Python 2 whether or not the
5311 -py3 flag is used.
5312
53132016-11-12: joequant
5314 [R] Issue #697 - fix comma issue with overload methods
5315
53162016-11-12: joequant
5317 [R] Issue #555 - R runtime needs stdio.h
5318
53192016-11-02: wsfulton
5320 [Python] Issue #816 - fix compilation error when using -extranative and -builtin.
5321
53222016-11-02: liorgold
5323 Patch #741 - Add support for C++11 alias templates, see updated CPlusPlus11.html
5324 documentation.
5325
53262016-10-30: myd7349
5327 [C#] Patch #740 Add std_array.i for C# for wrapping std::array.
5328
5329 Patch also enhances std::vector<std::wstring> C# wrappers with additional functions
5330 (Contains, IndexOf, LastIndexOf and Remove).
5331
53322016-10-30: tobilau
5333 [Java] Fix wrappers for wstring parameters in director methods to cleanup local
5334 ref after director callback has finished.
5335
53362016-10-23: wsfulton
5337 [C#] Add missing csdirectorin VOID_INT_PTR and csdirectorout VOID_INT_PTR typemaps.
5338
53392016-10-23: jiulongw
5340 Patch #781 - Fix wrapping of C compound expressions containing char constants
5341 in quotes such as:
5342
5343 #define H_SUPPRESS_SCALING_MAGIC (('s'<<24) | ('u'<<16) | ('p'<<8) | 'p')
5344
5345 enum DifferentTypes {
5346 typecharcompound='A'+1,
5347 typecharcompound2='B' << 2
5348 };
5349
53502016-10-13: wsfulton
5351 [Python] Issue #808 - fix Python pickling and metaclass for builtin wrappers.
5352
5353 The metaclass (SwigPyObjectType) for SWIG objects was not defined in
5354 a way that let importlib successfully import the Python wrappers.
5355 The pickle module previously failed to pickle objects because it couldn't
5356 determine what module the SWIG wrapped objects were in.
5357
53582016-09-29: wsfulton
5359 [Allegrocl, CFFI, GO, Javascript, Ocaml, R, Scilab]
5360 Add missing support for the "ret" typemap in a few target languages.
5361 The documentation also now has info on the "ret" typemap.
5362
53632016-09-27: ahmed-usman
5364 [xml] Handle template parameters correctly.
5365
53662016-09-27: dontpanic92
5367 [Go] Fix argument names in inherited functions taking more than 8
5368 parameters. Fixes #795.
5369
53702016-09-26: smarchetto
5371 [Scilab] mlists that map pointers can be given a custom type name.
5372
53732016-09-25: wsfulton
5374 Patch #793 from q-p to expand exception handling to include std::bad_cast
5375 in std_except.i.
5376
53772016-09-24: olly
5378 [PHP] Fix code generated for feature("director:except") -
5379 previously the return value of call_user_function() was ignored and
5380 we checked an uninitialised value instead. Fixes #627. Based on
5381 patch from Sergey Seroshtan.
5382
53832016-09-22: wsfulton
5384 [Python] More flexible python builtin slots for overloaded C++ function.
5385
5386 The closure names used for builtin slots are mangled with their functype so
5387 that overloaded C++ method names can be used for multiple slots.
5388 For example:
5389
5390 %feature("python:slot", "mp_subscript", functype="binaryfunc") SimpleArray::__getitem__;
5391 %feature("python:slot", "sq_item", functype="ssizeargfunc") SimpleArray::__getitem__(Py_ssize_t n);
5392
5393 will generate closures:
5394
5395 SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___ssizeargfunc_closure */
5396 SWIGPY_BINARYFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___binaryfunc_closure */
5397
5398 Previously only one name was defined: _wrap_SimpleArray___getitem___closure.
5399 Hence the overloaded __getitem__ method can be used to support both mp_subscript and sq_item slots.
5400
54012016-09-17: wsfulton
5402 [Python] Fix iterators for containers of NULL pointers (or Python None) when using
5403 -builtin. Previously iteration would stop at the first element that was NULL.
5404
54052016-09-16: olly
5406 [Javascript] Fix SWIG_exception() macro to return from the current
5407 function. Fixes #789, reported by Julien Dutriaux.
5408
54092016-09-16: olly
5410 [PHP] Fix SWIG_exception() macro to return from the current function.
5411 Fixes #240, reported by Sergey Seroshtan.
5412
54132016-09-12: xypron
5414 [C#] Patch #786 Keyword rename to be CLS compliant by adding an underscore
5415 suffix instead of an underscore prefix to the C symbol name. Please use an explicit
5416 %rename to rename the symbol with a _ prefix if you want the old symbol name.
5417
5418 *** POTENTIAL INCOMPATIBILITY ***
5419
54202016-09-09: olly
5421 [Python] Fix import handling for Python 2.6 to work in a frozen
5422 application. Fixes #145, reported by Thomas Kluyver.
5423
54242016-09-02: smarchetto
5425 [Scilab] Pointers are mapped to mlist instead of tlist
5426 (mlist better for scilab overloading)
5427
54282016-09-02: olly
5429 [PHP] Fix "out" typemap for member function pointers and "in"
5430 typemap for char INPUT[ANY].
5431
54322016-09-01: wsfulton
5433 [Python] More efficient Python slicing.
5434 Call reserve for container types that support it to avoid repeated
5435 memory reallocations for new slices or slices that grow in size.
5436
54372016-09-01: wsfulton
5438 [Python] #771 - Make builtin types hashable by default.
5439 Default hash is the underlying C/C++ pointer. This matches up with testing for
5440 equivalence (Py_EQ in SwigPyObject_richcompare) which compares the pointers.
5441
54422016-08-22: wsfulton
5443 [Python] The following builtin slots can be customized like other slots via the
5444 "python:<x>" and "python:slot" features where <x> is the appropriate slot name:
5445 tp_allocs
5446 tp_bases
5447 tp_basicsize
5448 tp_cache
5449 tp_del
5450 tp_dealloc
5451 tp_flags
5452 tp_frees
5453 tp_getset
5454 tp_is_gc
5455 tp_maxalloc
5456 tp_methods
5457 tp_mro
5458 tp_new
5459 tp_next
5460 tp_prev
5461 tp_richcompare
5462 tp_subclasses
5463 tp_weaklist
5464 was_sq_ass_slice
5465 was_sq_slice
5466
5467 A few documentation improvements for slot customization.
5468
54692016-08-09: joequant
5470 [R] Patch #765 Fix extern "C" header includes for C++ code.
5471
54722016-08-05: olly
5473 [xml] Fix how the output filename is built to avoid problems when
5474 it contains the embedded strings ".c", ".cpp" or ".cxx".
5475 Fixes #540 reported by djack42.
5476
54772016-07-01: wsfulton
5478 Fix corner case of wrapping std::vector of T pointers where a pointer to a pointer of T
5479 also exists in the wrapped code. SF Bug 2359417 (967).
5480
54812016-06-26: wkalinin
5482 [Java, C#] Patch #681 Fix seg fault when ignoring nested classes.
5483
54842016-06-25: mromberg
5485 [Python] #711 Fix -castmode and conversion of signed and unsigned integer types.
5486 See 2015-12-23 CHANGES entry for details of these improvements when they were
5487 implemented for the default options (ie not using -castmode).
5488
54892016-06-25: ahnolds
5490 Patch #730 - Fix %implicitconv for overloaded functions when using
5491 -castmode or -fastdispatch options.
5492
5493 The result is that in all overload cases where there are multiple possibilities
5494 with the same number of arguments, the dispatch function will first check for
5495 exact (aka non implicit) matches, and then subsequently check for implicit
5496 casting matches. This was already happening in the normal dispatch situation,
5497 and in the -fastdispatch case two passes through the candidates were happening,
5498 just with SWIG_POINTER_IMPLICIT_CONV always set. After this patch, it is not set
5499 on the first pass, and then set on the second pass.
5500
55012016-06-25: liorgold
5502 Patch #727 - Add support for C++11 type aliasing.
5503
William S Fulton84b06fa2016-06-12 10:14:11 +01005504Version 3.0.10 (12 Jun 2016)
5505============================
5506
55072016-06-06: mromberg
5508 [Python] Patch #698. Add support for -relativeimport for python 2.7, so -py3 is no
5509 longer also required for relative import support.
5510
55112016-06-05: mromberg
5512 [Python] Patch #694 - Fix package import regressions introduced in swig-3.0.9.
5513
5514 1) The code in 3.0.9 did not fall back to 'import _foo' if 'import bar._foo' failed
5515 (assuming bar.foo was the main module). Every place _foo is imported now first tries
5516 it from the package where foo was found and if that fails tries _foo as a global module.
5517
5518 2) The separate block of Python code that injected code to pull in the attributes
5519 from _foo when -builtin is used made use of the -py3 switch to either do
5520 'from ._foo import *' or "from _foo import *". This block of code no longer does this
5521 and instead checks the Python version at runtime to switch between the two syntaxes.
5522
5523 In summary, swig-3.0.10 has been modified to ease the creation of wrapper modules
5524 that can be fully made part of a Python package. SWIG no longer
5525 assumes the dynamically linked C module is a global module.
5526 The dynamic module can now be placed into either the same package as the pure Python
5527 module or as a global module. Both locations are used by the Python wrapper to
5528 locate the C module.
5529
5530 However, this could cause a backwards incompatibility with some code
5531 that was relying on the ability of "from package import _module" to
5532 pull attributes out of the package directly. If your code populates a
5533 module (which is also a package) with attributes that are SWIG
5534 generated modules which were not loaded in a conventional way,
5535 swig-3.0.8 and earlier may have worked due to 'from package import
5536 _module' bypassing a real import and pulling your module in as an
5537 attribute. This will no longer work. Since this is not a common (or
5538 even recommended) practice, most folk should not be affected.
5539
5540 *** POTENTIAL INCOMPATIBILITY ***
5541
55422016-05-31: wsfulton
5543 Fix #690 - Smart pointer to %ignored class doesn't expose inherited methods.
5544 Regression introduced in swig-3.0.9.
5545
William S Fulton8aea57c2016-05-29 15:46:46 +01005546Version 3.0.9 (29 May 2016)
5547===========================
5548
55492016-05-24: mromberg
5550 [Python] Patch #612 - Add support for Python's implicit namespace packages.
5551
55522016-05-23: wsfulton
5553 [Ruby] Fix #602 - Error handling regression of opaque pointers introduced
5554 in swig-3.0.8 when C functions explicitly reset a pointer using 'DATA_PTR(self) = 0'.
5555 An ObjectPreviouslyDeleted error was incorrectly thrown when the pointer was used
5556 as a parameter.
5557
55582016-05-17: tamuratak
5559 [Ruby] Patch #651 - Correct overloaded function error message when function is
5560 using %newobject.
5561
55622016-05-17: aurelj
5563 [Ruby] Patch #582 - add support for docstring option in %module()
5564
55652016-05-14: wsfulton
5566 Fix #434 - Passing classes by value as parameters in director methods did not create
5567 a copy of the argument leading to invalid memory accesses if the object was used
5568 after the upcall into the target language. Passing arguments by value shouldn't give
5569 rise to these sorts of memory problems and so the objects are now copied and ownership
5570 of their lifetime is controlled by the target language.
5571
55722016-05-07: wsfulton
5573 Fix #611. Fix assertion handling defaultargs when using %extend for a template
5574 class and the extended methods contain default arguments.
5575
55762016-05-05: ejulian
5577 [Python] Patch #617. Fix operator/ wrappers.
5578
55792016-05-02: wsfulton
5580 Fix #669. Don't issue warning about ignoring base classes when the derived class is
5581 itself ignored.
5582
55832016-04-18: ianlancetaylor
5584 [Go] Fix use of goout typemap when calling base method by
5585 forcing the "type" attribute to the value we need.
5586
55872016-04-17: ianlancetaylor
5588 [Go] Fixes for Go 1.6: avoid returning Go pointers from
5589 directors that return string values; add a trailing 0 byte
5590 when treating Go string as C char*.
5591
55922016-04-06: smarchetto
5593 [Scilab] #552 Make Scilab runtime keep track of pointer types
5594 Instead of a Scilab pointer which has no type, SWIG Scilab maps a
5595 pointer to a structure tlist containing the pointer adress and its type.
5596
55972016-04-02: ahnolds
5598 [Python] Apply #598. Fix misleading error message when attempting to read a non-existent
5599 attribute. The previous cryptic error message:
5600 AttributeError: type object 'object' has no attribute '__getattr__'
5601 is now replaced with one mentioning the attribute name, eg:
5602 AttributeError: 'Foo' object has no attribute 'bar'
5603
56042016-04-02: derkuci
5605 [Python] Patch #610 to fix #607.
5606 Fix single arguments when using python -builtin -O with %feature("compactdefaultargs")
5607
56082016-03-31: wsfulton
5609 Fixes #594. Fix assertion for some languages when wrapping a C++11 enum class that
5610 is private in a class.
5611
5612 Also don't wrap private enums for a few languages that attempted to do so.
5613
56142016-03-31: wsfulton
5615 [Java] unsigned long long marshalling improvements when a negative number
5616 is passed from Java to C. A cast to signed long long in the C layer will now
5617 result in the expected value. No change for positive numbers passed to C.
5618 Fixes #623.
5619
56202016-03-22: alexwarg
5621 [Lua] #398 Fix lua __getitem + inheritance
5622 The new handling of classes in Lua (not merging methods into the derived classes)
5623 breaks for classes that provide a __getitem function. The __getitem function
5624 prevents method calls to any method defined in a base class. This fix calls
5625 __getitem only if the member is not found using recursive lookup.
5626
56272016-03-18: ptomulik
5628 [Python] #563 Stop generating unnecessary _swigconstant helpers.
5629
56302016-03-16: richardbeare
5631 [R] #636 Add extra std::vector numeric types
5632
56332016-03-14: wsfulton
5634 [Java] Add std_array.i for C++11 std::array support.
5635
56362016-03-12: wsfulton
5637 [Java, C#, D] Fix static const char member variables wrappers with %javaconst(1)
5638 %csconst(1) or %dmanifestconst.
5639 This fixes the case when an integer is used as the initializer, such as:
5640
5641 struct W { static const char w = 100; };
5642
5643 Fix generated code parsing enum values using char escape sequences
5644 when these values appear in the Java code (usually when using %javaconst(1))
5645 such as:
5646
5647 enum X { x1 = '\n', x2 = '\1' };
5648
5649 Similarly for static const member char variables such as:
5650
5651 struct Y { static const char y = '\n'; }
5652
5653 Likewise for D and %dmanifestconstant. For C# and %csconst(1), char
5654 values in C# are now hex escaped as C# doesn't support C octal escaping.
5655
56562016-03-11: wsfulton
5657 [Java C#] Add support for treating C++ base classes as Java interfaces
5658 instead of Java proxy classes. This enable some sort of support for
5659 multiple inheritance. The implementation is in swiginterface.i and
5660 provides additional macros (see Java.html for full documentation):
5661
5662 %interface(CTYPE)
5663 %interface_impl(CTYPE)
5664 %interface_custom("PROXY", "INTERFACE", CTYPE)
5665
56662016-03-01: wsfulton
5667 Add rstrip encoder for use in %rename. This is like the strip encoder but
5668 strips the symbol's suffix instead of the prefix. The example below
5669 will rename SomeThingCls to SomeThing and AnotherThingCls to AnotherThing:
5670
5671 %rename("%(rstrip:[Cls])s") "";
5672
5673 class SomeThingCls {};
5674 struct AnotherThingCls {};
5675
56762016-03-01: olly
5677 Fix isfinite() check to work with GCC6. Fixes
William S Fulton5919e9c2016-12-27 19:45:02 +00005678 issue #615 reported by jplesnik.
William S Fulton8aea57c2016-05-29 15:46:46 +01005679
56802016-02-17: olly
5681 [Python] Add missing keywords 'as' and 'with' to pythonkw.swg.
5682
56832016-02-07: kwwette
5684 [Octave] recognise various unary functions
5685 * Use __float__() for numeric conversions, e.g. when calling double()
5686 * Map various unary functions, e.g. abs() to __abs__(), see full list
5687 in section 32.3.10 of manual; only available in Octave 3.8.0 or later
5688
56892016-02-07: kwwette
5690 [Octave] export function swig_octave_prereq() for testing Octave version
5691
56922016-02-06: pjohangustavsson
5693 [C#] Fix duplicate symbol problems when linking the source generated
5694 from multiple SWIG modules into one shared library for the -namespace
5695 option. The namespace is now mangled into the global PInvoke function
5696 names.
5697
5698 *** POTENTIAL INCOMPATIBILITY ***
5699
57002016-01-27: ahnolds
5701 [Python] Added support for differentiating between Python Bytes
5702 and Unicode objects using by defining SWIG_PYTHON_STRICT_BYTE_CHAR
5703 and SWIG_PYTHON_STRICT_UNICODE_WCHAR.
5704
57052016-01-27: steeve
5706 [Go] Ensure structs are properly packed between gc and GCC/clang.
5707
57082016-01-25: ahnolds
5709 [Python] Support the full Python test suite in -classic mode
5710 * Convert long/unsigned long/long long/unsigned long long to PyInt
5711 rather than PyLong when possible. Certain python functions like
5712 len() require a PyInt when operating on old-style classes.
5713 * Add support for static methods in classic mode, including support
5714 for pythonappend, pythonprepend, and docstrings.
5715 * Removing the use of __swig_getmethods__ for static member methods
5716 since they will always be found by the standard argument lookup
5717 * Fix a bug where the wrong type of exception was caught when
5718 checking for new-style class support
5719
57202016-01-23: ahnolds
5721 [Go] Enable support for the Go test-suite on OSX:
5722 * The linker on OSX requires that all symbols (even weak symbols)
5723 are defined at link time. Because the function _cgo_topofstack is
5724 only defined starting in Go version 1.4, we explicitly mark it as
5725 undefined for older versions of Go on OSX.
5726 * Avoid writing empty swigargs structs, since empty structs are not
5727 allowed in extern "C" blocks.
5728
57292016-01-12: olly
5730 [Javascript] Look for "nodejs" as well as "node", as it's packaged
5731 as the former on Debian.
5732
57332016-01-12: olly
5734 [Javascript] For v8 >= 4.3.0, use V8_MAJOR_VERSION.
William S Fulton5919e9c2016-12-27 19:45:02 +00005735 Fixes issue 561.
William S Fulton8aea57c2016-05-29 15:46:46 +01005736
57372016-01-10: ahnolds
5738 Improved size_t and ptrdiff_t typemaps to support large values
5739 on platforms where sizeof(size_t) > sizeof(unsigned long) and
5740 sizeof(ptrdiff_t) > sizeof(long).
5741
William S Fultona8cf1ed2015-12-31 18:04:16 +00005742Version 3.0.8 (31 Dec 2015)
5743===========================
5744
57452015-12-30: wsfulton
5746 The pdf documentation is now generated by wkhtmltopdf and has colour
5747 for the code snippets just like the html documentation!
5748
57492015-12-23: ahnolds
5750 [Python] Fixes for conversion of signed and unsigned integer types:
5751
5752 No longer check for PyInt objects in Python3. Because PyInt_Check
5753 and friends are #defined to the corresponding PyLong methods, this
5754 had caused errors in Python3 where values greater than what could be
5755 stored in a long were incorrectly interpreted as the value -1 with
5756 the Python error indicator set to OverflowError. This applies to
5757 both the conversions PyLong->long and PyLong->double.
5758
5759 Conversion from PyLong to long, unsigned long, long long, and
5760 unsigned long long now raise OverflowError instead of TypeError in
5761 both Python2 and Python3 for PyLong values outside the range
5762 expressible by the corresponding C type. This matches the existing
5763 behavior for other integral types (signed and unsigned ints, shorts,
5764 and chars), as well as the conversion for PyInt to all numeric
5765 types. This also indirectly applies to the size_t and ptrdiff_t
5766 types, which depend on the conversions for unsigned long and long.
5767
57682015-12-19: wsfulton
5769 [Python] Python 2 Unicode UTF-8 strings can be used as inputs to char * or
5770 std::string types if the generated C/C++ code has SWIG_PYTHON_2_UNICODE defined.
5771
57722015-12-17: wsfulton
5773 Issues #286, #128
5774 Remove ccache-swig.1 man page - please use the CCache.html docs instead.
5775 The yodl2man and yodl2html tools are no longer used and so SWIG no
5776 longer has a dependency on these packages which were required when
5777 building from git.
5778
57792015-12-16: zturner/coleb
5780 [Python] Fix Python3.5 interpreter assertions when objects are being
5781 deleted due to an existing exception. Most notably in generators
5782 which terminate using a StopIteration exception. Fixes #559 #560 #573.
5783 If a further exception is raised during an object destruction,
5784 PyErr_WriteUnraisable is used on this second exception and the
5785 original exception bubbles through.
5786
57872015-12-14: ahnolds/wsfulton
5788 [Python] Add in missing initializers for tp_finalize,
5789 nb_matrix_multiply, nb_inplace_matrix_multiply, ht_qualname
5790 ht_cached_keys and tp_prev.
5791
57922015-12-12: wsfulton
5793 Fix STL wrappers to not generate <: digraphs.
5794 For example std::vector<::X::Y> was sometimes generated, now
5795 corrected to std::vector< ::X::Y >.
5796
57972015-11-25: wsfulton
5798 [Ruby] STL ranges and slices fixes.
5799
5800 Ruby STL container setting slices fixes:
5801
5802 Setting an STL container wrapper slice better matches the way Ruby
5803 arrays work. The behaviour is now the same as Ruby arrays. The only
5804 exception is the default value used when expanding a container
5805 cannot be nil as this is not a valid type/value for C++ container
5806 elements.
5807
5808 Obtaining a Ruby STL container ranges and slices fixes:
5809
5810 Access via ranges and slices now behave identically to Ruby arrays.
5811 The fixes are mostly for out of range indices and lengths.
5812 - Zero length slice requests return an empty container instead of nil.
5813 - Slices which request a length greater than the size of the container
5814 no longer chop off the last element.
5815 - Ranges which used to return nil now return an empty array when the
5816 the start element is a valid index.
5817
5818 Ruby STL container negative indexing support improved.
5819
5820 Using negative indexes to set values works the same as Ruby arrays, eg
5821
5822 %template(IntVector) std::vector<int>;
5823
5824 iv = IntVector.new([1,2,3,4])
5825 iv[-4] = 9 # => [1,2,3,9]
5826 iv[-5] = 9 # => IndexError
5827
58282015-11-21: wsfulton
5829 [Ruby, Python] Add std::array container wrappers.
5830
5831 These work much like any of the other STL containers except Python/Ruby slicing
5832 is somewhat limited because the array is a fixed size. Only slices of
5833 the full size are supported.
5834
58352015-10-10: wsfulton
5836 [Python] #539 - Support Python 3.5 and -builtin. PyAsyncMethods is a new
5837 member in PyHeapTypeObject.
5838
58392015-10-06: ianlancetaylor
5840 [Go] Don't emit a constructor function for a director
5841 class with an abstract method, since the function will
5842 always panic.
5843
58442015-10-01: wsfulton
5845 Fix %shared_ptr support for private and protected inheritance.
5846 - Remove unnecessary Warning 520: Derived class 'Derived' of 'Base'
5847 is not similarly marked as a smart pointer
5848 - Do not generate code that attempts to cast up the inheritance chain in the
5849 type system runtime in such cases as it doesn't compile and can't be used.
5850 Remove unnecessary warning 520 for %shared_ptr when the base class is ignored.
5851
58522015-10-01: vkalinin
5853 Fix #508: Fix segfault parsing anonymous typedef nested classes.
5854
58552015-09-26: wsfulton
5856 [Ruby] Add shared_ptr support
5857
58582015-09-13: kkaempf
5859 [Ruby] Resolve tracking bug - issue #225.
5860 The bug is that the tracking code uses a ruby hash and thus may
5861 allocate objects (Bignum) while running the GC. This was tolerated in
5862 1.8 but is invalid (raises an exception) in 1.9.
5863 The patch uses a C hash (also used by ruby) instead.
5864
58652015-09-09: lyze
5866 [CFFI] Extend the "export" feature in the CFFI module to support
5867 exporting to a specified package.
5868
58692015-09-04: olly
5870 [Python] Fix docstrings for %callback functions.
5871
58722015-09-03: demi-rluddy
5873 [Go] Removed golang stringing for signed/unsigned char
5874
5875 Changed default handling of signed char* and unsigned char* to be
5876 opaque pointers rather than strings, similarly to how other
5877 languages work.
5878
5879 Any existing code relying on treating signed char* or unsigned
5880 char* as a string can restore the old behavior with typemaps.i by
5881 using %apply to copy the [unchanged] char* behavior.
5882
5883 *** POTENTIAL INCOMPATIBILITY ***
5884
58852015-08-07: talby
5886 [Perl] tidy -Wtautological-constant-out-of-range-compare warnings when building generated code under clang
5887
58882015-08-07: xantares
5889 [Python] pep257 & numpydoc conforming docstrings:
5890 - Mono-line module docsstring
5891 - Rewrite autodoc parameters section in numpydoc style:
5892 https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
5893 - One line summary should end with "."
5894 - Adds a blank line after class docstring
5895
58962015-08-05: vadz
5897 [Java] Make (char* STRING, size_t LENGTH) typemaps usable for
5898 strings of other types, e.g. "unsigned char*".
5899
William S Fulton5d363272015-08-03 22:33:52 +01005900Version 3.0.7 (3 Aug 2015)
5901==========================
5902
59032015-08-02: wsfulton
5904 [Java] Fix potential security exploit in generated Java classes.
5905 The swigCPtr and swigCMemOwn member variables in the generated Java
5906 classes are now declared 'transient' by default. Further details of the exploit
5907 in Android is being published in an academic paper as part of USENIX WOOT '15:
5908 https://www.usenix.org/conference/woot15/workshop-program/presentation/peles.
5909
5910 In the unlikely event that you are relying on these members being serializable,
5911 then you will need to override the default javabody and javabody_derived typemaps
5912 to generate the old generated code. The relevant typemaps are in the Lib directory
5913 in the java.swg, boost_shared_ptr.i and boost_intrusive_ptr.i files. Copy the
5914 relevant default typemaps into your interface file and remove the 'transient' keyword.
5915
5916 *** POTENTIAL INCOMPATIBILITY ***
5917
59182015-08-01: vadz
5919 Make configure --without-alllang option more useful: it can now be overridden by the following
5920 --with-xxx options, allowing to easily enable just one or two languages.
5921
59222015-07-30: wsfulton
5923 Fix #440 - Initialise all newly created arrays when using %array_functions and %array_class
5924 in the carrays.i library - bug is only relevant when using C++.
5925
59262015-07-29: wsfulton
5927 [Python] Improve indentation warning and error messages for code in the following directives:
5928
5929 %pythonprepend
5930 %pythonappend
5931 %pythoncode
5932 %pythonbegin
5933 %feature("shadow")
5934
5935 Old error example:
5936 Error: Line indented less than expected (line 3 of pythoncode)
5937
5938 New error example:
5939 Error: Line indented less than expected (line 3 of %pythoncode or %insert("python") block)
5940 as no line should be indented less than the indentation in line 1
5941
5942 Old warning example:
5943 Warning 740: Whitespace prefix doesn't match (line 2 of %pythoncode or %insert("python") block)
5944
5945 New warning example:
5946 Warning 740: Whitespace indentation is inconsistent compared to earlier lines (line 3 of
5947 %pythoncode or %insert("python") block)
5948
5949
59502015-07-28: wsfulton
5951 [Python] Fix #475. Improve docstring indentation handling.
5952
5953 SWIG-3.0.5 and earlier sometimes truncated text provided in the docstring feature.
5954 This occurred when the indentation (whitespace) in the docstring was less in the
5955 second or later lines when compared to the first line.
5956 SWIG-3.0.6 gave a 'Line indented less than expected' error instead of truncating
5957 the docstring text.
5958 Now the indentation for the 'docstring' feature is smarter and is appropriately
5959 adjusted so that no truncation occurs.
5960
59612015-07-22: wsfulton
5962 Support for special variable expansion in typemap attributes. Example usage expansion
5963 in the 'out' attribute (C# specific):
5964
5965 %typemap(ctype, out="$*1_ltype") unsigned int& "$*1_ltype"
5966
5967 is equivalent to the following as $*1_ltype expands to 'unsigned int':
5968
5969 %typemap(ctype, out="unsigned int") unsigned int& "unsigned int"
5970
5971 Special variables can be used within special variable macros too. Example usage expansion:
5972
5973 %typemap(cstype) unsigned int "uint"
5974 %typemap(cstype, out="$typemap(cstype, $*1_ltype)") unsigned int& "$typemap(cstype, $*1_ltype)"
5975
5976 Special variables are expanded first and hence the above is equivalent to:
5977
5978 %typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"
5979
5980 which then expands to:
5981
5982 %typemap(cstype, out="uint") unsigned int& "uint"
5983
59842015-07-22: lindleyf
5985 Apply patch #439 - support for $typemap() (aka embedded typemaps or special variable
5986 macros) in typemap attributes. A simple example where $typemap() is expanded in the
5987 'out' attribute (C# specific):
5988
5989 %typemap(cstype) unsigned int "uint"
5990 %typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"
5991
5992 is equivalent to:
5993
5994 %typemap(cstype, out="uint") unsigned int& "uint"
5995
59962015-07-18: m7thon
5997 [Python] Docstrings provided via %feature("docstring") are now quoted and added to
5998 the tp_doc slot when using python builtin classes (-builtin). When no docstring is
5999 provided, the tp_doc slot is set to the fully qualified C/C++ class name.
6000 Github issues #445 and #461.
6001
60022015-07-17: kwwette
6003 [octave] Support Octave version 4.0.0 (thanks to patches from Orion Poplawski).
6004
60052015-07-07: wsfulton
6006 SWIG no longer generates a wrapper for a class' constructor if that class has
6007 any base class with a private destructor. This is because your compiler should
6008 not allow a class to be instantiated if a base has a private destructor. Some
6009 compilers do, so if you need the old behaviour, use the "notabstract" feature, eg:
6010
6011 %feature("notabstract") Derived;
6012 class Base {
6013 ~Base() {}
6014 };
6015 struct Derived : Base {};
6016
William S Fulton55686fb2015-07-06 06:55:43 +01006017Version 3.0.6 (5 Jul 2015)
6018==========================
6019
60202015-07-02: wsfulton
6021 Fix syntax error when the template keyword is used in types, eg:
6022
6023 std::template vector<int> v;
6024
60252015-07-02: ngladitz
6026 [Lua] Push characters as unformatted 1-character strings to avoid
6027 unprintable characters such as (char)127 being converted to
6028 "<\127>" with Lua 5.3 and later. (github PR #452)
6029
60302015-06-29: olly
6031 [Python] Improve handling of whitespace in %pythoncode.
6032
6033 Previously SWIG looked at the indentation of the first line and
6034 removed that many characters from each subsequent line, regardless
6035 of what those characters were. This was made worse because SWIG's
6036 preprocessor removes any whitespace before a '#'. Fixes github
6037 issue #379, reported by Joe Orton.
6038
60392015-06-12: wsfulton
6040 [R] Fix #430 - call to SWIG_createNewRef in copyToC was incorrectly named.
6041
60422015-06-11: sghirate
6043 [C#] Patch #427 adds in new command line option -outfile to combine all the
6044 generated C# code into a single file.
6045
60462015-06-09: wsfulton
6047 Fix seg fault processing C++11 type aliasing. Issue #424.
6048
60492015-05-28: wsfulton
6050 [Python] Add new feature "python:cdefaultargs" to control default argument
6051 code generation. By default, SWIG attempts to convert C/C++ default argument values
6052 into Python values and generates code into the Python layer with these values.
6053 Recent versions of SWIG are able to convert more of these values, however, the
6054 new behaviour can be circumvented if desired via this new feature, such that
6055 the default argument values are obtained from the C layer and not the Python layer.
6056 For example:
6057
6058 struct CDA {
6059 int fff(int a = 1, bool b = false);
6060 };
6061
6062 The default code generation in the Python layer is:
6063
6064 class CDA(_object):
6065 ...
6066 def fff(self, a=1, b=False):
6067 return _default_args.CDA_fff(self, a, b)
6068
6069 Adding the feature:
6070
6071 %feature("python:cdefaultargs") CDA::fff;
6072
6073 Results in:
6074
6075 class CDA(_object):
6076 ...
6077 def fff(self, *args):
6078 return _default_args.CDA_fff(self, *args)
6079
6080 Some code generation modes, eg -builtin and -fastproxy, are unaffected by this as
6081 the default values are always obtained from the C layer.
6082
60832015-05-27: wsfulton
6084 [Python] Deal with an integer as the default value of a typedef to bool
6085 parameter in the C++ prototype. See #327. Regression from 3.0.0 onwards.
6086
60872015-05-19: olly
6088 [Python] Fix warning when compiling generated code with MSVC.
6089 (Fixes https://sourceforge.net/p/swig/patches/351/ reported by
6090 Mateusz Szyma¿ski).
6091
60922015-05-14: wsfulton
6093 Fix seg fault wrapping shared_ptr of classes with private constructors and destructors.
6094 This also fixes the "unref" feature when used on classes with private destructors.
6095
60962015-05-10: wsfulton
6097 [Java] Fix multi-argument typemaps (char *STRING, size_t LENGTH)
6098 so that they can be applied to a wider range of types. Fixes #385.
6099
61002015-05-07: olly
6101 [Python] Deal with an integer as the default value of a bool
6102 parameter in the C++ prototype. Fixes github #327, reported by
6103 Greg Allen.
6104
61052015-05-07: LindleyF
6106 [Java] Allow feature("director") and feature("ref") to be used
6107 together. Github PR#403.
6108
61092015-05-05: olly
6110 Suppress warning 325 "Nested class not currently supported (Foo
6111 ignored)" when Foo has already been explicitly ignored with "%ignore".
6112
61132015-05-04: wsfulton
6114 Add support for friend templates, including operator overloading - fixes #196. Considering
6115 the example below, previously the operator gave a syntax error and friendfunc incorrectly
6116 warned with:
6117
6118 "Warning 503: Can't wrap 'friendfunc<(Type)>' unless renamed to a valid identifier."
6119
6120 template <class Type> class MyClass {
6121 friend int friendfunc <Type>(double is, MyClass <Type> & x);
6122 friend int operator<< <Type>(double un, const MyClass <Type> &x);
6123 };
6124
6125 The following also previously incorrectly warned with:
6126
6127 "Warning 302: Identifier 'template_friend' redefined (ignored),"
6128
6129 template<typename T> T template_friend(T);
6130 struct MyTemplate {
6131 template<typename T> friend T template_friend(T);
6132 };
6133
61342015-05-01: wsfulton
6135 Fix handling of conversion operators where the operator is split over multiple
6136 lines or has comments within the operator type. Fixes #401.
6137
6138 Also fix similar problem with normal operators which gave a syntax error if split over
6139 multiple lines or had a comment within the operator declaration.
6140
61412015-04-30: olly
6142 Ignore unknown preprocessor directives which are inside an inactive
6143 conditional (github issue #394, reported by Dan Wilcox).
6144 Regression introduced in 3.0.3.
6145
61462015-04-27: vadz
6147 [Python] Fix "default" typemap used after an argument with "numinputs=0" (#377).
6148
61492015-04-24: wsfulton
6150 [Python] Fix #256. Code generated with '-builtin -modernargs' segfaults for any
6151 method taking zero arguments.
6152
6153 Also fixes: "SystemError: error return without exception set" during error checking
6154 when using just -builtin and the incorrect number of arguments is passed to a class
6155 method expecting zero arguments.
6156
61572015-04-23: wsfulton
6158 [Java] Bug #386 - Memory leak fix in (char *STRING, size_t LENGTH) typemaps.
6159
61602015-04-23: vadz
6161 [Python] Make "default" typemap work again (#330, #377).
6162
61632015-04-23: vadz
6164 [Python] Fix the use of default values for the pointer types (#365, #376).
6165
61662015-04-23: wsfulton
6167 Fix 'make check-ccache' which is part of 'make check' when one of the CCACHE_
6168 environment variables, for example CCACHE_DISABLE, is set.
6169
61702015-04-14: wsfulton
6171 Clearer warning message for badly constructed typecheck typemaps. For example, was:
6172
6173 example.i:3: Warning 467: Overloaded foo(int) not supported (no type checking
6174 rule for 'int').
6175
6176 Now:
6177
6178 example.i:3: Warning 467: Overloaded foo(int) not supported (incomplete type checking
6179 rule - no precedence level in typecheck typemap for 'int').
6180
61812015-04-11: wsfulton
6182 [Java] Fix #353 - Linker multiple definition of 'ExceptionMatches' when
6183 using directors and multiple modules.
6184
61852015-04-11: wsfulton
6186 Merge #320 - Make __dict__ accessible for Python builtin classes.
6187
61882015-04-07: wsfulton
6189 Fix #375 - parsing of extern "C" and typedef for example:
6190 extern "C" typedef void (*Hook2_t)(int, const char *);
6191 extern "C" typedef int Integer;
6192
61932015-03-12: olly
6194 -DSWIG_DIRECTOR_STATIC is now supported for all languages with
6195 director support, not only Python and PHP.
6196
61972015-03-02: ianlancetaylor
6198 [Go] Add -cgo option, required for Go versions 1.5 and
6199 later.
6200
62012015-02-26: olly
6202 Fix segmentation fault when top==NULL, introduced by nested class
6203 handling (reported in issue#346 by Pawe¿ Tomulik).
6204
62052015-02-09: wsfulton
6206 [Guile] Fix generated code for static const char member variables when
6207 defined and declared inline.
6208
62092015-02-09: mishas
6210 [Go] Fix %import of files in sub directories.
6211
62122015-02-05: ianlancetaylor
6213 [Go] Ignore Go specific type maps (goin, goout, etc.) if they are empty.
6214
62152015-02-05: ianlancetaylor
6216 [Go] Generated Go code no longer calls _swig_goallocate or
6217 _swig_makegostring, as they will no longer work as of Go 1.5.
6218
William S Fultond8342022015-02-01 00:54:57 +00006219Version 3.0.5 (31 Jan 2015)
6220===========================
6221
62222015-01-30: wsfulton
6223 [Python] Fix Python -classic and property setting. Setting properties on classic classes
6224 was broken in swig-3.0.3 by attempting to use __setattr__. This regression is fixed now
6225 by using __dict__ again when using -classic.
6226 Fixes patch #232.
6227
62282015-01-27: smarchetto
6229 [Scilab] Support for the Scilab language has been added
6230
62312015-01-23: olly
6232 [PHP] When wrapping a returned resource as an object, check if all
6233 cases wrap it in the same class, and if so eliminate the pointless
6234 switch statement wrapper we previously generated.
6235
62362015-01-22: wsfulton
6237 [Octave] Merge patch #297 for SF bug #1277 - Octave shared_ptr support
6238
62392015-01-15: wsfulton
6240 [Python] Merge patch #250 - Fixes for using %constant and objects (non-primitive types)
6241
62422015-01-15: wsfulton
6243 [C# Go] Merge patch #308 and fix #307 - C++11 strongly typed enum support
6244 in directors
6245
62462015-01-15: wsfulton
6247 [Python] Second fix for #294 #296 - Regression introduced in SWIG-3.0.3 when
6248 wrapping functions with default arguments, this time when using kwargs.
6249
William S Fultonbedff702015-01-14 23:58:49 +00006250Version 3.0.4 (14 Jan 2015)
6251===========================
6252
62532015-01-12: olly
6254 [PHP] Fix segfault in director upcall check when using PHP built with
6255 ZTS enabled. Fixes #155, reported by Pierre Labastie.
6256
62572015-01-12: vadz
6258 [Python] Fix #294 #296 - Regression introduced in SWIG-3.0.3 when
6259 wrapping functions with default arguments. Invalid or missing default
6260 arguments were sometimes being generated into the python layer.
6261
62622015-01-08: olly
6263 Allow C++11 "explicit constexpr". Fixes github issue #284 reported
6264 by Pawel Tomulik. Also handle "constexpr explicit" and "constexpr
6265 static".
6266
62672015-01-08: olly
6268 When reporting an error for a construct which hasn't been
6269 terminated when the end of the file is reached, report it at the
6270 start line rather than "EOF" as then tools like editors and IDEs
6271 will take you to a generally more useful place for fixing the
6272 problem.
6273
62742015-01-08: olly
6275 Improve error messages for a few cases which previously gave the
6276 one of the cryptic catch-all errors "Syntax error in input".
6277
62782015-01-08: olly
6279 Provide -cppext as a general command line option for setting the
6280 extension used for generated C++ files (previously it was specific
6281 to the PHP backend). Deprecate the equivalent -suffix option
6282 provided by the Ocaml backend, but continue to support that for
6283 now.
6284
William S Fulton73222a12014-12-31 01:22:16 +00006285Version 3.0.3 (30 Dec 2014)
6286===========================
6287
62882014-12-27: wsfulton
6289 Fix #280 - abort using all default template parameters within other template
6290 parameters.
6291
62922014-12-27: talby
6293 [Perl] Issue #282 perl5 archlib vs archlibexp
6294 [Perl] tidy "warning: duplicate 'extern' declaration specifier" when building generated code
6295 under clang
6296
62972014-12-18: wsfulton
6298 Add support for %constant and structs/classes - issue #272
6299
63002014-12-09: wsfulton
6301 Fix #245 - regression (since swig-3.0.0) in templated constructors.
6302 Templated constructors could not be instantiated - they were incorrectly ignored with a warning 504:
6303 "Function: xyz must have a return type. Ignored."
6304
63052014-12-07: wsfulton
6306 Add support for C++11 strongly typed enumerations.
6307
63082014-11-21: wsfulton
6309 [Java C#] Fix multiply defined error when using %rename of enum items when using the "simple enum"
6310 wrappers.
6311
63122014-10-28: vadz
6313 [Python] Patch #201 The generated .py file no longer uses *args for all Python parameters.
6314 Instead, the parameters are named using the C++ parameter names.
6315
Vadim Zeitlin84e9cc62015-04-22 23:38:41 +02006316 "compactdefaultargs" feature can be enabled to restore the old behaviour.
6317
6318 *** POTENTIAL INCOMPATIBILITY ***
6319
William S Fulton73222a12014-12-31 01:22:16 +000063202014-10-24: timotheecour
6321 [D] Patch #204 Use core.atomic.atomicOp to mutate shared variables
6322
63232014-10-21: wsfulton
6324 Fix issue #242 - Use of the "kwargs" feature no longer automatically turns on the
6325 "compactdefaultargs" feature if the target language does not support kwargs.
William S Fultoncbec3232016-05-31 22:28:35 +01006326 This change affects all languages except Python and Ruby.
William S Fulton73222a12014-12-31 01:22:16 +00006327
6328 *** POTENTIAL INCOMPATIBILITY ***
6329
63302014-10-10: diorcety
6331 [Python] Patch #232 Fix property access using directors
6332
63332014-10-06: wsfulton
6334 [Python] Fixes when using -builtin and std::vector/std::list wrappers to allow deletion
6335 of single elements, such as 'del vec[0]'.
6336
63372014-09-30: oliverb
6338 [Javascript] Merge patch #216 by Richie765 - Added support for many versions of v8 javascript.
6339
63402014-09-30: oliverb
6341 [Javascript] Merge patch #195 by zittix - Fixed JSClassRef declaration not using the static one.
6342
63432014-09-30: ianlancetaylor
6344 [Go] In configure script, require Go 1.1 or later.
6345
63462014-09-30: wsfulton
6347 [Python] Patch #207 - Fix No module error with -relativeimport when using single
6348 header file import.
6349
63502014-09-27: wsfulton
6351 Patch #208 - Initialise newly created array when using array_functions in the
6352 carrays.i library (C++ usage).
6353
63542014-09-27: wsfulton
6355 [Ruby] Patch #187 - Fix crash on shutdown of the Ruby interpreter if more than one
6356 module was loaded at a time when data is being shared between modules.
6357
63582014-09-27: wsfulton
6359 [Java] Patch #168 - Fix leak in Java director string handling after the Java
6360 upcall when called from a native thread.
6361
63622014-09-25: ianlancetaylor
6363 [Go] Adjust generated code to work with upcoming Go 1.4
6364 release.
6365
63662014-09-23: wsfulton
6367 [Python] Add patch from Thomas Maslach to fix crash in wrappers when using -threads in
6368 the STL iterators (SwigPyIterator destructor).
6369
63702014-09-17: wsfulton
6371 [C#] Merge patch #229 from contre - Add bool array types to arrays_csharp.i
6372
63732014-09-12: olly
6374 [PHP] Add support for specifying any PHP interfaces a wrapped class
William S Fultonc10a84c2022-08-20 22:14:58 +01006375 implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator"
William S Fulton73222a12014-12-31 01:22:16 +00006376
63772014-09-11: olly
6378 [PHP] Fix throwing a PHP exception through C++ from a subclassed
6379 director method - PHP NULL gets returned by the subclassed method
6380 in this case, so the directorout typemap needs to allow that (at
6381 least if an exception is active).
6382
63832014-09-09: ianlancetaylor
6384 [Go] Add goargout typemap.
6385
63862014-09-09: olly
6387 [PHP] Fix segmentation faults with directors in PHP >= 5.4, and
6388 reenable runme tests for director_basic testcase. Fix from
6389 pavel-charvat in issue#164.
6390
63912014-09-05: ianlancetaylor
6392 [Go] Add imtype, goin, goout, godirectorin, and
6393 godirectorout typemaps, to support writing Go code to
6394 convert between types.
6395
63962014-09-02: olly
6397 [Python] Fix regression in indentation of python code produced with
6398 -modern, introduced by changes in #188. Reported by fabiencastan
6399 in #218.
6400
64012014-09-01: olly
6402 Issue an error for unknown SWIG preprocessor directives, rather
6403 than quietly ignoring them. Reported by jrhelsey in issue#217.
6404
6405 *** POTENTIAL INCOMPATIBILITY ***
6406
64072014-08-15: talby
6408 [Perl] Include guard fix for nested modules from Anthony Heading (SF Patch #350).
6409
64102014-08-04: wsfulton
6411 [C#] Merge patch #200 from gpetrou - Changed CSharp license header to include auto-generated
6412 tag so that StyleCop ignores the files.
6413
64142014-08-04: wsfulton
6415 [Java] Merge patch #198 from Yuval Kashtan - Support for java.nio.ByteBuffer mapping to
6416 unsigned char * in various.i in NIOBUFFER typemaps.
6417
64182014-07-14: ianlancetaylor
6419 [Go] Change struct definition to use void *, not uint8, so
6420 that the type is recorded as possibly containing
6421 pointers. This ensures that the 1.3 garbage collector
6422 does not collect pointers passed to C++ code.
6423
64242014-07-01: wsfulton
6425 Fix SF Bug #1375 - Expansion of the $parentclassname special variable incorrectly contains
6426 brackets in the expanded name.
6427
William S Fulton8728a972014-06-06 19:56:38 +01006428Version 3.0.2 (4 Jun 2014)
6429==========================
6430
64312014-06-02: v-for-vandal
6432 [Lua] Pull request #176:
6433 If class has no __eq implemented, then default __eq is generated.
6434 Default __eq compares actual pointers stored inside Lua userdata.
6435
64362014-06-02: vkalinin
6437 Fix #183 - %extend and unnamed nested structs
6438
64392014-05-28: kwwette
6440 Fix install failure when using an 'out of source' build using the shipped
6441 tarball - regression introduced in swig-3.0.1.
6442
64432014-05-24: kwwette
6444 [Octave] Remove deprecated -global/-noglobal command-line arguments
6445
6446 *** POTENTIAL INCOMPATIBILITY ***
6447
William S Fulton68347cb2014-05-28 18:51:46 +01006448Version 3.0.1 (27 May 2014)
6449===========================
6450
64512014-05-25: hfalcic
6452 [Python] Python 3 byte string output: use errors="surrogateescape"
6453 if available on the version of Python that's in use. This allows
6454 obtaining the original byte string (and potentially trying a fallback
6455 encoding) if the bytes can't be decoded as UTF-8.
6456
6457 Previously, a UnicodeDecodeError would be raised with no way to treat
6458 the data as bytes or try another codec.
6459
64602014-05-18: vkalinin
6461 Bug #175 - Restore %extend to work for unnamed nested structures by using a C
6462 symbol comprising the outer structure name and unnamed variable instance name.
6463
64642014-05-15: kwwette
Olly Bettse4326222015-01-07 12:40:31 +13006465 Add #166 - 'make check' now works out of source. This required the examples to build
William S Fulton68347cb2014-05-28 18:51:46 +01006466 out of source. The main languages have been tested - C#, Go, Guile, Java, Javascript,
6467 Lua, Octave, Perl, PHP, Python, Ruby and Tcl.
6468
64692014-05-01: Oliver Buchtala
6470 Javascript support added, see Javascript chapter in the documentation.
6471
64722014-05-01: olly
6473 [PHP] The generated __isset() method now returns true for read-only properties.
6474
64752014-04-24: kwwette
6476 [Go] Fix go ./configure parsing of gccgo --version, and
6477 goruntime.swg typo in __GNUC_PATCHLEVEL__ (SF Bug #1298)
6478
64792014-04-24: kwwette
6480 Fix {python|perl5|ruby|tcl}/java examples
6481
6482 In Lib/gcj/cni.i, for compatibility with newer gcj versions:
6483
6484 - remove JvAllocObject() which gcj no longer defines, from gcj Changelog:
6485 2004-04-16 Bryce McKinlay <[email protected]>
6486 * gcj/cni.h (JvAllocObject): Remove these obsolete,
6487 undocumented CNI calls.
6488
6489 - change JvCreateJavaVM() argument from void* to JvVMInitArgs*, from gcj Changelog:
6490 2005-02-23 Thomas Fitzsimmons <[email protected]>
6491 PR libgcj/16923
6492 ...
6493 (JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*.
6494
6495 *** POTENTIAL INCOMPATIBILITY ***
6496
64972014-04-08: wsfulton
6498 SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i
6499
65002014-04-08: wsfulton
6501 [Java C#] Enums which have been ignored via %ignore and are subsequently
6502 used are handled slightly differently. Type wrapper classes are now generated
6503 which are effectively a wrapper of an empty enum. Previously in Java uncompilable
6504 code was generated and in C# an int was used.
6505
65062014-04-04: wsfulton
6507 Fix regression in 3.0.0 where legal code following an operator<< definition might
6508 give a syntax error. SF Bug #1365.
6509
65102014-04-03: olly
6511 [PHP] Fix wrapping director constructors with default parameters
6512 with a ZTS-enabled build of PHP.
6513
65142014-04-02: olly
6515 [PHP] Pass the ZTS context we already have to avoid needing to
6516 call TSRMLS_FETCH, which is relatively expensive.
6517
65182014-04-02: olly
6519 [PHP] Pass ZTS context through to t_output_helper() so it works
6520 with a ZTS-enabled build of PHP. Reported by Pierre Labastie in
6521 github PR#155.
6522
65232014-03-28: wsfulton
6524 [Java C# D Go] Fixes for C enums used in an API and the definition of the enum
6525 has not been parsed. For D, this fixes a segfault in SWIG. The other languages
6526 now produce code that compiles, although the definition of the enum is needed
6527 in order to use the enum properly from the target language.
6528
65292014-03-23: v-for-vandal
6530 [Lua] Fix for usage of snprintf in Lua runtime which Visual Studio does not have.
6531
William S Fultonb0afd852014-03-17 06:54:00 +00006532Version 3.0.0 (16 Mar 2014)
6533===========================
6534
65352014-03-16: wsfulton
6536 C++11 support initially developed as C++0x support by Matevz Jekovec as a Google Summer of Code
6537 project has been further extended. The C++11 support is comprehensive, but by no means complete
6538 or without limitations. Full details for each new feature in C++11 is covered in the
6539 CPlusPlus11.html chapter in the documentation which is included in SWIG and also available
Olly Betts631b41a2022-10-06 13:16:39 +13006540 online at https://www.swig.org/Doc3.0/CPlusPlus11.html.
William S Fultonb0afd852014-03-17 06:54:00 +00006541
65422014-03-14: v-for-vandal
6543 [Lua] Numerous Lua improvements:
6544 1. %nspace support has been added. Namespaces are mapped to tables in the module, with the same
6545 name as the C++ namespace.
6546 2. Inheritance is now handled differently. Each class metatable keeps a list of class bases instead
6547 of merging all members of all bases into the derived class.
6548 3. The new metatables result in differences in accessing class members. For example:
6549
6550 %module example
6551 struct Test {
6552 enum { TEST1 = 10, TEST2 = 20 };
6553 static const int ICONST = 12;
6554 };
6555
6556 Now this can be used as follows:
6557 print(example.Test.TEST1)
6558 print(example.Test.ICONST)
6559 The old way was:
6560 print(example.Test_TEST1)
6561 print(example.Test_ICONST)
6562
6563 4. The special class metatable member ".constructor" was removed. Now SWIG generates the proxy
6564 function by itself and assigns it directly to the class table "__call" method.
6565 5. eLua should also now support inheritance.
6566 6. 'const' subtable in eLua is considered deprecated.
6567
6568 Changes in behaviour:
6569 a. You can no longer assign to non-existing class members in classes without a __setitem__ method.
6570 It will cause a Lua error.
6571 b. You can no longer iterate over a module table and copy everything into the global namespace.
6572 Actually, this was never the case, but it is now explicitly prohibited.
6573 c. Now changing a base class will immediately affect all derived classes.
6574 d. There might be some issues with inheritance. Although the bases iteration scheme is the same
6575 as was used for merging base classes into derived one, some unknown issues may arise.
6576
6577 The old metatable behaviour can be restored by using the -no-old-metatable-bindings option.
6578
6579 *** POTENTIAL INCOMPATIBILITY ***
6580
65812014-03-06: wsfulton
6582 [Python] Change in default behaviour wrapping C++ bool. Only a Python True or False
6583 will now work for C++ bool parameters. This fixes overloading bool with other types.
6584 Python 2.3 minimum is now required for wrapping bool.
6585
6586 When wrapping:
6587
6588 const char* overloaded(bool value) { return "bool"; }
6589 const char* overloaded(int value) { return "int"; }
6590
6591 Previous behaviour:
6592 >>> overloaded(False)
6593 'int'
6594 >>> overloaded(True)
6595 'int'
6596 >>> overloaded(0)
6597 'int'
6598
6599 Now we get the expected behaviour:
6600 >>> overloaded(False)
6601 'bool'
6602 >>> overloaded(0)
6603 'int'
6604
6605 The consequence is when wrapping bool in non-overloaded functions:
6606
6607 const char* boolfunction(bool value) { return value ? "true" : "false"; }
6608
6609 The previous behaviour was very Pythonic:
6610 >>> boolfunction("")
6611 'false'
6612 >>> boolfunction("hi")
6613 'true'
6614 >>> boolfunction(12.34)
6615 'true'
6616 >>> boolfunction(0)
6617 'false'
6618 >>> boolfunction(1)
6619 'true'
6620
6621 Now the new behaviour more along the lines of C++ due to stricter type checking. The
6622 above calls result in an exception and need to be explicitly converted into a bool as
6623 follows:
6624 >>> boolfunction(0)
6625 Traceback (most recent call last):
6626 File "<stdin>", line 1, in <module>
6627 TypeError: in method 'boolfunction', argument 1 of type 'bool'
6628 >>> boolfunction(bool(0))
6629 'false'
6630
6631 The old behaviour can be resurrected by passing the -DSWIG_PYTHON_LEGACY_BOOL command line
6632 parameter when executing SWIG. Typemaps can of course be written to customise the behaviour
6633 for specific parameters.
6634
6635 *** POTENTIAL INCOMPATIBILITY ***
6636
66372014-03-06: wsfulton
6638 Fix SF Bug #1363 - Problem with method overloading when some methods are added by %extend
6639 and others are real methods and using template default parameters with smart pointers.
6640 This is noticeable as a regression since 2.0.12 when using the default smart pointer
6641 handling for some languages when the smart pointer wraps std::map and other STL containers.
6642
66432014-03-02: wsfulton
6644 [Python] SF Patch #346 from Jens Krueger. Correct exception thrown attempting to
6645 access a non-existent C/C++ global variable on the 'cvar' object. The exception thrown
6646 used to be a NameError. However, as this access is via a primary, an AttributeError
6647 is more correct and so the exception thrown now is an AttributeError. Reference:
6648 http://docs.python.org/2/reference/expressions.html#attribute-references
6649
6650 *** POTENTIAL INCOMPATIBILITY ***
6651
66522014-03-01: wsfulton
6653 [Python] Patch #143 Fix type shown when using type() to include the module and package
6654 name when using -builtin.
6655
66562014-03-01: wsfulton
6657 [Python] SF patch #347 Fix missing argument count checking with -modern.
6658 Fixes regression introduced when builtin changes were introduced in SWIG-2.0.3.
6659
66602014-02-21: wsfulton
6661 [PHP] Fix warning suppression using %warnfilter for PHP reserved class names.
6662
66632014-02-19: olly
6664 [Lua] Add keyword warnings for Lua keywords and Basic Functions.
6665
66662014-02-19: olly
6667 -Wallkw now includes keywords for all languages with keyword
6668 warnings (previously Go and R were missing).
6669
66702014-02-19: olly
6671 [PHP] Update the lists of PHP keywords with new ones from PHP 5.4
6672 and newer (and some missing ones from 5.3). Reserved PHP constants
6673 names are now checked against enum values and constants, instead
6674 of against function and method names. Built-in PHP function names
6675 no longer match methods added by %extend. Functions and methods
6676 named '__sleep', '__wakeup', 'not', 'parent', or 'virtual' are no
6677 longer needlessly renamed.
6678
66792014-02-15: wsfulton
6680 Fix the %$ismember %rename predicates to also apply to members added via %extend.
6681
6682 Add %$isextendmember for %rename of members added via %extend. This can be used to
6683 distinguish between normal class/struct members and %extend members. For example
6684 '%$ismember, %$not %$isextendmember' will now identify just class/struct members.
6685
6686 *** POTENTIAL INCOMPATIBILITY ***
6687
66882014-02-16: hfalcic
6689 [Python] Patch #137 - fix crashes/exceptions in exception handling in Python 3.3
6690
66912014-02-15: wsfulton
6692 [Java] Add support for the cdata library.
6693
66942014-02-08: vkalinin
6695 Nested class support added. This primarily allows SWIG to properly parse nested
6696 classes and keep the nested class information in the parse tree. Java and C#
6697 have utilised this information wrapping the C++ nested classes as Java/C#
6698 nested classes. The remaining target languages ignore nested classes as in
6699 previous versions. Help is needed by users of these remaining languages to
6700 design how C++ nested classes can be best wrapped. Please talk to us on the
6701 swig-devel mailing list if you think you can help.
6702
6703 Previously, there was limited nested class support. Nested classes were treated
6704 as opaque pointers. However, the "nestedworkaround" feature provided a way to
6705 wrap a nested class as if it was a global class. This feature no longer exists
6706 and is replaced by the new "flatnested" feature. This effectively does the same
6707 thing with less manual code to be written. Please see the 'Nested classes'
6708 section in the documentation in SWIGPlus.html if you were previously using this
6709 feature.
6710
6711 SWIG now parses the contents of nested classes where previously it did not. You
6712 may find that you will need to make adjustments to your interface file as
6713 effectively extra code is being wrapped.
6714
6715 *** POTENTIAL INCOMPATIBILITY ***
6716
67172014-02-06: gjanssens
6718 [Guile] Patch #133. Make scm to string conversion work with non-ascii strings.
6719 Guile 2 has a completely rewritten string implementation. SWIG made some assumptions
6720 that are no longer valid as to the internals of guile's string representation.
6721
67222014-01-30: wsfulton
6723 [C#] Add new swigtype_inout.i library containing SWIGTYPE *& OUTPUT typemaps.
6724
6725 Example usage wrapping:
6726
6727 void f(XXX *& x) { x = new XXX(111); }
6728
6729 would be:
6730
6731 XXX x = null;
6732 f(out x);
6733 // use x
6734 x.Dispose(); // manually clear memory or otherwise leave out and leave it to the garbage collector
6735
67362014-01-21: ianlancetaylor
6737 [Go] Add %go_import directive.
6738
67392014-01-21: ianlancetaylor
6740 [Go] Add support for Go 1.3, not yet released.
6741
67422014-01-20: wsfulton
6743 Director exceptions (Swig::DirectorException) now derive from std::exception
6744 and hence provide the what() method. In Python and Ruby, this replaces the now
6745 deprecated DirectorException::getMessage() method.
6746
67472014-01-14: diorcety
6748 Patch #112 - Fix symbol resolution involving scopes that have multiple levels
6749 of typedefs - fixes some template resolutions as well as some typemap searches.
6750
67512014-01-11: wsfulton
6752 Fix and document the naturalvar feature override behaviour - the naturalvar
6753 feature attached to a variable name has precedence over the naturalvar
6754 feature attached to the variable's type. The overriding was not working
6755 when turning the feature off on the variable's name.
6756
6757 Fix so that any use of the naturalvar feature will override the global
6758 setting. Previously when set globally by -naturalvar or %module(naturalvar=1),
6759 use of the naturalvar feature was not always honoured.
6760
67612014-01-06: ianlancetaylor
6762 [Go] Fix bug that broke using directors from a thread not
6763 created by Go.
6764
67652013-12-24: ptomulik
6766 [Python] SF Bug #1297
6767
6768 Resolve several issues related to python imports.
6769 For example, it's now possible to import modules having the same module
6770 names, but belonging in different packages.
6771
6772 From the user's viewpoint, this patch gives a little bit more control on
6773 import statements generated by SWIG. The user may choose to use relative
6774 or absolute imports.
6775
6776 Some details:
6777 - we (still) generate import statements in the form 'import a.b.c' which
6778 corresponds to absolute imports in python3 and (the only available)
6779 ambiguous one in python2.
6780 - added -relativeimport option to use explicit relative import syntax
6781 (python3),
6782
6783 The "Python Packages" section in the documentation discusses how to work
6784 with importing packages including the new -relativeimport command line option.
6785
67862013-12-23: vadz
6787 [Octave, Perl, Python, R, Ruby, Tcl] Change the length of strings created from fixed-size char
6788 buffers in C code.
6789
6790 This is a potential backwards compatibility break: a "char buf[5]" containing "ho\0la" was
6791 returned as a string of length 5 before, but is returned as a string of length 2 now. Also,
6792 it was possible to assign a (non-NUL-terminated) string "hello" to such a buffer before but
6793 now this fails and only "helo" can fit.
6794
6795 Apply "char FIXSIZE[ANY]" typemaps to explicitly choose the old behaviour.
6796
6797 *** POTENTIAL INCOMPATIBILITY ***
6798
67992013-12-23: talby
6800 [Perl] Add support for directors.
6801
68022013-12-18: ianlancetaylor
6803 [Go] Don't require that Go environment variables be set
6804 when running examples or testsuite when using Go 1 or
6805 later.
6806
68072013-12-17: ianlancetaylor
6808 [Go] Remove -longsize option (for backward compatibility,
6809 ignore it if seen).
6810
68112013-12-17: ianlancetaylor
6812 [Go] Add -go-pkgpath option.
6813
68142013-12-16: ianlancetaylor
6815 [Go] Update for Go 1.2 release. Add support for linking
6816 SWIG code directly into executable, rather than using a
6817 shared library.
6818
68192013-12-13: ianlancetaylor
6820 [Go] Add SWIG source file name as comments in generated
6821 files. This can be used by Go documentation tools.
6822
68232013-12-12: jleveque
6824 [Lua] Fix typo (wchar instead of wchar_t) which made wchar.i
6825 for Lua useless.
6826
68272013-12-12: vmiklos
6828 [PHP] PHP's peculiar call-time pass-by-reference feature was
6829 deprecated in PHP 5.3 and removed in PHP 5.4, so update the REF
6830 typemaps in phppointers.i to specify pass-by-reference in the
6831 function definition. Examples/php/pointer has been updated
6832 accordingly.
6833
68342013-12-12: olly
6835 [PHP] The usage of $input in PHP directorout typemaps has been
6836 changed to be consistent with other languages. The typemaps
6837 provided by SWIG have been updated accordingly, but if you
6838 have written your own directorout typemaps, you'll need to
6839 update $input to &$input (or make equivalent changes).
6840
6841 *** POTENTIAL INCOMPATIBILITY ***
6842
68432013-11-27: vadz
6844 [C#, Java, Python] Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
6845
68462013-11-09: wsfulton
6847 [C#] Apply patch #79 from Brant Kyser
6848 - Remove using directives from the generated C# code and fully qualify the use of all .NET
6849 framework types in order to minimize potential name collisions from input files defining
6850 types, namespace, etc with the same name as .NET framework members.
6851 - Globally qualify the use of .NET framework types in the System namespace
6852 - Remove .NET 1.1 support, .NET 2 is the minimum for the C# module
6853
6854 This is a potential backwards compatibility break if code has been added relying on these using
6855 statements that used to be generated:
6856
6857 using System;
6858 using System.Runtime.InteropServices;
6859
6860 The quick fix to add these back in is to add the -DSWIG2_CSHARP command line option when
6861 executing SWIG. See CSharp.html documentation for more info.
6862
6863 *** POTENTIAL INCOMPATIBILITY ***
6864
68652013-11-05: wsfulton
6866 [Java] Fix some corner cases for the $packagepath/$javaclassname special variable substitution.
6867
68682013-11-05: wsfulton
6869 [Java] Apply patch #91 from Marvin Greenberg - Add director:except feature for improved
6870 exception handling in director methods for Java.
6871
68722013-10-15: vadz
6873 Allow using \l, \L, \u, \U and \E in the substitution part of %(regex:/pattern/subst/)
6874 inside %rename to change the case of the text being replaced.
6875
68762013-10-12: wsfulton
6877 [CFFI] Apply #96 - superclass not lispify
6878
68792013-10-12: wsfulton
6880 Merge in C++11 support from the gsoc2009-matevz branch where Matevz Jekovec first
6881 started the C++0x additions. Documentation of the C++11 features supported is in a
6882 new Chapter of the documentation, "SWIG and C++11" in Doc/Manual/CPlusPlus11.html.
6883
68842013-10-04: wsfulton
6885 Fix %naturalvar not having any affect on templated classes instantiated with an
6886 enum as the template parameter type. Problem reported by Vadim Zeitlin.
6887
68882013-09-20: wsfulton
6889 [Java] Fix a memory leak for the java char **STRING_ARRAY typemaps.
William S Fulton37bccfd2013-09-17 23:43:30 +01006890
William S Fultond7f91bc2014-02-16 22:28:57 +00006891Version 2.0.12 (9 Feb 2014)
6892===========================
6893
68942014-01-16: wsfulton
6895 [PHP] Fix compilation error in ZTS mode (64 bit windows) due to incorrect placement
6896 of TSRMLS_FETCH() in SWIG_Php_GetModule() as reported by Mark Dawson-Butterworth.
6897
68982014-01-13: kwwette
6899 [Octave] update support to Octave version 3.8.0
6900
6901 - Octave 3.8.0 no longer defines OCTAVE_API_VERSION_NUMBER, but 3.8.1
6902 will define OCTAVE_{MAJOR,MINOR,PATCH}_VERSION instead: see
6903 http://hg.savannah.gnu.org/hgweb/octave/rev/b6b6e0dc700e
6904 So we now use a new macro SWIG_OCTAVE_PREREQ(major,minor,patch) to
6905 enable features requiring Octave version major.minor.patch or later.
6906
6907 For Octave versions prior to 3.8.1, we reconstruct values for
6908 OCTAVE_{MAJOR,MINOR,PATCH}_VERSION based on OCTAVE_API_VERSION_NUMBER,
6909 extracted from Octave's ChangeLogs. An additional hack is needed to
6910 distinguish between Octave <= 3.2.x and 3.8.0, neither of which define
6911 OCTAVE_API_VERSION_NUMBER.
6912
6913 - Octave 3.8.0 deprecates symbol_table::varref(), so remove its use
6914 for this and future versions of Octave.
6915
6916 - Octave 3.8.0 removes octave_value::is_real_nd_array(), used in
6917 octave_swig_type::dims(). Its use is not required here, so remove it.
6918
6919 - Retested against Octave versions 3.0.5, 3.2.4, 3.4.3, 3.6.4, and 3.8.0.
6920
6921 - Updated Octave documentation with tested Octave versions, and added a
6922 warning against using versions <= 3.x.x, which are no longer tested.
6923
69242013-12-22: wsfulton
6925 C++11 support for new versions of erase and insert in the STL containers.
6926
6927 The erase and insert methods in the containers use const_iterator instead
6928 of iterator in C++11. There are times when the methods wrapped must match
6929 the parameters exactly. Specifically when full type information for
6930 template types is missing or SWIG fails to look up the type correctly,
6931 for example:
6932
6933 %include <std_vector.i>
6934 typedef float Real;
6935 %template(RealVector) std::vector<Real>;
6936
6937 SWIG does not find std::vector<Real>::iterator because %template using
6938 typedefs does not always work and so SWIG doesn't know if the type is
6939 copyable and so uses SwigValueWrapper<iterator> which does
6940 not support conversion to another type (const_iterator). This resulted
6941 in compilation errors when using the C++11 version of the containers.
6942
6943 Closes #73
6944
69452013-10-17: wsfulton
6946 [R] Fix SF #1340 - Visual Studio compile error in C++ wrappers due to #include <exception>
6947 within extern "C" block.
6948
69492013-10-17: wsfulton
6950 [Python] Fix SF #1345 - Missing #include <stddef.h> for offsetof when using -builtin.
6951
69522013-10-12: wsfulton
6953 [Lua] Apply #92 - missing return statements for SWIG_Lua_add_namespace_details()
6954 and SWIG_Lua_namespace_register().
6955
William S Fulton37bccfd2013-09-17 23:43:30 +01006956Version 2.0.11 (15 Sep 2013)
6957============================
6958
69592013-09-15: wsfulton
6960 [R] Fix attempt to free a non-heap object in OUTPUT typemaps for:
6961 unsigned short *OUTPUT
6962 unsigned long *OUTPUT
6963 signed long long *OUTPUT
6964 char *OUTPUT
6965 signed char*OUTPUT
6966 unsigned char*OUTPUT
6967
69682013-09-12: wsfulton
6969 [Lua] Pull Git patch #62.
6970 1) Static members and static functions inside class can be accessed as
6971 ModuleName.ClassName.FunctionName (MemberName respectively). Old way such as
6972 ModuleName.ClassName_FunctionName still works.
6973 2) Same goes for enums inside classes: ModuleName.ClassName.EnumValue1 etc.
6974
69752013-09-12: wsfulton
6976 [UTL] Infinity is now by default an acceptable value for type 'float'. This fix makes
6977 the handling of type 'float' and 'double' the same. The implementation requires the
6978 C99 isfinite() macro, or otherwise some platform dependent equivalents, to be available.
6979
6980 Users requiring the old behaviour of not accepting infinity, can define a 'check' typemap
6981 wherever a float is used, such as:
6982
6983 %typemap(check,fragment="<float.h>") float, const float & %{
6984 if ($1 < -FLT_MAX || $1 > FLT_MAX) {
6985 SWIG_exception_fail(SWIG_TypeError, "Overflow in type float");
6986 }
6987 %}
6988
6989 *** POTENTIAL INCOMPATIBILITY ***
6990
69912013-08-30: wsfulton
6992 [Lua] Pull Git patch #81: Include Lua error locus in SWIG error messages.
6993 This is standard information in Lua error messages, and makes it much
6994 easier to find bugs.
6995
69962013-08-29: wsfulton
6997 Pull Git patch #75: Handle UTF-8 files with BOM at beginning of file. Was giving an
6998 'Illegal token' syntax error.
6999
70002013-08-29: wsfulton
7001 [C#] Pull Git patch #77: Allow exporting std::map using non-default comparison function.
7002
70032013-08-28: wsfulton
7004 [Python] %implicitconv is improved for overloaded functions. Like in C++, the methods
7005 with the actual types are considered before trying implicit conversions. Example:
7006
7007 %implicitconv A;
7008 struct A {
7009 A(int i);
7010 };
7011 class CCC {
7012 public:
7013 int xx(int i) { return 11; }
7014 int xx(const A& i) { return 22; }
7015 };
7016
7017 The following python code:
7018
7019 CCC().xx(-1)
7020
7021 will now return 11 instead of 22 - the implicit conversion is not done.
7022
70232013-08-23: olly
7024 [Python] Fix clang++ warning in generated wrapper code.
7025
70262013-08-16: wsfulton
7027 [Python] %implicitconv will now accept None where the implicit conversion takes a C/C++ pointer.
7028 Problem highlighted by Bo Peng. Closes SF patch #230.
7029
70302013-08-07: wsfulton
7031 [Python] SF Patch #326 from Kris Thielemans - Remove SwigPyObject_print and SwigPyObject_str and
7032 make the generated wrapper use the default python implementations, which will fall back to repr
7033 (for -builtin option).
7034
7035 Advantages:
7036 - it avoids the swig user having to jump through hoops to get print to work as expected when
7037 redefining repr/str slots.
7038 - typing the name of a variable on the python prompt now prints the result of a (possibly redefined)
7039 repr, without the swig user having to do any extra work.
7040 - when redefining repr, the swig user doesn't necessarily have to redefine str as it will call the
7041 redefined repr
7042 - the behaviour is exactly the same as without the -builtin option while requiring no extra work
7043 by the user (aside from adding the %feature("python:slot...) statements of course)
7044
7045 Disadvantage:
7046 - default str() will give different (but clearer?) output on swigged classes
7047
70482013-07-30: wsfulton
7049 [Python, Ruby] Fix #64 #65: Missing code in std::multimap wrappers. Previously an instantiation
7050 of a std::map was erroneously required in addition to an instantiation of std::multimap with the
7051 same template parameters to prevent compilation errors for the wrappers of a std::multimap.
7052
70532013-07-14: joequant
7054 [R] Change types file to allow for SEXP return values
7055
70562013-07-05: wsfulton
7057 [Python] Add %pythonbegin directive which works like %pythoncode, except the specified code is
7058 added at the beginning of the generated .py file. This is primarily needed for importing from
7059 __future__ statements required to be at the very beginning of the file. Example:
7060
7061 %pythonbegin %{
7062 from __future__ import print_function
7063 print("Loading", "Whizz", "Bang", sep=' ... ')
7064 %}
7065
70662013-07-01: wsfulton
7067 [Python] Apply SF patch #340 - Uninitialized variable fix in SWIG_Python_NonDynamicSetAttr
7068 when using -builtin.
7069
70702013-07-01: wsfulton
7071 [Python, Ruby, Ocaml] Apply SF patch #341 - fix a const_cast in generated code that was generating
7072 a <:: digraph when using the unary scope operator (::) (global scope) in a template type.
7073
70742013-07-01: wsfulton
7075 [Python] Add SF patch #342 from Christian Delbaere to fix some director classes crashing on
7076 object deletion when using -builtin. Fixes SF bug #1301.
7077
70782013-06-11: wsfulton
7079 [Python] Add SWIG_PYTHON_INTERPRETER_NO_DEBUG macro which can be defined to use the Release version
7080 of the Python interpreter in Debug builds of the wrappers. The Visual Studio .dsp example
7081 files have been modified to use this so that Debug builds will now work without having
7082 to install or build a Debug build of the interpreter.
7083
70842013-06-07: wsfulton
7085 [Ruby] Git issue #52. Fix regression with missing rb_complex_new function for Ruby
7086 versions prior to 1.9 using std::complex wrappers if just using std::complex as an output type.
7087 Also fix the Complex helper functions external visibility (to static by default).
7088
70892013-06-04: olly
7090 [PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
7091 if the type lookup fails.
7092
William S Fulton8e89cad2013-05-27 20:27:50 +01007093Version 2.0.10 (27 May 2013)
7094============================
7095
70962013-05-25: wsfulton
7097 [Python] Fix Python 3 inconsistency when negative numbers are passed
7098 where a parameter expects an unsigned C type. An OverFlow error is
7099 now consistently thrown instead of a TypeError.
7100
71012013-05-25: Artem Serebriyskiy
7102 SVN Patch ticket #338 - fixes to %attribute macros for template usage
7103 with %arg.
7104
71052013-05-19: wsfulton
7106 Fix ccache-swig internal error bug due to premature file cleanup.
7107
7108 Fixes SF bug 1319 which shows up as a failure in the ccache tests on
7109 Debian 64 bit Wheezy, possibly because ENABLE_ZLIB is defined.
7110
7111 This is a corner case which will be hit when the maximum number of files
7112 in the cache is set to be quite low (-F option), resulting in a cache miss.
7113
71142013-05-09: kwwette
7115 [Octave] Fix bugs in Octave module loading:
7116 - fix a memory leak in setting of global variables
7117 - install functions only once, to speed up module loads
7118
71192013-04-28: gjanssens
7120 [Guile] Updates in guile module:
7121 - Add support for guile 2.0
7122 - Drop support for guile 1.6
7123 - Drop support for generating wrappers using guile's gh interface.
7124 All generated wrappers will use the scm interface from now on.
7125 - Deprecate -gh and -scm options. They are no longer needed.
7126 A warning will be issued when these options are still used.
7127 - Fix all tests and examples to have a successful travis test
7128
71292013-04-18: wsfulton
7130 Apply Patch #36 from Jesus Lopez to add support for $descriptor() special variable macro expansion
7131 in fragments. For example:
7132
7133 %fragment("nameDescriptor", "header")
7134 %{
7135 static const char *nameDescriptor = "$descriptor(Name)";
7136 %}
7137
7138 which will generate into the wrapper if the fragment is used:
7139
7140 static const char *nameDescriptor = "SWIGTYPE_Name";
7141
71422013-04-18: wsfulton
7143 Fix SF Bug #428 - Syntax error when preprocessor macros are defined inside of enum lists, such as:
7144
7145 typedef enum {
7146 eZero = 0
7147 #define ONE 1
7148 } EFoo;
7149
7150 The macros are silently ignored.
7151
71522013-04-17: wsfulton
Olly Bettsc6e4dea2013-10-15 11:25:11 +13007153 [C#] Pull patch #34 from BrantKyser to fix smart pointers in conjunction with directors.
William S Fulton8e89cad2013-05-27 20:27:50 +01007154
71552013-04-15: kwwette
7156 [Octave] Fix bugs in output of cleanup code.
7157 - Cleanup code is now written also after the "fail:" label, so it will be called if
7158 a SWIG_exception is raised by the wrapping function, consistent with other modules.
7159 - Octave module now also recognises the "$cleanup" special variable, if needed.
7160
71612013-04-08: kwwette
7162 Add -MP option to SWIG for generating phony targets for all dependencies.
7163 - Prevents make from complaining if header files have been deleted before
7164 the dependency file has been updated.
7165 - Modelled on similar option in GCC.
7166
71672013-04-09: olly
7168 [PHP] Add missing directorin typemap for char* and char[] which
7169 fixes director_string testcase failure.
7170
71712013-04-05: wsfulton
7172 [Ruby] SF Bug #1292 - Runtime fixes for Proc changes in ruby-1.9 when using STL
7173 wrappers that override the default predicate, such as:
7174
7175 %template(Map) std::map<swig::LANGUAGE_OBJ, swig::LANGUAGE_OBJ, swig::BinaryPredicate<> >;
7176
71772013-04-05: wsfulton
7178 [Ruby] SF Bug #1159 - Correctly check rb_respond_to call return values to fix some
7179 further 1.9 problems with functors and use of Complex wrappers.
7180
71812013-04-02: wsfulton
7182 [Ruby] Runtime fixes for std::complex wrappers for ruby-1.9 - new native Ruby complex numbers are used.
7183
71842013-03-30: wsfulton
7185 [Ruby] Fix seg fault when using STL containers of generic Ruby types, GC_VALUE or LANGUAGE_OBJECT,
7186 on exit of the Ruby interpreter. More frequently observed in ruby-1.9.
7187
71882013-03-29: wsfulton
7189 [Ruby] Fix delete_if (reject!) for the STL container wrappers which previously would
7190 sometimes seg fault or not work.
7191
71922013-03-25: wsfulton
7193 [Python] Fix some undefined behaviour deleting slices in the STL containers.
7194
71952013-03-19: wsfulton
7196 [C#, Java, D] Fix seg fault in SWIG using directors when class and virtual method names are
7197 the same except being in different namespaces when the %nspace feature is not being used.
7198
71992013-02-19: kwwette
7200 Fix bug in SWIG's handling of qualified (e.g. const) variables of array type. Given the typedef
7201 a(7).q(volatile).double myarray // typedef volatile double[7] myarray;
7202 the type
7203 q(const).myarray // const myarray
7204 becomes
7205 a(7).q(const volatile).double // const volatile double[7]
7206 Previously, SwigType_typedef_resolve() produces the type
7207 q(const).a(7).q(volatile).double // non-sensical type
7208 which would never match %typemap declarations, whose types were parsed correctly.
7209 Add typemap_array_qualifiers.i to the test suite which checks for the correct behaviour.
7210
72112013-02-18: wsfulton
7212 Deprecate typedef names used as constructor and destructor names in %extend. The real
7213 class/struct name should be used.
7214
7215 typedef struct tagEStruct {
7216 int ivar;
7217 } EStruct;
7218
7219 %extend tagEStruct {
7220 EStruct() // illegal name, should be tagEStruct()
7221 {
7222 EStruct *s = new EStruct();
7223 s->ivar = ivar0;
7224 return s;
7225 }
7226 ~EStruct() // illegal name, should be ~tagEStruct()
7227 {
7228 delete $self;
7229 }
7230 }
7231
7232 For now these trigger a warning:
7233
7234 extend_constructor_destructor.i:107: Warning 522: Use of an illegal constructor name 'EStruct' in
7235 %extend is deprecated, the constructor name should be 'tagEStruct'.
7236 extend_constructor_destructor.i:111: Warning 523: Use of an illegal destructor name 'EStruct' in
7237 %extend is deprecated, the destructor name should be 'tagEStruct'.
7238
7239 These %extend destructor and constructor names were valid up to swig-2.0.4, however swig-2.0.5 ignored
7240 them altogether for C code as reported in SF bug #1306. The old behaviour of using them has been
7241 restored for now, but is officially deprecated. This does not apply to anonymously defined typedef
7242 classes/structs such as:
7243
7244 typedef struct {...} X;
7245
72462013-02-17: kwwette
7247 When generating functions provided by %extend, use "(void)" for no-argument functions
7248 instead of "()". This prevents warnings when compiling with "gcc -Wstrict-prototypes".
7249
72502013-02-17: kwwette
7251 [Octave] Minor fix to autodoc generation: get the right type for functions returning structs.
7252
72532013-02-15: wsfulton
7254 Deprecate typedef names used in %extend that are not the real class/struct name. For example:
7255
7256 typedef struct StructBName {
7257 int myint;
7258 } StructB;
7259
7260 %extend StructB {
7261 void method() {}
7262 }
7263
7264 will now trigger a warning:
7265
7266 swig_extend.i:19: Warning 326: Deprecated %extend name used - the struct name StructBName
7267 should be used instead of the typedef name StructB.
7268
7269 This is only partially working anyway (the %extend only worked if placed after the class
7270 definition).
7271
72722013-02-09: wsfulton
7273 [CFFI] Apply patch #22 - Fix missing package before &body
7274
72752013-01-29: wsfulton
7276 [Java] Ensure 'javapackage' typemap is used as it stopped working from version 2.0.5.
7277
72782013-01-28: wsfulton
7279 [Python] Apply patch SF #334 - Fix default value conversions "TRUE"->True, "FALSE"->False.
7280
72812013-01-28: wsfulton
7282 [Java] Apply patch SF #335 - Truly ignore constructors in directors with %ignore.
7283
72842013-01-18: Brant Kyser
7285 [Java] Patch #15 - Allow the use of the nspace feature without the -package commandline option.
7286 This works as long and the new jniclasspackage pragma is used to place the JNI intermediate class
7287 into a package and the nspace feature is used to place all exposed types into a package.
7288
72892013-01-15: wsfulton
7290 Fix Visual Studio examples to work when SWIG is unzipped into a directory containing spaces.
7291
72922013-01-15: wsfulton
7293 [C#] Fix cstype typemap lookup for member variables so that a fully qualified variable name
7294 matches. For example:
7295 %typemap(cstype) bool MVar::mvar "MyBool"
7296 struct MVar {
7297 bool mvar;
7298 };
7299
73002013-01-11: Brant Kyser
7301 [Java, C#, D] SF Bug #1299 - Fix generated names for when %nspace is used on
7302 classes with the same name in two different namespaces.
7303
73042013-01-11: Vladimir Kalinin
7305 [C#] Add support for csdirectorin 'pre', 'post' and 'terminator' attributes.
7306
73072013-01-08: olly
7308 [PHP] Fix to work with a ZTS build of PHP (broken in 2.0.7).
7309
73102013-01-07: olly
7311 Fix bashism in configure, introduced in 2.0.9.
7312
73132013-01-06: wsfulton
7314 Pull patch #4 from ptomulik to fix SF Bug #1296 - Fix incorrect warning for virtual destructors
7315 in templates, such as:
7316 Warning 521: Illegal destructor name B< A >::~B(). Ignored.
7317
73182013-01-05: wsfulton
7319 [Python] Pull patch #3 from ptomulik to fix SF Bug #1295 - standard exceptions as
7320 classes using the SWIG_STD_EXCEPTIONS_AS_CLASSES macro.
7321
73222013-01-04: wsfulton
7323 [Java] Pull patch #2 from BrantKyser to fix SF Bug #1283 - fix smart pointers in conjuction
7324 with directors.
7325
73262013-01-03: wsfulton
7327 [Java] Pull patch #1 from BrantKyser to fix SF Bug #1278 - fix directors and nspace feature when
7328 multilevel namespaces are used.
7329
William S Fulton382326b2013-01-03 06:49:51 +00007330Version 2.0.9 (16 December 2012)
7331================================
7332
73332012-12-16: wsfulton
7334 Fix garbage line number / empty file name reporting for some missing
7335 '}' or ')' error messages.
7336
73372012-12-15: kkaempf
7338 [Ruby] Apply patch 3530444, Class#methods and Class#constants returns array of
7339 symbols in Ruby 1.9+
7340
73412012-12-14: kkaempf
Olly Bettsf9566ad2013-01-08 18:47:40 +13007342 [Ruby] Apply patch 3530439 and finally replace all occurrences of the STR2CSTR() macro
William S Fulton382326b2013-01-03 06:49:51 +00007343 with StringValuePtr(). STR2CSTR was deprecated since years and got removed in Ruby 1.9
7344
73452012-12-14: kkaempf
7346 [Ruby] Applied patches #3530442 and 3530443 to adapt compile and runtime include
7347 paths to match Ruby 1.9+
7348
73492012-12-14: wsfulton
7350 [CFFI] Fix #3161614 - Some string constants are incorrect
7351
73522012-12-13: wsfulton
7353 [CFFI] Fix #3529690 - Fix incorrect constant names.
7354
73552012-12-12: drjoe
7356 [R] add fix to finalizer that was missed earlier
7357
73582012-12-11: wsfulton
7359 [Python] Apply patch #3590522 - fully qualified package paths for Python 3 even if a module is in the
7360 same package.
7361
73622012-12-08: wsfulton
7363 [Python] Bug #3563647 - PyInt_FromSize_t unavailable prior to Python 2.5 for unsigned int types.
7364
73652012-12-08: wsfulton
7366 [Perl] Fix bug #3571361 - C++ comment in C wrappers.
7367
73682012-12-07: wsfulton
7369 [C#] Apply patch #3571029 which adds missing director support for const unsigned long long &.
7370
73712012-11-28: kwwette
7372 [Octave] Simplified module loading: now just the syntax
7373 $ example;
7374 is accepted, which loads functions globally but constants and variables relative to the current scope.
7375 This make module loading behaviour reliably consistent, and reduces problems when loading modules which
7376 depend on other modules which may not have been previously loaded.
7377
73782012-11-27: wsfulton
7379 [cffi] Fix junk output when wrapping single character literal constants.
7380
73812012-11-17: wsfulton
7382 [Tcl, Modula3] Add missing support for -outdir.
7383
73842012-11-17: wsfulton
7385 Fix segfaults when using filename paths greater than 1024 characters in length.
7386
73872012-11-14: wsfulton
7388 [ccache-swig] Apply patch #3586392 from Frederik Deweerdt to fix some error cases - incorrectly using
7389 memory after it has been deleted.
7390
73912012-11-09: vzeitlin
7392 [Python] Fix overflow when passing values greater than LONG_MAX from Python 3 for parameters with unsigned long C type.
7393
73942012-11-09: wsfulton
7395 Fix some feature matching issues for implicit destructors and implicit constructors and implicit
7396 copy constructors added with %copyctor. Previously a feature for these had to be fully qualified
7397 in order to match. Now the following will also match:
7398
7399 %feature("xyz") ~XXX();
7400 struct XXX {};
7401
74022012-11-09: wsfulton
7403 Further consistency in named output typemap lookups for implicit constructors and destructors and
7404 implicit copy constructors added with %copyctor. Previously only the fully qualified name was being
7405 used, now the unqualified name will also be used. For example, previously:
7406
7407 example.i:38: Searching for a suitable 'out' typemap for: void Space::More::~More
7408 Looking for: void Space::More::~More
7409 Looking for: void
7410
7411 Now the unqualified name is also used:
7412
7413 example.i:38: Searching for a suitable 'out' typemap for: void Space::More::~More
7414 Looking for: void Space::More::~More
7415 Looking for: void ~More
7416 Looking for: void
7417
74182012-11-02: wsfulton
7419 Fix some subtle named output typemap lookup misses, the fully qualified name was not always being
7420 used for variables, for example:
7421
7422 struct Glob {
7423 int MyVar;
7424 };
7425
7426 Previously the search rules (as shown by -debug-tmsearch) for the getter wrapper were:
7427
7428 example.i:44: Searching for a suitable 'out' typemap for: int MyVar
7429 Looking for: int MyVar
7430 Looking for: int
7431
7432 Now the scope is named correctly:
7433
7434 example.i:44: Searching for a suitable 'out' typemap for: int Glob::MyVar
7435 Looking for: int Glob::MyVar
7436 Looking for: int MyVar
7437 Looking for: int
7438
74392012-10-26: wsfulton
7440 Fix director typemap searching so that a typemap specified with a name will be correctly matched. Previously
7441 the name was ignored during the typemap search. Applies to the following list of typemaps:
7442 directorout, csdirectorout, cstype, imtype, ctype, ddirectorout, dtype, gotype, jtype, jni, javadirectorout.
7443
74442012-10-11: wsfulton
7445 Most of the special variables available for use in %exception are now also available for expansion in
William S Fultone982dc72014-07-01 20:07:19 +01007446 %extend blocks. These are: $name $symname $overname $decl $fulldecl $parentclassname $parentclasssymname, see docs
William S Fulton382326b2013-01-03 06:49:51 +00007447 on "Class extension" in SWIGPlus.html. Patch based on submission from Kris Thielemans.
7448
74492012-10-10: wsfulton
7450 Additional new special variables in %exception are expanded as follows:
William S Fultone982dc72014-07-01 20:07:19 +01007451 $parentclassname - The parent class name (if any) for a method.
7452 $parentclasssymname - The target language parent class name (if any) for a method.
William S Fulton382326b2013-01-03 06:49:51 +00007453
74542012-10-08: iant
7455 [Go] Generating Go code now requires using the -intgosize option to
7456 indicate the size of the 'int' type in Go. This is because the
7457 size of the type is changing from Go 1.0 to Go 1.1 for x86_64.
7458
74592012-09-14: wsfulton
7460 Add new warning if the empty template instantiation is used as a base class, for example:
7461
7462 template <typename T> class Base {};
7463 %template() Base<int>;
7464 class Derived : public Base<int> {};
7465
7466 gives the following warning instead of silently ignoring the base:
7467
7468 cpp_inherit.i:52: Warning 401: Base class 'Base< int >' has no name as it is an empty template instantiated with '%template()'. Ignored.
7469 cpp_inherit.i:51: Warning 401: The %template directive must be written before 'Base< int >' is used as a base class and be declared with a name.
7470
7471
74722012-09-11: wsfulton
7473 [Java] Fix #3535304 - Direct use of a weak global reference in directors
7474 sometimes causing seg faults especially on Android.
7475
74762012-09-06: wsfulton
7477 [Java] Fix (char *STRING, size_t LENGTH) typemaps to accept NULL string.
7478
74792012-08-26: drjoe
7480 [R] make ExternalReference slot ref to contain reference
7481
74822012-08-26: drjoe
7483 [R] fix Examples/Makefile to use C in $(CC) rather than $(CXX)
7484
William S Fulton0e4e0672012-08-21 22:11:07 +00007485Version 2.0.8 (20 August 2012)
7486==============================
7487
74882012-08-15: wsfulton
7489 [Perl] Add size_type, value_type, const_reference to the STL containers.
7490
74912012-08-15: wsfulton
7492 [Python] Add discard and add methods to std::set wrappers so that pyabc.i can be used ensuring
7493 MutableSet is a valid abstract base class for std::set. As reported by Alexey Sokolov.
7494 Similarly for std::multiset.
7495
74962012-08-15: wsfulton
7497 [Python] Fix #3541744 - Missing PyInt_FromSize_t calls for Python 3.
7498
74992012-08-13: wsfulton
7500 [Java] Patch from David Baum to add the assumeoverride feature for Java directors to
7501 improve performance when all overridden methods can be assumed to be overridden.
7502
75032012-08-05: wsfulton
7504 [Python] #3530021 Fix unused variable warning.
7505
75062012-08-05: wsfulton
7507 [C#] Fix #3536360 - Invalid code sometimes being generated for director methods
7508 with many arguments.
7509
75102012-08-05: wsfulton
7511 [Perl] #3545877 - Don't undefine bool if defined by C99 stdbool.h - problem using
7512 Perl 5.16 and later.
7513
75142012-08-04: wsfulton
7515 Remove incorrect warning (314) about target language keywords which were triggered
7516 by using declarations and using directives. For example 'string' is a keyword in C#:
7517 namespace std { class string; }
7518 using std::string;
7519
75202012-07-21: wsfulton
7521 Fix display of pointers in various places on 64 bit systems - only 32 bits were being shown.
7522
75232012-07-21: wsfulton
7524 Fix gdb debugger functions 'swigprint' and 'locswigprint' to display to the gdb output window
7525 rather than stdout. This fixes display problems in gdbtui and the ensures the output
7526 appears where expected in other gdb based debuggers such as Eclipse CDT.
7527
75282012-07-20: kwwette
7529 [Octave] segfault-on-exit prevention hack now preserves exit status, and uses C99 _Exit().
7530
75312012-07-02: wsfulton
7532 Fix Debian bug http://bugs.debian.org/672035, typemap copy failure - regression introduced
7533 in swig-2.0.5:
7534 %include<stl.i>
7535 using std::pair;
7536 %template(StrPair) pair<std::string, std::string>;
7537
75382012-07-02: wsfulton
7539 Fix using declarations combined with using directives with forward class declarations so that
7540 types are correctly found in scope for templates. Example:
7541
7542 namespace Outer2 {
7543 namespace Space2 {
7544 template<typename T> class Thing2;
7545 }
7546 }
7547 using namespace Outer2;
7548 using Space2::Thing2;
7549 template<typename T> class Thing2 {};
7550 // STILL BROKEN void useit2(Thing2<int> t) {}
7551 void useit2a(Outer2::Space2::Thing2<int> t) {}
7552 void useit2b(::Outer2::Space2::Thing2<int> t) {}
7553 void useit2c(Space2::Thing2<int> t) {}
7554 namespace Outer2 {
7555 void useit2d(Space2::Thing2<int> t) {}
7556 }
7557
7558 %template(Thing2Int) Thing2<int>;
7559
7560
75612012-06-30: wsfulton
7562 Fix template namespace problems for symbols declared with a forward class declarations, such as:
7563
7564 namespace Space1 {
7565 namespace Space2 {
7566 template<typename T> struct YYY;
7567 }
7568 template<typename T> struct Space2::YYY {
7569 T yyy(T h) {
7570 return h;
7571 }
7572 };
7573 void testYYY1(Space1::Space2::YYY<int> yy) {}
7574 void testYYY2(Space2::YYY<int> yy) {}
7575 void testYYY3(::Space1::Space2::YYY<int> yy) {}
7576 }
7577
7578 %template(YYYInt) Space1::Space2::YYY<int>;
7579
75802012-06-30: wsfulton
7581 Fix namespace problems for symbols declared with a forward class declarations, such as:
7582
7583 namespace Space1 {
7584 namespace Space2 {
7585 struct XXX;
7586 struct YYY;
7587 }
7588
7589 struct Space2::YYY {};
7590 struct Space1::Space2::XXX {};
7591
7592 void testXXX2(Space2::XXX xx) {}
7593 void testYYY2(Space2::YYY yy) {}
7594 }
7595
7596 where xx and yy were not recognised as the proxy classes XXX and YYY.
7597
75982012-06-30: wsfulton
7599 Fix using declarations combined with using directives with forward class declarations so that
7600 types are correctly found in scope.
7601
7602 namespace Outer2 {
7603 namespace Space2 {
7604 class Thing2;
7605 }
7606 }
7607 using namespace Outer2;
7608 using Space2::Thing2;
7609 class Thing2 {};
7610 // None of the methods below correctly used the Thing2 proxy class
7611 void useit2(Thing2 t) {}
7612 void useit2a(Outer2::Space2::Thing2 t) {}
7613 void useit2b(::Outer2::Space2::Thing2 t) {}
7614 void useit2c(Space2::Thing2 t) {}
7615 namespace Outer2 {
7616 void useit2d(Space2::Thing2 t) {}
7617 }
7618
76192012-06-25: wsfulton
7620 Fix using declarations combined with using directives so that types are correctly found in scope.
7621 Example:
7622
7623 namespace Outer2 {
7624 namespace Space2 {
7625 class Thing2 {};
7626 }
7627 }
7628 using namespace Outer2; // using directive
7629 using Space2::Thing2; // using declaration
7630 void useit2(Thing2 t) {}
7631
7632 Similarly for templated classes.
7633
76342012-05-29: wsfulton
7635 Fix #3529601 - seg fault when a protected method has the "director"
7636 feature but the parent class does not. Also fix similar problems with
7637 the allprotected feature.
7638
76392012-05-28: wsfulton
7640 Fix seg fault when attempting to warn about an illegal destructor - #3530055, 3530078 and #3530118.
7641
William S Fulton3a55dd32012-05-26 08:05:16 +00007642Version 2.0.7 (26 May 2012)
7643===========================
76442012-05-26: wsfulton
7645 std::string typemap modifications so they can be used with %apply for other string
7646 classes.
7647
76482012-05-25: wsfulton
7649 [Lua] Fixes for -external-runtime to work again.
7650
76512012-05-22: szager
7652 [python] Disambiguate SWIG_From_unsigned_SS_int and SWIG_From_unsigned_SS_long.
7653
76542012-05-18: olly
7655 [PHP] Fix getters for template members. (SF#3428833, SF#3528035)
7656
76572012-05-14: wsfulton
7658 Fix some language's std::map wrappers to recognise difference_type, size_type, key_type
7659 and mapped_type.
7660
76612012-05-14: kwwette (signed off by xavier98)
7662 [Octave] Prevent Octave from seg-faulting at exit when SWIG
7663 modules are loaded, due to bugs in Octave's cleanup code:
7664 * Wrapping functions now declared with Octave DEFUN_DLD macro,
7665 and loaded through Octave's dynamic module loader
7666 * Global variables of swigref type are now assigned a new()
7667 copy of the swigref class, to prevent double-free errors
7668 * SWIG module at-exit cleanup function now created in Octave
7669 through eval(), so not dependent on loaded .oct library
7670 * For Octave versions 3.1.* to 3.3.*, register C-level at-exit
7671 function which terminates Octave immediately (with correct
7672 status code) without performing memory cleanup. This function
7673 can be controlled with macros in Lib/octave/octruntime.swg
7674
7675 [Octave] New syntax for determing whether SWIG module should be
7676 loaded globally or non-globally. To load module "example" globally,
7677 type the module name
7678 $ example;
7679 as before; to load module non-globally, assign it to a variable:
7680 $ example = example;
7681 or
7682 $ ex = example;
7683 for a shorter (local) module name. -global/-noglobal command-line
7684 options and module command line are deprecated. Added usage info
7685 to module, so typing
7686 $ help example
7687 or incorrect usage should display proper usage, with examples.
7688
7689 *** POTENTIAL INCOMPATIBILITY ***
7690
76912012-05-12: olly
7692 [PHP] Fix memory leak in code generated for a callback. Patch from
7693 SF bug #3510806.
7694
76952012-05-12: olly
7696 [PHP] Avoid using zend_error_noreturn() as it doesn't work with all
7697 builds of PHP (SF bug #3166423). Instead we now wrap it in a
7698 SWIG_FAIL() function which we annotate as "noreturn" for GCC to
7699 avoids warnings. This also reduces the size of the compiled
7700 wrapper (e.g. the stripped size is reduced by 6% for Xapian's PHP
7701 bindings).
7702
77032012-05-11: wsfulton
7704 [Java] SF patch #3522855 Fix unintended uninitialised memory access in OUTPUT typemaps.
7705
77062012-05-11: wsfulton
7707 [Java] SF patch #3522674 Fix possible uninitialised memory access in char **STRING_OUT
7708 typemap.
7709
77102012-05-11: wsfulton
7711 [Java] SF patch #3522611 Fix uninitialised size regression in char **STRING_ARRAY
7712 introduced in swig-2.0.6.
7713
77142012-05-11: wsfulton
7715 SF bug #3525050 - Fix regression introduced in swig-2.0.5 whereby defining one typemap
7716 method such as an 'out' typemap may hide another typemap method such as an 'in' typemap -
7717 only occurs when the type is a template type where the template parameters are the same
7718 via a typedef.
7719
77202012-05-10: olly
7721 [PHP] Fix the constant typemaps for SWIGTYPE, etc - previously
7722 these used the wrong name for renamed constants. Add
7723 autodoc_runme.php to the testsuite as a regression test for this.
7724
77252012-05-02: ianlancetaylor
7726 [Go] Remove compatibility support for gccgo 4.6. Using
7727 SWIG with gccgo will now require gccgo 4.7. Using SWIG
7728 with the more commonly used gc compiler is unaffected.
7729
77302012-05-01: wsfulton
7731 Fix generated code for C forward enum declarations in some languages.
7732
William S Fultond6cef932012-04-30 05:27:09 +00007733Version 2.0.6 (30 April 2012)
7734=============================
7735
77362012-04-25: wsfulton
7737 [Lua] Fix uninitialised variable in SWIGTYPE **OUTPUT typemaps as reported by Jim Anderson.
7738
77392012-04-28: wsfulton
William S Fultonc6f8aad2015-08-02 20:13:40 +01007740 [Python] Fix compilation errors when wrapping STL containers on Mac OS X and possibly other systems.
William S Fultond6cef932012-04-30 05:27:09 +00007741
77422012-04-28: wsfulton
7743 [Java] Patch 3521811 from Leo Davis - char **STRING_ARRAY typemaps fixed to handle
7744 null pointers.
7745
William S Fultone464aa02012-04-19 21:30:06 +00007746Version 2.0.5 (19 April 2012)
7747=============================
7748
77492012-04-14: wsfulton
7750 [Lua] Apply patch #3517435 from Miles Bader - prefer to use Lua_pushglobaltable
7751
77522012-04-14: wsfulton
7753 [Ruby] Apply patch #3517769 from Robin Stocker to fix compile error on MacRuby using RSTRING_PTR.
7754
77552012-04-13: wsfulton
7756 Apply patch #3511009 from Leif Middelschulte for slightly optimised char * variable wrappers.
7757
77582012-04-13: wsfulton
7759 [Lua] Apply #3219676 from Shane Liesegang which adds:
7760 - support for %factory
7761 - a __tostring method
7762 - a __disown method
7763
77642012-04-13: wsfulton
7765 [Xml] Apply #3513569 which adds a catchlist to the xml output.
7766
77672012-04-05: olly
7768 [Lua] Add support for Lua 5.2 (patch SF#3514593 from Miles Bader)
7769
77702012-03-26: xavier98
7771 [octave] Apply patch #3425993 from jgillis: add extra logic to the octave_swig_type::dims(void) method: it checks if the user has defined a __dims__ method and uses this in stead of returning (1,1)
7772 [octave] Apply patch #3424833 from jgillis: make is_object return true for swig types
7773
77742012-03-24: wsfulton
7775 [D] Apply #3502431 to fix duplicate symbols in multiple modules.
7776
77772012-03-21: wsfulton
7778 Fix #3494791 - %$isglobal for %rename matching.
7779
77802012-03-20: wsfulton
7781 Fix #3487706 and #3391906 - missing stddef.h include for ptrdiff_t when using %import
7782 for STL containers and compiling with g++-4.6. An include of stddef.h is now only
7783 generated when SWIG generates STL helper templates which require ptrdiff_t. If you
7784 were previously relying on "#include <stddef.h>" always being generated when using a
7785 %include of an STL header, you may now need to add this in manually.
7786
77872012-03-16: wsfulton
7788 Apply patch #3392264 from Sebastien Bine to parse (unsigned) long long types in enum value assignment.
7789
77902012-03-16: wsfulton
7791 Apply patch #3505530 from Karl Wette to allow custom allocators in STL string classes for the UTL languages.
7792
77932012-03-13: wsfulton
7794 Apply patch #3468362 from Karl Wette to fix %include inside %define.
7795
77962012-03-13: wsfulton
7797 [Python, Ruby, Octave, R] Fix #3475492 - iterating through std::vector wrappers of enumerations.
7798
77992012-02-27: xavier98 (patches from Karl Wette)
7800 [Octave] Use -globals . to load global variables in module namespace
7801 [Octave] Comment declaration of unimplemented function swig_register_director
7802 [Octave] Fix OCTAVE_PATH in octave Makefiles
7803 [Octave] Add support for std::list - fix li_std_containers_int test
7804 [Octave] Fix imports test
7805
78062012-02-16: wsfulton
7807 [Java] Make generated support functions in arrays_java.i static so that generated code
7808 from multiple instances of SWIG can be compiled and linked together - problem reported by
7809 Evan Krause.
7810
78112012-01-24: wsfulton
7812 Fix crash with bad regex - bug #3474250.
7813
78142012-01-24: wsfulton
7815 [Python] Add Python stepped slicing support to the STL wrappers (std::vector, std::list).
7816 Assigning to a slice, reading a slice and deleting a slice with steps now work.
7817 For example:
7818
7819 %template(vector_i) std::vector<int>
7820
7821 vi = vector_i(range(10))
7822 print list(vi)
7823 vi[1:4:2] = [111, 333]
7824 print list(vi)
7825 del vi[3:10:3]
7826 print list(vi)
7827 print list(vi[::-1])
7828
7829 gives (same behaviour as native Python sequences such as list):
7830
7831 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
7832 [0, 111, 2, 333, 4, 5, 6, 7, 8, 9]
7833 [0, 111, 2, 4, 5, 7, 8]
7834 [8, 7, 5, 4, 2, 111, 0]
7835
78362012-01-23: klickverbot
7837 [D] Correctly annotate function pointers with C linkage.
7838 [D] Exception and Error have become blessed names; removed d_exception_name test case.
7839
78402012-01-20: wsfulton
7841 [Python] Fix some indexing bugs in Python STL wrappers when the index is negative, eg:
7842
7843 %template(vector_i) std::vector<int>
7844
7845 iv=vector_i([0,1,2,3,4,5])
7846 iv[-7:]
7847
7848 now returns [0, 1, 2, 3, 4, 5] instead of [5].
7849
7850 vv[7:9] = [22,33]
7851
7852 now returns [0, 1, 2, 3, 4, 5, 22, 33] instead of "index out range" error.
7853
7854 Also fix some segfaults when replacing ranges, eg when il is a std::list wrapper:
7855
7856 il[0:2] = [11]
7857
78582012-01-17: wsfulton
7859 [Go] Fix forward class declaration within a class when used as a base.
7860
78612012-01-07: wsfulton
7862 [C#] Add support for %nspace when using directors.
7863
78642012-01-06: wsfulton
7865 [Java] Patch #3452560 from Brant Kyser - add support for %nspace when using directors.
7866
78672011-12-21: wsfulton
7868 The 'directorin' typemap now accepts $1, $2 etc expansions instead of having to use workarounds -
7869 $1_name, $2_name etc.
7870
78712011-12-20: wsfulton
7872 [Java] Add (char *STRING, size_t LENGTH) director typemaps.
7873
78742011-12-20: wsfulton
7875 [C#, Go, Java, D] Add support for the 'directorargout' typemap.
7876
78772011-12-20: wsfulton
7878 [Ocaml, Octave, PHP, Python, Ruby] Correct special variables in 'directorargout' typemap.
7879 This change will break any 'directorargout' typemaps you may have written. Please change:
7880 $result to $1
7881 $input to $result
7882
7883 Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't
7884 previously compile and add in $1, $2 etc expansion.
7885
7886 *** POTENTIAL INCOMPATIBILITY ***
7887
78882011-12-10: talby
7889 [perl5] SWIG_error() now gets decorated with perl source file/line number.
7890 [perl5] error handling now conforms to public XS api (fixes perl v5.14 issue).
7891
78922011-12-10: wsfulton
7893 [Android/Java] Fix directors to compile on Android.
7894
7895 Added documentation and examples for Android.
7896
78972011-12-08: vadz
7898 Bug fix: Handle methods renamed or ignored in the base class correctly in the derived classes
7899 (they could be sometimes mysteriously not renamed or ignored there before).
7900
79012011-12-03: klickverbot
7902 [D] Fix exception glue code for newer DMD 2 versions.
7903 [D] Do not default to 32 bit glue code for DMD anymore.
7904 [D] Use stdc.config.c_long/c_ulong to represent C long types.
7905
79062011-12-01: szager
7907 [python] Fixed bug 3447426: memory leak in vector.__getitem__.
7908
79092011-11-30: wsfulton
7910 [R] Remove C++ comments from generated C code.
7911
79122011-11-27: olly
7913 [Python] Fix some warnings when compiling generated wrappers with
7914 certain GCC warning options (Debian bug #650246).
7915
79162011-11-28: wsfulton
7917 Fix #3433541 %typemap(in, numinputs=0) with 10+ arguments.
7918
79192011-11-28: olly
7920 [Perl] Fix warnings when compiling generated wrappers with certain
7921 GCC warning options (Debian bug #436711).
7922
79232011-11-28: olly
7924 [PHP] Update keyword list to include keywords added in PHP releases up to 5.3.
7925
79262011-11-25: wsfulton
7927 [C#] Provide an easy way to override the default visibility for the proxy class pointer
7928 constructors and getCPtr() method. The visibility is 'internal' by default and if multiple
7929 SWIG modules are being used and compiled into different assemblies, then they need to be
7930 'public' in order to use the constructor or getCPtr() method from a different assembly.
7931 Use the following macros to change the visibilities in the proxy and type wrapper class:
7932
7933 SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
7934 SWIG_CSBODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
7935
7936 [Java] Provide an easy way to override the default visibility for the proxy class pointer
7937 constructors and getCPtr() method. The visibility is 'protected' by default and if multiple
7938 SWIG modules are being used and compiled into different packages, then they need to be
7939 'public' in order to use the constructor or getCPtr() method from a different package.
7940 Use the following macros to change the visibilities in the proxy and type wrapper class:
7941
7942 SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
7943 SWIG_JAVABODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
7944
7945 The default for Java has changed from public to protected for the proxy classes. Use the
7946 SWIG_JAVABODY_PROXY macro above to restore to the previous visibilities.
7947
7948 *** POTENTIAL INCOMPATIBILITY ***
7949
79502011-11-22: szager
7951 [python] Bug 3440044: #ifdef out SWIG_Python_NonDynamicSetAttr if -builtin
7952 isn't being used, to avoid unnecessary binary incompatibilities between
7953 python installations.
7954
79552011-11-17: wsfulton
7956 Bug fix: Remove root directory from directory search list in Windows.
7957
79582011-11-13: wsfulton
7959 [Ruby] Apply patch #3421876 from Robin Stocker to fix #3416818 - same class name in
7960 different namespaces confusion when using multiple modules.
7961
79622011-11-11: wsfulton
7963 Fix pcre-build.sh to work with non-compressed tarballs - problem reported by Adrian Blakely.
7964
79652011-11-03: wsfulton
7966 Expand special variables in typemap warnings, eg:
7967
7968 %typemap(in, warning="1000:Test warning for 'in' typemap for $1_type $1_name") int "..."
7969
79702011-11-01: wsfulton
7971 Fix named output typemaps not being used when the symbol uses a qualifier and contains
7972 a number, eg:
7973
7974 %typemap(out) double ABC::m1 "..."
7975
79762011-10-24: talby
7977 [perl5] SF bug #3423119 - overload dispatch stack corruption fix. Better, but more research
7978 is needed on a stable path for tail calls in XS.
7979
7980 Also, fix for large long longs in 32 bit perl.
7981
79822011-10-13: xavier98
7983 [octave] Allow Octave modules to be re-loaded after a "clear all".
7984
79852011-09-19: wsfulton
7986 Fix regression introduced in swig-2.0.1 reported by Teemu Ikonone leading to uncompilable code
7987 when using typedef and function pointer references, for example:
7988
7989 typedef int FN(const int &a, int b);
7990 void *typedef_call1(FN *& precallback, FN * postcallback);
7991
79922011-09-14: wsfulton
7993 [Lua] Patch #3408012 from Raman Gopalan - add support for embedded Lua (eLua)
7994 including options for targeting Lua Tiny RAM (LTR).
7995
79962011-09-14: wsfulton
7997 [C#] Add boost_intrusive_ptr.i library contribution from patch #3401571.
7998
79992011-09-13: wsfulton
8000 Add warnings for badly named destructors, eg:
8001
8002 struct KStruct {
8003 ~NOT_KStruct() {}
8004 };
8005
8006 cpp_extend_destructors.i:92: Warning 521: Illegal destructor name ~NOT_KStruct. Ignored.
8007
80082011-09-13: wsfulton
8009 Fix %extend and destructors for templates. The destructor in %extend was not always wrapped,
8010 for example:
8011
8012 %extend FooT {
8013 ~FooT() { delete $self; } // was not wrapped as expected
8014 };
8015 template<class T> class FooT {};
8016 %template(FooTi) FooT<int>;
8017
80182011-09-13: wsfulton
8019 Fix special variables such as "$decl" and "$fulldecl" in destructors to include the ~ character.
8020
80212011-09-10: talby
8022 [perl5] SF bug #1481958 - Improve range checking for integer types.
8023 Enhance li_typemaps_runme.pl
8024
80252011-09-08: wsfulton
8026 Fix %extend on typedef classes in a namespace using the typedef name, for example:
8027 namespace Space {
8028 %extend CStruct {
8029 ...
8030 }
8031 typedef struct tagCStruct { ... } CStruct;
8032 }
8033
80342011-08-31: xavier98
8035 [octave] patches from Karl Wette: improvements to module loading behavior;
8036 added example of friend operator to operator example; fixed octave panic/crash in 3.0.5;
8037 documentation improvements
8038
80392011-08-30: szager
8040 [python] Bug 3400486, fix error signalling for built-in constructors.
8041
80422011-08-26: wsfulton
8043 [Go] Fix file/line number display for "gotype" when using typemap debugging options
8044 -tmsearch and -tmused.
8045
80462011-08-26: wsfulton
William S Fulton3dcc5012014-10-21 07:55:07 +01008047 [C#, D] Fix %callback which was generating uncompilable code.
William S Fultone464aa02012-04-19 21:30:06 +00008048
80492011-08-25: wsfulton
8050 Fix constructors in named typedef class declarations as reported by Gregory Bronner:
8051
8052 typedef struct A {
8053 A(){} // Constructor which was not accepted by SWIG
8054 B(){} // NOT a constructor --illegal, but was accepted by SWIG
8055 } B;
8056
8057 For C code, the fix now results in the use of 'struct A *' instead of just 'B *' in
8058 the generated code when wrapping members in A, but ultimately this does not matter, as
8059 they are the same thing.
8060
80612011-08-23: wsfulton
8062 Fix %newobject when used in conjunction with %feature("ref") as reported by Jan Becker. The
8063 code from the "ref" feature was not always being generated for the function specified by %newobject.
8064 Documentation for "ref" and "unref" moved from Python to the C++ chapter.
8065
80662011-08-22: szager
8067 [python] Fixed memory leak with --builtin option (bug 3385089).
8068
80692011-08-22: wsfulton
8070 [Lua] SF patch #3394339 from Torsten Landschoff - new option -nomoduleglobal to disable installing
8071 the module table into the global namespace. Require call also returns the module table instead
8072 of a string.
8073
80742011-08-09: xavier98
8075 Fix bug 3387394; Octave patches for 3.4.0 compatibility, etc. (from Karl Wette)
8076
80772011-08-04: wsfulton
8078 Add in $symname expansion for director methods.
8079
80802011-07-29: olly
8081 [PHP] Don't generate "return $r;" in cases where $r hasn't been set.
8082 This was basically harmless, except it generated a PHP E_NOTICE if
8083 the calling code had enabled them.
8084
80852011-07-26: wsfulton
8086 Fix scoping of forward class declarations nested within a class (for C++). Previously the symbol
8087 was incorrectly put into the outer namespace, eg
8088
8089 namespace std {
8090 template<class Key, class T> struct map {
8091 class iterator;
William S Fultonef7a8a82012-05-11 21:23:37 +00008092 };
William S Fultone464aa02012-04-19 21:30:06 +00008093 }
8094
8095 iterator was scoped as std::iterator, but now it is correctly std::map<Key, T>::iterator;
8096
8097 Also fixed is %template and template parameters that are a typedef when the template contains
8098 default template parameters, eg:
8099
8100 namespace Std {
8101 template<class Key, class T, class C = int> struct Map {
8102 typedef Key key_type;
8103 typedef T mapped_type;
William S Fultonef7a8a82012-05-11 21:23:37 +00008104 };
William S Fultone464aa02012-04-19 21:30:06 +00008105 }
William S Fultonef7a8a82012-05-11 21:23:37 +00008106 typedef double DOUBLE;
8107 %template(MM) Std::Map<int, DOUBLE>;
William S Fultone464aa02012-04-19 21:30:06 +00008108
8109 All symbols within Map will be resolved correctly, eg key_type and mapped_type no matter if the
8110 wrapped code uses Std::Map<int, double> or std::Map<int, DOUBLE> or Std::Map<int, double, int>
8111
8112 Also fixes bug #3378145 - regression introduced in 2.0.4 - %template using traits.
8113
81142011-07-20 szager
8115 [python] Fix closure for tp_call slot.
8116
81172011-07-16: wsfulton
8118 [python] Fix director typemap using PyObject *.
8119
81202011-07-13: szager
8121 [python] SF patch #3365908 - Add all template parameters to map support code in std_map.i
8122
81232011-07-13: szager
8124 [python] Fix for bug 3324753: %rename member variables with -builtin.
8125
81262011-07-01: wsfulton
8127 Fix some scope and symbol lookup problems when template default parameters are being
8128 used with typedef. For example:
8129
8130 template<typename XX, typename TT = SomeType> struct Foo {
8131 typedef XX X;
8132 typedef TT T;
8133 };
8134 template<typename TT> struct UsesFoo {
8135 void x(typename Foo<TT>::T, typename Foo<TT>::X);
8136 };
8137
8138 Also fixes use of std::vector<int>::size_type for Python as reported by Aubrey Barnard.
8139
81402011-06-23: olly
8141 [PHP] Fix director code to work when PHP is built with ZTS enabled,
8142 which is the standard configuration on Microsoft Windows.
8143
81442011-06-21: mutandiz
8145 [allegrocl]
8146 - various small tweaks and bug fixes.
8147 - Avoid name conflicts between smart pointer wrappers and the wrappers for
8148 the actual class.
8149 - Fix default typemaps for C bindings, which were incorrectly attempting to
8150 call non-existent destructors on user-defined types.
8151 - New feature, feature:aclmixins, for adding superclass to the foreign class
8152 wrappers.
8153 - Improve longlong typemaps.
8154
81552011-06-19: wsfulton
8156 Fix incorrect typemaps being used for a symbol within a templated type, eg:
8157 A<int>::value_type would incorrectly use a typemap for type A.
8158
81592011-06-18: olly
8160 [Tcl] Fix variable declarations in middle of blocks which isn't
8161 permitted in C90 (issue probably introduced in 2.0.3 by patch #3224663).
8162 Reported by Paul Obermeier in SF#3288586.
8163
81642011-06-17: wsfulton
8165 [Java] SF #3312505 - slightly easier to wrap char[] or char[ANY] with a Java byte[]
8166 using arrays_java.i.
8167
81682011-06-13: wsfulton
8169 [Ruby, Octave] SF #3310528 Autodoc fixes similar to those described below for Python.
8170
81712011-06-10: wsfulton
8172 [Python] Few subtle bugfixes in autodoc documentation generation,
8173 - Unnamed argument names fix for autodoc levels > 0.
8174 - Display of template types fixed for autodoc levels > 1.
8175 - Fix SF #3310528 - display of typedef structs for autodoc levels > 1.
8176 - Add missing type for self for autodoc levels 1 and 3.
8177 - autodoc levels 2 and 3 documented.
8178 - Minor tweaks to autodoc style to conform with PEP8.
8179
81802011-05-30: olly
8181 [PHP] Fix handling of directors when -prefix is used.
8182
81832011-05-24: olly
8184 [PHP] Fix handling of methods of classes with a virtual base class (SF#3124665).
8185
William S Fultonc077d832011-05-21 22:33:36 +00008186Version 2.0.4 (21 May 2011)
8187===========================
Olly Betts14d5f8f2011-05-24 14:54:46 +00008188
William S Fultonc077d832011-05-21 22:33:36 +000081892011-05-19: wsfulton
8190 [Guile] Patch #3191625 fixing overloading of integer types.
8191
81922011-05-19: wsfulton
8193 [Perl] Patch #3260265 fixing overloading of non-primitive types and integers in
8194 Perl 5.12 and later.
8195
81962011-05-19: wsfulton
8197 [Ruby] Fix %import where one of the imported files %include one of the STL include
8198 files such as std_vector.i.
8199
82002011-05-17: wsfulton
8201 [Java] Apply #3289851 from Alan Harder to fix memory leak in directors when checking
8202 for pending exceptions.
8203
82042011-05-17: wsfulton
8205 [Tcl] Apply #3300072 from Christian Delbaere to fix multiple module loading not
8206 always sharing variables across modules.
8207
82082011-05-16: xavier98
8209 [octave] Fix an incompatibility with never versions of Octave. Case on Octave
8210 API >= 40 to handle rename of Octave_map to octave_map.
8211 [octave] Add support for y.__rop__(x) operators when x.__op__(y) doesn't exist.
8212 [octave] Allow global operators to be defined by SWIG-wrapped functions.
8213 [octave] Fix several bugs around module namespaces; add -global, -noglobal,
8214 -globals <name> command line options to the module.
8215
82162011-05-14: wsfulton
8217 %varargs when used with a numeric argument used to create an additional argument
8218 which was intended to provide a guaranteed sentinel value. This never worked and now
8219 the additional argument is not generated.
8220
82212011-05-13: wsfulton
8222 [python] Additional fixes for python3.2 support.
8223
82242011-05-07: szager
8225 [python] Fixed PyGetSetDescr for python3.2.
8226
82272011-05-05: wsfulton
8228 [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded
8229 method with incorrect arguments improved to show always show fully qualified name
8230 and if a const method.
8231
8232 Also fixed other Lua error messages in generated code which weren't consistently
8233 using the fully qualified C++ name - requested by Gedalia Pasternak.
8234
82352011-04-29: szager
8236 Bug 2635919: Convenience method to convert std::map to a python dict.
8237
82382011-04-29: szager
8239 [Python] Fixed bug 2811549: return non-const iterators from STL
8240 methods begin(), end(), rbegin(), rend().
8241
82422011-04-25: szager
8243 [Python] Fixed bug 1498929: Access to member fields in map elements
8244
82452011-04-23: klickverbot
8246 [D] nspace: Correctly generate identifiers for base classes when
8247 not in split proxy mode.
8248
82492011-04-13: szager
8250 Fixed bug 3286333: infinite recursion with mutual 'using namespace' clauses.
8251
82522011-04-12: szager
8253 Fixed bug 1163440: vararg typemaps.
8254
82552011-04-12: szager
8256 Fixed bug #3285386: parse error from 'operator T*&()'. Added operator_pointer_ref
8257 test case to demonstrate.
8258
82592011-04-11: szager
8260 [Python] Fixed PyVarObject_HEAD_INIT to eliminate VC++ compiler errors about
8261 static initialization of struct members with pointers.
8262
82632011-04-11: wsfulton
8264 [Tcl] Apply patch #3284326 from Colin McDonald to fix some compiler warnings.
8265
82662011-04-11: szager
8267 [Python] Fixed PyVarObject_HEAD_INIT to eliminate VC++ compiler errors about
8268 static initialization of struct members with pointers.
8269
82702011-04-10: klickverbot
8271 [D] Fixed wrapping of enums that are type char, for example:
8272 enum { X = 'X'; } (this was already in 2.0.3 for C# and Java)
8273
82742011-04-10: klickverbot
8275 [D] nspace: Fixed referencing types in the root namespace when
8276 not in split proxy mode.
8277
82782011-04-09: szager
8279 [Python] Applied patch #1932484: migrate PyCObject to PyCapsule.
8280
82812011-04-09: szager
8282 [Python] Added preprocessor guards for python functions PyUnicode_AsWideChar and
8283 PySlice_GetIndices, which changed signatures in python3.2.
8284
82852011-04-07: wsfulton
William S Fulton3dcc5012014-10-21 07:55:07 +01008286 Fix wrapping of const array typedefs which were generating uncompilable code as
William S Fultonc077d832011-05-21 22:33:36 +00008287 reported by Karl Wette.
8288
82892011-04-03: szager
8290 [Python] Fixed the behavior of %pythonnondynamic to conform to the spec in Lib/pyuserdir.swg.
8291
82922011-04-03: szager
8293 [Python] Merged in the szager-python-builtin branch, adding the -builtin feature
8294 for python. The -builtin option may provide a significant performance gain
8295 in python wrappers. For full details and limitations, refer to Doc/Manual/Python.html.
8296 A small test suite designed to demonstrate the performance gain is in
8297 Examples/python/performance.
8298
82992011-04-01: wsfulton
8300 Add in missing wrappers for friend functions for some target languages, mostly
8301 the non-scripting languages like Java and C#.
8302
William S Fulton52f26ff2011-03-29 23:01:55 +00008303Version 2.0.3 (29 March 2011)
8304=============================
8305
83062011-03-29: wsfulton
8307 [R] Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0
8308
83092011-03-29: wsfulton
8310 [Tcl] Apply patch #3248280 from Christian Delbaere which adds better error messages when
8311 the incorrect number or type of arguments are passed to overloaded methods.
8312
83132011-03-29: wsfulton
8314 [Tcl] Apply patch #3224663 from Christian Delbaere.
8315 1. Fix when function returns a NULL value, a "NULL" command will be created in the Tcl interpreter
8316 and calling this command will cause a segmentation fault.
8317
8318 2. Previous implementation searches for class methods using a linear search causing performance issues
8319 in wrappers for classes with many member functions. The patch adds a method hash table to classes and
8320 changes method name lookup to use the hash table instead of doing a linear search.
8321
83222011-03-26: wsfulton
8323 [C#, Java] SF bug #3195112 - fix wrapping of enums that are type char, for example:
8324 enum { X = 'X'; }
8325
83262011-03-21: vadz
8327 Allow setting PCRE_CFLAGS and PCRE_LIBS during configuration to override the values returned by
8328 pcre-config, e.g. to allow using a static version of PCRE library.
8329
83302011-03-17: wsfulton
8331 [UTL] Add missing headers in generated STL wrappers to fix compilation with gcc-4.6.
8332
83332011-03-17: wsfulton
8334 Fix regression introduced in swig-2.0.2 where filenames with spaces were not found
8335 when used with %include and %import. Reported by Shane Liesegang.
8336
83372011-03-15: wsfulton
8338 [UTL] Fix overloading when using const char[], problem reported by David Maxwell.
8339 Similarly for char[ANY] and const char[ANY].
8340
83412011-03-15: wsfulton
8342 [C#] Apply patch #3212624 fixing std::map Keys property.
8343
83442011-03-14: olly
8345 [PHP] Fix handling of overloaded methods/functions where some
8346 return void and others don't - whether this worked or not depended
8347 on the order they were encountered in (SF#3208299).
8348
83492011-03-13: klickverbot
8350 [D] Extended support for C++ namespaces (nspace feature).
8351
83522011-03-12: olly
8353 [PHP] Fix sharing of type information between multiple SWIG-wrapped
8354 modules (SF#3202463).
8355
83562011-03-09: wsfulton
8357 [Python] Fix SF #3194294 - corner case bug when 'NULL' is used as the default value
8358 for a primitive type parameter in a method declaration.
8359
83602011-03-07: olly
8361 [PHP] Don't use zend_error_noreturn() for cases where the function
8362 returns void - now this issue can only matter if you have a function
8363 or method which is directed and returns non-void.
8364
83652011-03-06: olly
8366 [PHP] Add casts to the typemaps for long long and unsigned long
8367 long to avoid issues when they are used with shorter types via
8368 %apply.
8369
83702011-03-02: wsfulton
8371 Templated smart pointers overloaded with both const and non const operator-> generated uncompilable
8372 code when the pointee was a class with either public member variables or static methods.
8373 Regression in 2.0.x reported as working in 1.3.40 by xantares on swig-user mailing list.
8374
William S Fultona2ac60e2011-02-20 21:48:32 +00008375Version 2.0.2 (20 February 2011)
8376================================
8377
83782011-02-19: wsfulton
8379 [PHP] Add missing INPUT, OUTPUT and INOUT typemaps in the typemaps.i library
8380 for primitive reference types as well as signed char * and bool *.
8381
83822011-02-19: olly
8383 [PHP] Address bug in PHP on some platforms/architectures which
8384 results in zend_error_noreturn() not being available using
8385 SWIG_ZEND_ERROR_NORETURN which defaults to zend_error_noreturn but
8386 can be overridden when building the module by passing
8387 -DSWIG_ZEND_ERROR_NORETURN=zend_error to the compiler. This may
8388 result in compiler warnings, but should at least allow a module
8389 to be built on those platforms/architectures (SF#3166423).
8390
83912011-02-18: wsfulton
8392 Fix #3184549 - vararg functions and function overloading when using the -fastdispatch option.
8393
83942011-02-18: olly
8395 [PHP] An overloaded method which can return an object or a
8396 primitive type no longer causes SWIG to segfault. Reported by Paul
8397 Colby in SF#3168531.
8398
83992011-02-18: olly
8400 [PHP] Fix invalid erase during iteration of std::map in generated
8401 director code. Reported by Cory Bennett in SF#3175820.
8402
84032011-02-17: wsfulton
8404 Preprocessing now warns if extra tokens appear after #else and #end.
8405
84062011-02-16: wsfulton
8407 Fix #1653092 Preprocessor does not error out when #elif is missing an expression.
8408 This and other cases of missing preprocessor expressions now result in an error.
8409
84102011-02-14: wsfulton
8411 [Ocaml] Apply patch #3151788 from Joel Reymont. Brings Ocaml support up to date
8412 (ver 3.11 and 3.12), including std::string.
8413
84142011-02-13: wsfulton
8415 [Ruby] Apply patch #3176274 from James Masters - typecheck typemap for time_t.
8416
84172011-02-13: wsfulton
8418 Apply patch #3171793 from szager - protected director methods failing when -fvirtual is used.
8419
84202011-02-13: wsfulton
8421 Fix #1927852 - #include directives don't preprocess the file passed to it. The fix is for
8422 #include with -importall or -includeall, %include and %import, for example:
8423 #define FILENAME "abc.h"
8424 %include FILENAME
8425
84262011-02-12: wsfulton
8427 Fix #1940536, overactive preprocessor which was expanding defined(...) outside of #if and #elif
8428 preprocessor directives.
8429
84302011-02-05: wsfulton
8431 [MzScheme] SF #2942899 Add user supplied documentation to help getting started with MzScheme.
8432 Update chapter name to MzScheme/Racket accounting for the rename of MzScheme to Racket.
8433
84342011-02-05: wsfulton
William S Fultonc6f8aad2015-08-02 20:13:40 +01008435 [C#] SF #3085906 - Possible fix running test-suite on Mac OS X.
William S Fultona2ac60e2011-02-20 21:48:32 +00008436
84372011-02-05: wsfulton
8438 SF #3173367 Better information during configure about Boost prerequisite for running
8439 the test-suite.
8440
84412011-02-05: wsfulton
8442 SF #3127633 Fix infinite loop in recursive typedef resolution.
8443
84442011-02-04: wsfulton
8445 [R] SF #3168676 Fix %rename not working for member variables and methods.
8446
84472011-02-04: wsfulton
8448 [clisp] SF #3148200 Fix segfault parsing nested unions.
8449
84502011-02-01: wsfulton
8451 [C#] Directors - a call to a method being defined in the base class, not
8452 overridden in a subclass, but again overridden in a class derived from
8453 the first subclass was not being dispatched correctly to the most derived class.
8454 See director_alternating.i for an example.
8455
84562011-02-01: wsfulton
8457 [C#, Java] Any 'using' statements in the protected section of a class were previously
8458 ignored with director protected (dirprot) mode.
8459
84602011-01-30: wsfulton
8461 Fix overloading with const pointer reference (SWIGTYPE *const&) parameters for a
8462 number of scripting languages.
8463
84642011-01-17: wsfulton
8465 New warning for smart pointers if only some of the classes in the inheritance
8466 chain are marked as smart pointer, eg, %shared_ptr should be used for all classes
8467 in an inheritance hierarchy, so this new warning highlights code where this is
8468 not the case.
8469
8470 example.i:12: Warning 520: Base class 'A' of 'B' is not similarly marked as a smart pointer.
8471 example.i:16: Warning 520: Derived class 'C' of 'B' is not similarly marked as a smart pointer.
8472
84732011-01-14: wsfulton
8474 Added some missing multi-argument typemaps: (char *STRING, size_t LENGTH) and
8475 (char *STRING, int LENGTH). Documentation for this updated. Java patch from
8476 Volker Grabsch.
8477
84782011-01-11: iant
8479 Require Go version 7077 or later.
8480
84812010-12-30: klickverbot
8482 [C#, D, Java] Check for collision of parameter names with target
8483 language keywords when generating the director glue code.
8484
8485 The situation in which the generated could would previously be
8486 invalid is illustrated in the new 'director_keywords' test case.
8487
84882010-12-23: wsfulton
8489 [C#] Fix $csinput special variable not being expanded for csvarin typemaps
8490 when used for global variables. Reported by Vadim Zeitlin.
8491
84922010-12-14: wsfulton
8493 Fix $basemangle expansion in array typemaps. For example if type is int *[3],
8494 $basemangle expands to _p_int.
8495
84962010-12-07: iant
8497 Check that we are using a sufficiently new version of the
8498 6g or 8g Go compiler during configure time. If not, disable Go.
8499 Minimum version is now 6707.
8500
8501 *** POTENTIAL INCOMPATIBILITY ***
8502
85032010-12-06: wsfulton
8504 Fix #3127394 - use of network paths on Windows/MSys.
8505
85062010-11-18: klickverbot
8507 [D] Added the D language module.
8508
85092010-11-12: vadz
8510 Fix handling of multiple regex-using %renames attached to the same
8511 declaration. For example, now
8512
Olly Betts227dd352014-08-12 14:33:25 +12008513 %rename("%(regex:/^Set(.*)/put\\1/)s") "";
8514 %rename("%(regex:/^Get(.*)/get\\1/)s") "";
William S Fultona2ac60e2011-02-20 21:48:32 +00008515
8516 works as expected whereas before only the last anonymous rename was
8517 taken into account.
8518
85192010-10-17: drjoe
8520 [R] Fix failure in overloaded functions which was breaking
8521 QuantLib-SWIG
8522
85232010-10-14: olly
8524 [PHP] Allow compilation on non-conforming Microsoft C++ compilers
8525 which don't accept: return function_returning_void();
8526 Reported by Frank Vanden Berghen on the SWIG mailing list.
8527
85282010-10-12: wsfulton
8529 Fix unary scope operator (::) (global scope) regression introduced in 2.0.0, reported by
8530 Ben Walker. The mangled symbol names were incorrect, sometimes resulting in types being
8531 incorrectly treated as opaque types.
8532
8533 Also fixes #2958781 and some other type problems due to better typedef resolution, eg
8534 std::vector<T *>::value_type didn't resolve to T * when it should have. The mangled type
8535 was incorrectly SWIGTYPE_std__vectorT_Test_p_std__allocatorT_Test_p_t_t__value_type and now
8536 it is correctly SWIGTYPE_p_Test.
8537
William S Fultona56ee9c2010-10-05 06:11:50 +00008538Version 2.0.1 (4 October 2010)
8539==============================
8540
85412010-10-03: wsfulton
8542 Apply patch #3066958 from Mikael Johansson to fix default smart pointer
8543 handling when the smart pointer contains both a const and non-const operator->.
8544
85452010-10-01: wsfulton
8546 Add -pcreversion option to display PCRE version information.
8547
85482010-10-01: olly
8549 [Ruby] Avoid segfault when a method node has no parentNode
8550 (SF#3034054).
8551
85522010-10-01: olly
8553 [Python] Allow reinitialisation to work with an embedded Python
8554 interpreter (patch from Jim Carroll in SF#3075178).
8555
85562010-09-28: wsfulton
8557 [C#] Apply patch from Tomas Dirvanauskas for std::map wrappers to avoid
8558 throwing exceptions with normal usage of iterators.
8559
85602010-09-27: olly
8561 [Python] Improve error message given when a parameter of the wrong
8562 type is passed to an overloaded method (SF#3027355).
8563
85642010-09-25: wsfulton
8565 Apply SF patch #3075150 - Java directors using static variables in
8566 named namespace.
8567
85682010-09-24: wsfulton
8569 More file and line error/warning reporting fixes where SWIG macros
8570 are used within {} braces (where the preprocessor expands macros),
8571 for example macros within %inline {...} and %fragment(...) {...}
8572 and nested structs.
8573
85742010-09-18: wsfulton
8575 More file and line error/warning reporting fixes for various inherited
8576 class problems.
8577
85782010-09-15: wsfulton
8579 A much improved debugging of SWIG source experience is now available and
8580 documented in the "Debugging SWIG" section in the Doc/Devel/internals.html
8581 file, including a swig.dbg support file for the gdb debugger.
8582
85832010-09-11: wsfulton
8584 Fix incorrect line number reporting in errors/warnings when a macro
8585 definition ends with '/' and it is not the end of a C comment.
8586
85872010-09-11: wsfulton
8588 Fix incorrect line number reporting in errors/warnings after parsing
8589 macro invocations with parameters given over more than one line.
8590
85912010-09-10: wsfulton
8592 Remove extraneous extra line in preprocessed output after including files
8593 which would sometimes lead to error/warning messages two lines after the
8594 end of the file.
8595
85962010-09-10: wsfulton
8597 Fix #2149523 - Incorrect line number reporting in errors after parsing macros
8598 containing C++ comments.
8599
86002010-09-08: olly
8601 [PHP] Fix handling of OUTPUT typemaps (Patch from Ryan in SF#3058394).
8602
86032010-09-03: wsfulton
8604 Fix erroneous line numbers in error messages for macro expansions, for example,
8605 the error message now points to instantiation of the macro, ie the last line here:
8606
8607 #define MACRO2(a, b)
8608
8609 #define MACRO1(NAME) MACRO2(NAME,2,3)
8610
8611 MACRO1(abc)
8612
86132010-09-02: wsfulton
8614 Fix line numbers in error and warning messages for preprocessor messages within
8615 %inline, for example:
8616
8617 %inline %{
8618 #define FOOBAR 1
8619 #define FOOBAR "hi"
8620 %}
8621
86222010-09-02: wsfulton
8623 Fix line numbers in error and warning messages which were cumulatively one
8624 less than they should have been after parsing each %include/%import - bug
8625 introduced in swig-1.3.32. Also fix line numbers in error and warning messages
8626 when new line characters appear between the %include / %import statement and
8627 the filename.
8628
86292010-08-30: wsfulton
8630 Fix line number and file name reporting for some macro preprocessor warnings.
8631 The line number of the macro argument has been corrected and the line number
8632 of the start of the macro instead of one past the end of the macro is used.
8633 Some examples:
8634 file.h:11: Error: Illegal macro argument name '..'
8635 file.h:19: Error: Macro 'DUPLICATE' redefined,
8636 file.h:15: Error: previous definition of 'DUPLICATE'.
8637 file.h:25: Error: Variable-length macro argument must be last parameter
8638 file.h:32: Error: Illegal character in macro argument name
8639 file.i:37: Error: Macro 'SIT' expects 2 arguments
8640
86412010-08-26: wsfulton
8642 Fix __LINE__ and __FILE__ expansion reported by Camille Gillot. Mostly this
8643 did not work at all. Also fixes SF #2822822.
8644
86452010-08-17: wsfulton
8646 [Perl] Fix corner case marshalling of doubles - errno was not being correctly
8647 set before calling strtod - patch from Justin Vallon - SF Bug #3038936.
8648
86492010-08-17: wsfulton
8650 Fix make distclean when some of the more obscure languages are detected by
8651 configure - fixes from Torsten Landschoff.
8652
86532010-07-28: wsfulton
8654 Restore configuring out of source for the test-suite since it broke in 1.3.37.
8655 As previously, if running 'make check-test-suite' out of source, it needs to be
8656 done by invoking configure with a relative path. Invoking configure with an
8657 absolute path will not work. Running the full 'make check' still needs to be
8658 done in the source tree.
8659
86602010-07-16: wsfulton
8661 Fix wrapping of function pointers and member function pointers when the function
8662 returns by reference.
8663
86642010-07-13: vadz
8665 Removed support for the old experimental "rxspencer" encoder and
8666 "[not]rxsmatch" in %rename (see the 01/16/2006 entry). The new and
8667 officially supported "regex" encoder and "[not]regexmatch" checks
8668 should be used instead (see the two previous entries). Please
8669 replace "%(rxspencer:[pat][subst])s" with "%(regex:/pat/subst/)s"
8670 when upgrading. Notice that you will also need to replace the back-
8671 references of form "@1" with the more standard "\\1" and may need to
8672 adjust your regular expressions syntax as the new regex encoder uses
8673 Perl-compatible syntax and not (extended) POSIX syntax as the old one.
8674
8675 *** POTENTIAL INCOMPATIBILITY ***
8676
86772010-07-13: vadz
8678 Add "regexmatch", "regextarget" and "notregexmatch" which can be
8679 used to apply %rename directives to the declarations matching the
8680 specified regular expression only. The first two can be used
8681 interchangeably, both of the %renames below do the same thing:
8682
8683 %rename("$ignore", regexmatch$name="Old$") "";
8684 %rename("$ignore", regextarget=1) "Old$";
8685
8686 (namely ignore the declarations having "Old" suffix).
8687
8688 "notregexmatch" restricts the match to only the declarations which
8689 do not match the regular expression, e.g. here is how to rename to
8690 lower case versions all declarations except those consisting from
8691 capital letters only:
8692
8693 %rename("$(lowercase)s", notregexmatch$name="^[A-Z]+$") "";
8694
86952010-07-13: vadz
8696 Add the new "regex" encoder that can be used in %rename, e.g.
8697
8698 %rename("regex:/(\\w+)_(.*)/\\2/") "";
8699
8700 to remove any alphabetical prefix from all identifiers. The syntax
8701 of the regular expressions is Perl-like and PCRE library
8702 (http://www.pcre.org/) is used to implement this feature but notice
8703 that backslashes need to be escaped as usual inside C strings.
8704
8705 Original patch from Torsten Landschoff.
8706
87072010-07-08: wsfulton
8708 Fix #3024875 - shared_ptr of classes with non-public destructors. This also fixes
8709 the "unref" feature when used on classes with non-public destructors.
8710
87112010-06-17: ianlancetaylor
8712 [Go] Add the Go language module.
8713
87142010-06-10: wsfulton
8715 [Lua] Fix SWIG_lua_isnilstring multiply defined when using multiple
8716 modules and wrapping strings. Patch from 'Number Cruncher'.
8717
87182010-06-10: olly
8719 [PHP] Fix directors to correctly call a method with has a
8720 different name in PHP to C++ (we were always using the C++ name
8721 in this case).
8722
87232010-06-03: wsfulton
William S Fulton3dcc5012014-10-21 07:55:07 +01008724 Fix uncompilable code when %rename results in two enum items
William S Fultona56ee9c2010-10-05 06:11:50 +00008725 with the same name. Reported by Vadim Zeitlin.
8726
William S Fulton293426b2010-06-03 06:34:15 +00008727Version 2.0.0 (2 June 2010)
8728===========================
8729
William S Fulton293426b2010-06-03 06:34:15 +000087302010-06-02: wsfulton
8731 [C#] Fix SWIG_STD_VECTOR_ENHANCED macro used in std::vector to work with
8732 types containing commas, for example:
8733
8734 SWIG_STD_VECTOR_ENHANCED(std::pair< double, std::string >)
8735
87362010-06-01: wsfulton
8737 Add in std_shared_ptr.i for wrapping std::shared_ptr. Requires the %shared_ptr
8738 macro like in the boost_shared_ptr.i library. std::tr1::shared_ptr can also be
8739 wrapped if the following macro is defined:
8740
8741 #define SWIG_SHARED_PTR_SUBNAMESPACE tr1
8742 %include <std_shared_ptr.i>
8743
8744 shared_ptr is also documented in Library.html now.
8745
87462010-05-27: wsfulton
8747 Add the ability for $typemap special variable macros to call other $typemap
8748 special variable macros, for example:
8749
8750 %typemap(cstype) CC "CC"
8751 %typemap(cstype) BB "$typemap(cstype, CC)"
8752 %typemap(cstype) AA "$typemap(cstype, BB)"
8753 void hah(AA aa);
8754
8755 This also fixes C# std::vector containers of shared_ptr and %shared_ptr.
8756
8757 Also added diagnostics for $typemap with -debug-tmsearch, for example, the
8758 above displays additional diagnostic lines starting "Containing: ":
8759
8760 example.i:34: Searching for a suitable 'cstype' typemap for: AA aa
8761 Looking for: AA aa
8762 Looking for: AA
8763 Using: %typemap(cstype) AA
8764 Containing: $typemap(cstype, BB)
8765 example.i:31: Searching for a suitable 'cstype' typemap for: BB
8766 Looking for: BB
8767 Using: %typemap(cstype) BB
8768 Containing: $typemap(cstype, CC)
8769 example.i:29: Searching for a suitable 'cstype' typemap for: CC
8770 Looking for: CC
8771 Using: %typemap(cstype) CC
8772
87732010-05-26: olly
8774 Fix %attribute2ref not to produce a syntax error if the last
8775 argument (AccessorMethod) is omitted. Patch from David Piepgras
8776 in SF#2235756.
8777
87782010-05-26: olly
8779 [PHP] When using %throws or %catches, SWIG-generated PHP5 wrappers
8780 now throw PHP Exception objects instead of giving a PHP error of
8781 type E_ERROR.
8782
8783 This change shouldn't cause incompatibility issues, since you can't
8784 set an error handler for E_ERROR, so previously PHP would just exit
8785 which also happens for unhandled exceptions. The benefit is you can
8786 now catch them if you want to.
8787
8788 Fixes SF#2545578 and SF#2955522.
8789
87902010-05-25: olly
8791 [PHP] Add missing directorin typemap for const std::string &.
8792 Fixes SF#3006404 reported by t-Legiaw.
8793
87942010-05-23: wsfulton
8795 [C#] Fix #2957375 - SWIGStringHelper and SWIGExceptionHelper not always being
8796 initialized before use in .NET 4 as the classes were not marked beforefieldinit.
8797 A static constructor has been added to the intermediary class like this:
8798
8799 %pragma(csharp) imclasscode=%{
8800 static $imclassname() {
8801 }
8802 %}
8803
8804 If you had added your own custom static constructor to the intermediary class in
8805 the same way as above, you will have to modify your approach to use static variable
8806 initialization or define SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR - See csharphead.swg.
8807
8808 *** POTENTIAL INCOMPATIBILITY ***
8809
88102010-05-23: wsfulton
8811 Fix #2408232. Improve shared_ptr and intrusive_ptr wrappers for classes in an
8812 inheritance hierarchy. No special treatment is needed for derived classes.
8813 The proxy class also no longer needs to be specified, it is automatically
8814 deduced. The following macros are deprecated:
8815 SWIG_SHARED_PTR(PROXYCLASS, TYPE)
8816 SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE)
8817 and have been replaced by
8818 %shared_ptr(TYPE)
8819 Similarly for intrusive_ptr wrappers, the following macro is deprecated:
8820 SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE)
8821 SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE)
8822 and have been replaced by
8823 %intrusive_ptr(TYPE)
8824
88252010-05-21: olly
8826 [PHP] Stop generating a bogus line of code in certain constructors.
8827 This was mostly harmless, but caused a PHP notice to be issued, if
8828 enabled (SF#2985684).
8829
88302010-05-18: wsfulton
8831 [Java] Fix member pointers on 64 bit platforms.
8832
88332010-05-14: wsfulton
8834 Fix wrapping of C++ enum boolean values reported by Torsten Landschoff:
8835 typedef enum { PLAY = true, STOP = false } play_state;
8836
88372010-05-14: olly
8838 [PHP] Fix wrapping of global variables which was producing
8839 uncompilable code in some cases.
8840
88412010-05-12: drjoe
8842 [R] Add two more changes from Wil Nolan. Get garbage
8843 collection to work. Implement newfree
8844
88452010-05-09: drjoe
8846 Fix bug reported by Wil Nolan change creation of string so
8847 that R 2.7.0+ can use char hashes
8848
88492010-05-07: wsfulton
8850 Apply patch #2955146 from Sergey Satskiy to fix expressions containing divide by
8851 operator in constructor initialization lists.
8852
88532010-05-05: wsfulton
8854 [R] Memory leak fix handling const std::string & inputs, reported by Will Nolan.
8855
88562010-05-01: wsfulton
8857 Typemap matching enhancement for non-default typemaps. Previously all
8858 qualifiers were stripped in one step, now they are stripped one at a time
8859 starting with the left most qualifier. For example, int const*const
8860 is first stripped to int *const then int *.
8861
8862 *** POTENTIAL INCOMPATIBILITY ***
8863
88642010-04-25: bhy
8865 [Python] Fix #2985655 - broken constructor renaming.
8866
88672010-04-14: wsfulton
8868 Typemap fragments are now official and documented in Typemaps.html.
8869
88702010-04-09: wsfulton
8871 [Ruby] Fix #2048064 and #2408020.
8872 Apply Ubuntu patch to fix Ruby and std::vector wrappers with -minherit.
8873 https://bugs.launchpad.net/ubuntu/+source/swig1.3/+bug/522874
8874
88752010-04-09: wsfulton
8876 [Mzscheme] Apply Ubuntu patch to fix std::map wrappers:
8877 https://bugs.launchpad.net/ubuntu/+source/swig1.3/+bug/203876
8878
88792010-04-09: wsfulton
8880 [Python] Apply patch #2952374 - fix directors and the -nortti option.
8881
88822010-04-09: wsfulton
8883 [Lua] Fix #2887254 and #2946032 - SWIG_Lua_typename using wrong stack index.
8884
88852010-04-03: wsfulton
8886 [Python] Fix exceptions being thrown with the -threads option based on patch from Arto Vuori.
8887 Fixes bug #2818499.
8888
88892010-04-03: wsfulton
8890 Fix Makefile targets: distclean and maintainer-clean
8891
88922010-04-02: wsfulton
8893 [Lua] Fix char pointers, wchar_t pointers and char arrays so that nil can be passed as a
8894 valid value. Bug reported by Gedalia Pasternak.
8895
88962010-04-01: wsfulton
8897 Numerous subtle typemap matching rule fixes when using the default type. The typemap
8898 matching rules are to take a type and find the best default typemap (SWIGTYPE, SWIGTYPE* etc),
8899 then look for the next best match by reducing the chosen default type. The type deduction
8900 now follows C++ class template partial specialization matching rules.
8901
8902 Below are the set of changes made showing the default type deduction
8903 along with the old reduced type and the new version of the reduced type:
8904
8905 SWIGTYPE const &[ANY]
8906 new: SWIGTYPE const &[]
8907 old: SWIGTYPE (&)[ANY]
8908
8909 SWIGTYPE *const [ANY]
8910 new: SWIGTYPE const [ANY]
8911 old: SWIGTYPE *[ANY]
8912
8913 SWIGTYPE const *const [ANY]
8914 new: SWIGTYPE *const [ANY]
8915 old: SWIGTYPE const *[ANY]
8916
8917 SWIGTYPE const *const &
8918 new: SWIGTYPE *const &
8919 old: SWIGTYPE const *&
8920
8921 SWIGTYPE *const *
8922 new: SWIGTYPE const *
8923 old: SWIGTYPE **
8924
8925 SWIGTYPE *const &
8926 new: SWIGTYPE const &
8927 old: SWIGTYPE *&
8928
8929 Additionally, a const SWIGTYPE lookup is used now for any constant type. Some examples, where
8930 T is some reduced type, eg int, struct Foo:
8931
8932 T const
8933 new: SWIGTYPE const
8934 old: SWIGTYPE
8935
8936 T *const
8937 new: SWIGTYPE *const
8938 old: SWIGTYPE *
8939
8940 T const[]
8941 new: SWIGTYPE const[]
8942 old: SWIGTYPE[]
8943
8944 enum T const
8945 new: enum SWIGTYPE const
8946 old: enum SWIGTYPE
8947
8948 T (*const )[]
8949 new: SWIGTYPE (*const )[]
8950 old: SWIGTYPE (*)[]
8951
8952 Reminder: the typemap matching rules can now be seen for any types being wrapped by using
8953 either the -debug-tmsearch or -debug-tmused options.
8954
8955 In practice this leads to some subtle matching rule changes and the majority of users
8956 won't notice any changes, except in the prime area of motivation for this change: Improve
8957 STL containers of const pointers and passing const pointers by reference. This is fixed
8958 because many of the STL containers use a type 'T const&' as parameters and when T is
8959 a const pointer, for example, 'K const*', then the full type is 'K const*const&'. This
8960 means that the 'SWIGTYPE *const&' typemaps now match when T is either a non-const or
8961 const pointer. Furthermore, some target languages incorrectly had 'SWIGTYPE *&' typemaps
8962 when these should have been 'SWIGTYPE *const&'. These have been corrected (Java, C#, Lua, PHP).
8963
8964 *** POTENTIAL INCOMPATIBILITY ***
8965
89662010-03-13: wsfulton
8967 [Java] Some very old deprecated pragma warnings are now errors.
8968
89692010-03-13: wsfulton
8970 Improve handling of file names and directories containing double/multiple path separators.
8971
89722010-03-10: mutandiz (Mikel Bancroft)
8973 [allegrocl] Use fully qualified symbol name of cl::identity in emit_defun().
8974
89752010-03-06: wsfulton
8976 [Java] The intermediary JNI class modifiers are now public by default meaning these
8977 intermediary low level functions are now accessible by default from outside any package
8978 used. The proxy class pointer constructor and getCPtr() methods are also now public.
8979 These are needed in order for the nspace option to work without any other mods.
8980 The previous default of protected access can be restored using:
8981
8982 SWIG_JAVABODY_METHODS(protected, protected, SWIGTYPE)
8983 %pragma(java) jniclassclassmodifiers = "class"
8984
89852010-03-06: wsfulton
8986 [C#] Added the nspace feature for C#. Documentation for the nspace feature is now available.
8987
89882010-03-04: wsfulton
8989 Added the nspace feature. This adds some improved namespace support. Currently only Java
8990 is supported for target languages, where C++ namespaces are automatically translated into
8991 Java packages. The feature only applies to classes,struct,unions and enums declared within
8992 a namespace. Methods and variables declared in namespaces still effectively have their
8993 namespaces flattened. Example usage:
8994
8995 %feature(nspace) Outer::Inner1::Color;
8996 %feature(nspace) Outer::Inner2::Color;
8997
8998 namespace Outer {
8999 namespace Inner1 {
9000 struct Color {
9001 ...
9002 };
9003 }
9004 namespace Inner2 {
9005 struct Color {
9006 ...
9007 };
9008 }
9009 }
9010
9011 For Java, the -package option is also required when using the nspace feature. Say
9012 we use -package com.myco, the two classes can then be accessed as follows from Java:
9013
9014 com.myco.Outer.Inner1.Color and com.myco.Outer.Inner2.Color.
9015
90162010-02-27: wsfulton
9017 [Python] Remove -dirvtable from the optimizations included by -O as it this option
9018 currently leads to memory leaks as reported by Johan Blake.
9019
90202010-02-27: wsfulton
9021 License code changes: SWIG Source is GPL-v3 and library code license is now clearer
Olly Betts631b41a2022-10-06 13:16:39 +13009022 and is provided under a very permissive license. See https://www.swig.org/legal.html.
William S Fulton293426b2010-06-03 06:34:15 +00009023
90242010-02-13: wsfulton
9025 [Ruby] A few fixes for compiling under ruby-1.9.x including patch from 'Nibble'.
9026
90272010-02-13: wsfulton
9028 [Ruby] Apply patch from Patrick Bennett to fix RARRAY_LEN and RARRAY_PTR usage for Ruby 1.9.x
9029 used in various STL wrappers.
9030
90312010-02-13: wsfulton
9032 [C#, Java] Fix incorrect multiply defined symbol name error when an enum item
9033 and class name have the same name, as reported by Nathan Krieger. Example:
9034
9035 class Vector {};
9036 namespace Text {
9037 enum Preference { Vector };
9038 }
9039
9040 This also fixes other incorrect corner case target language symbol name clashes.
9041
90422010-02-11: wsfulton
9043 Add the -debug-lsymbols option for displaying the target language layer symbols.
9044
90452010-02-09: wsfulton
9046 Fix -MM and -MMD options on Windows. They were not omitting files in the SWIG library as
9047 they should be.
9048
90492010-02-08: wsfulton
9050 Fix #1807329 - When Makefile dependencies are being generated using the -M family of options
9051 on Windows, the file paths have been corrected to use single backslashes rather than double
9052 backslashes as path separators.
9053
90542010-02-06: wsfulton
9055 Fix #2918902 - language specific files not being generated in correct directory on
9056 Windows when using forward slashes for -o, for example:
9057 swig -python -c++ -o subdirectory/theinterface_wrap.cpp subdirectory/theinterface.i
9058
90592010-02-05: wsfulton
9060 Fix #2894405 - assertion when using -xmlout.
9061
90622010-01-28: wsfulton
9063 Fix typemap matching bug when a templated type has a typemap both specialized and not
9064 specialized. For example:
9065
9066 template<typename T> struct XX { ... };
9067 %typemap(in) const XX & "..."
9068 %typemap(in) const XX< int > & "..."
9069
9070 resulted in the 2nd typemap being applied for all T in XX< T >.
9071
90722010-01-22: wsfulton
9073 Fix #2933129 - typemaps not being found when the unary scope operator (::) is used to denote
9074 global scope, the typemap is now used in situations like this:
9075
9076 struct X {};
9077 %typemap(in) const X & "..."
9078 void m(const ::X &);
9079
9080 and this:
9081
9082 struct X {};
9083 %typemap(in) const ::X & "..."
9084 void m(const X &);
9085
90862010-01-20: wsfulton
9087 Fix some unary scope operator (::) denoting global scope problems in the types generated
9088 into the C++ layer. Previously the unary scope operator was dropped in the generated code
9089 if the type had any sort of qualifier, for example when using pointers, references, like
9090 ::foo*, ::foo&, bar< ::foo* >.
9091
90922010-01-13: olly
9093 [PHP] Add datetime to the list of PHP predefined classes (patch
9094 from David Fletcher in SF#2931042).
9095
90962010-01-11: wsfulton
9097 Slight change to warning, error and diagnostic reporting. The warning number is no
9098 longer shown within brackets. This is to help default parsing of warning messages by
9099 other tools, vim on Unix in particular.
9100
9101 Example original display using -Fstandard:
9102 example.i:20: Warning(401): Nothing known about base class 'B'. Ignored.
9103 New display:
9104 example.i:20: Warning 401: Nothing known about base class 'B'. Ignored.
9105
9106 Also subtle fix to -Fmicrosoft format adding in missing space. Example original display:
9107 example.i(20): Warning(401): Nothing known about base class 'Base'. Ignored.
9108 New display:
9109 example.i(20) : Warning 401: Nothing known about base class 'Base'. Ignored.
9110
91112010-01-10: wsfulton
9112 Fix a few inconsistencies in reporting of file/line numberings including modifying
9113 the overload warnings 509, 512, 516, 474, 475 to now be two line warnings.
9114
91152010-01-10: wsfulton
9116 Modify -debug-tags output to use standard file name/line reporting so that editors
9117 can easily navigate to the appropriate lines.
9118 Was typically:
9119 . top . include . include (/usr/share/swig/temp/trunk/Lib/swig.swg:312)
9120 . top . include . include . include (/usr/share/swig/temp/trunk/Lib/swigwarnings.swg:39)
9121 now:
9122 /usr/share/swig/temp/trunk/Lib/swig.swg:312: . top . include . include
9123 /usr/share/swig/temp/trunk/Lib/swigwarnings.swg:39: . top . include . include . include
9124
91252010-01-03: wsfulton
9126 Fix missing file/line numbers for typemap warnings and in output from the
9127 -debug-tmsearch/-debug-tmused options.
9128
91292010-01-03: wsfulton
9130 Add typemaps used debugging option (-debug-tmused). When used each line displays
9131 the typemap used for each type for which code is being generated including the file
9132 and line number related to the type. This is effectively a condensed form of the
9133 -debug-tmsearch option. Documented in Typemaps.html.
9134
91352009-12-23: wsfulton
9136 Fix for %javaexception and directors so that all the appropriate throws clauses
9137 are generated. Problem reported by Peter Greenwood.
9138
91392009-12-20: wsfulton
9140 Add -debug-tmsearch option for debugging the typemap pattern matching rules.
9141 Documented in Typemaps.html.
9142
91432009-12-12: wsfulton
9144 [Octave] Remove the -api option and use the new OCTAVE_API_VERSION_NUMBER
9145 macro provided in the octave headers for determining the api version instead.
9146
91472009-12-04: olly
9148 [Ruby] Improve support for Ruby 1.9 under GCC. Addresses part of
9149 SF#2859614.
9150
91512009-12-04: olly
9152 Fix handling of modulo operator (%) in constant expressions
9153 (SF#2818562).
9154
91552009-12-04: olly
9156 [PHP] "empty" is a reserved word in PHP, so rename empty() method
9157 on STL classes to "is_empty()" (previously this was automatically
9158 renamed to "c_empty()").
9159 *** POTENTIAL INCOMPATIBILITY ***
9160
91612009-12-03: olly
9162 [PHP] Add typemaps for long long and unsigned long long, and for
9163 pointer to method.
9164
91652009-12-02: olly
9166 [PHP] Fix warning and rename of reserved class name to be case
9167 insensitive.
9168
91692009-12-01: wsfulton
9170 Revert support for %extend and memberin typemaps added in swig-1.3.39. The
9171 memberin typemaps are ignored again for member variables within a %extend block.
9172 Documentation inconsistency reported by Torsten Landschoff.
9173
91742009-11-29: wsfulton
9175 [Java, C#] Fix generated quoting when using %javaconst(1)/%csconst(1) for
9176 static const char member variables.
9177
9178 %javaconst(1) A;
9179 %csconst(1) A;
9180 struct X {
9181 static const char A = 'A';
9182 };
9183
91842009-11-26: wsfulton
9185 [Java, C#] Fix %javaconst(1)/%csconst(1) for static const member variables to
9186 use the actual constant value if it is specified, rather than the C++ code to
9187 access the member.
9188
9189 %javaconst(1) EN;
9190 %csconst(1) EN;
9191 struct X {
9192 static const int EN = 2;
9193 };
9194
91952009-11-23: wsfulton
9196 C++ nested typedef classes can now be handled too, for example:
9197 struct Outer {
9198 typedef Foo { } FooTypedef1, FooTypedef2;
9199 };
9200
92012009-11-18: wsfulton
9202 The wrappers for C nested structs are now generated in the same order as declared
9203 in the parsed code.
9204
92052009-11-18: wsfulton
9206 Fix #491476 - multiple declarations of nested structs, for example:
9207 struct Outer {
9208 struct {
9209 int val;
9210 } inner1, inner2, *inner3, inner4[1];
9211 } outer;
9212
92132009-11-17: wsfulton
9214 Fix parsing of enum declaration and initialization, for example:
9215
9216 enum ABC {
9217 a,
9218 b,
9219 c
9220 } A = a, *pC = &C, array[3] = {a, b, c};
9221
92222009-11-17: wsfulton
9223 Fix parsing of struct declaration and initialization, for example:
9224
9225 struct S {
9226 int x;
9227 } instance = { 10 };
9228
92292009-11-15: wsfulton
9230 Fix #1960977 - Syntax error parsing derived nested class declaration and member
9231 variable instance.
9232
92332009-11-14: wsfulton
9234 Fix #2310483 - function pointer typedef within extern "C" block.
9235
92362009-11-13: wsfulton
William S Fulton3dcc5012014-10-21 07:55:07 +01009237 Fix usage of nested template classes within templated classes so that compilable code
William S Fulton293426b2010-06-03 06:34:15 +00009238 is generated.
9239
92402009-11-13: olly
9241 [php] Fix place where class prefix (as specified with -prefix)
9242 wasn't being used. Patch from gverbruggen in SF#2892647.
9243
92442009-11-12: wsfulton
William S Fulton3dcc5012014-10-21 07:55:07 +01009245 Fix usage of nested template classes so that compilable code is generated - the nested
William S Fulton293426b2010-06-03 06:34:15 +00009246 template class is now treated like a normal nested classes, that is, as an opaque type
9247 unless the nestedworkaround feature is used.
9248
92492009-11-12: wsfulton
9250 Replace SWIGWARN_PARSE_NESTED_CLASS with SWIGWARN_PARSE_NAMED_NESTED_CLASS and
9251 SWIGWARN_PARSE_UNNAMED_NESTED_CLASS for named and unnamed nested classes respectively.
9252
9253 Named nested class ignored warnings can now be suppressed by name using %warnfilter, eg:
9254
9255 %warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) Outer::Inner;
9256
9257 but clearly unnamed nested classes cannot and the global suppression is still required, eg:
9258
9259 #pragma SWIG nowarn=SWIGWARN_PARSE_UNNAMED_NESTED_CLASS
9260
92612009-11-11: wsfulton
9262 Added the nestedworkaround feature as a way to use the full functionality of a nested class
9263 (C++ mode only). It removes the nested class from SWIG's type information so it is as if SWIG
9264 had never parsed the nested class. The documented nested class workarounds using a global
9265 fake class stopped working when SWIG treated the nested class as an opaque pointer, and
9266 this feature reverts this behaviour. The documentation has been updated with details of how
9267 to use and implement it, see the "Nested classes" section in SWIGPlus.html.
9268
92692009-11-11: wsfulton
9270 There were a number of C++ cases where nested classes/structs/unions were being handled
William S Fulton3dcc5012014-10-21 07:55:07 +01009271 as if C code was being parsed which would oftentimes lead to uncompilable code as an
William S Fulton293426b2010-06-03 06:34:15 +00009272 attempt was made to wrap the nested structs like it is documented for C code. Now all
9273 nested structs/classes/unions are ignored in C++ mode, as was always documented. However,
9274 there is an improvement as usage of nested structs/classes/unions is now always treated
9275 as an opaque type by default, resulting in generated code that should always compile.
9276
9277 *** POTENTIAL INCOMPATIBILITY ***
9278
92792009-11-09: drjoe
9280 Fix R for -fcompact and add std_map.i
9281
92822009-11-08: wsfulton
William S Fulton3dcc5012014-10-21 07:55:07 +01009283 Fix inconsistency for nested structs/unions/classes. Uncompilable code was being
William S Fulton293426b2010-06-03 06:34:15 +00009284 generated when inner struct and union declarations were used as types within the
9285 inner struct. The inner struct/union is now treated as a forward declaration making the
9286 behaviour the same as an inner class. (C++ code), eg:
9287
9288 struct Outer {
9289 struct InnerStruct { int x; };
9290 InnerStruct* getInnerStruct();
9291 };
9292
92932009-11-08: wsfulton
9294 Ignored nested class/struct warnings now display the name of the ignored class/struct.
9295
92962009-11-07: wsfulton
William S Fulton3dcc5012014-10-21 07:55:07 +01009297 Bug #1514681 - Fix nested template classes within a namespace generated uncompilable
William S Fulton293426b2010-06-03 06:34:15 +00009298 code and introduced strange side effects to other wrapper code especially code
9299 after the nested template class. Note that nested template classes are still ignored.
9300
93012009-11-07: wsfulton
9302 Add new debug options:
9303 -debug-symtabs - Display symbol tables information
9304 -debug-symbols - Display target language symbols in the symbol tables
9305 -debug-csymbols - Display C symbols in the symbol tables
9306
93072009-11-03: wsfulton
9308 Fix some usage of unary scope operator (::) denoting global scope, for example:
9309
9310 namespace AA { /* ... */ }
9311 using namespace ::AA;
9312
9313 and bug #1816802 - SwigValueWrapper should be used:
9314
9315 struct CC {
9316 CC(int); // no default constructor
9317 };
9318 ::CC x();
9319
9320 and in template parameter specializations:
9321
9322 struct S {};
Olly Bettse047d2e2014-11-05 10:17:22 +13009323 template <typename T> struct X { void a() {} };
9324 template <> struct X<S> { void b() {} };
William S Fulton293426b2010-06-03 06:34:15 +00009325 %template(MyTConcrete) X< ::S >;
9326
9327 plus probably some other corner case usage of ::.
9328
93292009-11-02: olly
9330 [Python] Fix potential memory leak in initialisation code for the
9331 generated module.
9332
93332009-10-23: wsfulton
9334 Fix seg fault when using a named nested template instantiation using %template(name)
9335 within a class. A warning that these are not supported is now issued plus processing
9336 continues as if no name was given.
9337
93382009-10-20: wsfulton
9339 [Python] Fix std::vector<const T*>. This would previously compile, but not run correctly.
9340
93412009-10-20: wsfulton
9342 Fixed previously fairly poor template partial specialization and explicit
9343 specialization support. Numerous bugs in this area have been fixed including:
9344
9345 - Template argument deduction implemented for template type arguments, eg this now
9346 works:
9347 template<typename T> class X {};
9348 template<typename T> class X<T *> {};
9349 %template(X1) X<const int *>; // Chooses T * specialization
9350
9351 and more complex cases with multiple parameters and a mix of template argument
9352 deduction and explicitly specialised parameters, eg:
9353 template <typename T1, typename T2> struct TwoParm { void a() {} };
9354 template <typename T1> struct TwoParm<T1 *, int *> { void e() {} };
9355 %template(E) TwoParm<int **, int *>;
9356
9357 Note that the primary template must now be in scope, like in C++, when
9358 an explicit or partial specialization is instantiated with %template.
9359
9360 *** POTENTIAL INCOMPATIBILITY ***
9361
93622009-09-14: wsfulton
9363 [C#] Add %csattributes for adding C# attributes to enum values, see docs for example.
9364
93652009-09-11: wsfulton
9366 Fix memmove regression in cdata.i as reported by Adriaan Renting.
9367
93682009-09-07: wsfulton
9369 Fix constant expressions containing <= or >=.
9370
93712009-09-02: wsfulton
9372 The following operators in constant expressions now result in type bool for C++
9373 wrappers and remain as type int for C wrappers, as per each standard:
9374
9375 && || == != < > <= >= (Actually the last 4 are still broken). For example:
9376
9377 #define A 10
9378 #define B 10
9379 #define A_EQ_B A == B // now wrapped as type bool for C++
9380 #define A_AND_B A && B // now wrapped as type bool for C++
9381
93822009-09-02: wsfulton
9383 Fix #2845746. true and false are now recognised keywords (only when wrapping C++).
9384 Constants such as the following are now wrapped (as type bool):
9385 #define FOO true
9386 #define BAR FOO && false
9387
William S Fulton9584c002009-08-19 00:23:38 +00009388Version 1.3.40 (18 August 2009)
William S Fulton48357202009-08-19 00:11:29 +00009389===============================
9390
93912009-08-17: olly
9392 [Perl] Add "#undef do_exec" to our clean up of Perl global
9393 namespace pollution.
9394
93952009-08-17: olly
9396 [PHP] Fix to wrap a resource returned by __get() in a PHP object (SF#2549217).
9397
93982009-08-17: wsfulton
9399 Fix #2797485 After doing a 'make clean', install fails if yodl2man or yodl2html
9400 is not available.
9401
94022009-08-16: wsfulton
9403 [Octave] Caught exceptions display the type of the C++ exception instead of the
9404 generic "c++-side threw an exception" message.
9405
94062009-08-16: wsfulton
9407 [Java] When %catches is used, fix so that any classes specified in the "throws"
9408 attribute of the "throws" typemap are generated into the Java method's throws clause.
9409
94102009-08-16: wsfulton
9411 [C#] Fix exception handling when %catches is used, reported by Juan Manuel Alvarez.
9412
94132009-08-15: wsfulton
9414 Fix %template seg fault on some cases of overloading the templated method.
9415 Bug reported by Jan Kupec.
9416
94172009-08-15: wsfulton
9418 [Ruby] Add numerous missing wrapped methods for std::vector<bool> specialization
9419 as reported by Youssef Jones.
9420
94212009-08-14: wsfulton
9422 [Perl] Add SWIG_ConvertPtrAndOwn() method into the runtime for smart pointer
9423 memory ownership control. shared_ptr support still to be added. Patch from
9424 David Fletcher.
9425
94262009-08-14: olly
9427 [PHP] PHP5 now wraps static member variables as documented.
9428
94292009-08-14: olly
9430 [PHP] Update the PHP "class" example to work with PHP5 and use
9431 modern wrapping features.
9432
94332009-08-13: wsfulton
9434 [PHP] std::vector wrappers overhaul. They no longer require the
9435 specialize_std_vector() macro. Added wrappers for capacity() and reserve().
9436
94372009-08-13: wsfulton
9438 [PHP] Add const reference typemaps. const reference primitive types are
9439 now passed by value rather than pointer like the other target languages.
9440 Fixes SF#2524029.
9441
94422009-08-08: wsfulton
9443 [Python] More user friendly AttributeError is raised when there are
9444 no constructors generated for the proxy class in the event that the
9445 class is abstract - the error message is now
9446 "No constructor defined - class is abstract" whereas if there are no
9447 public constructors for any other reason and the class is not abstract,
9448 the message remains
9449 "No constructor defined".
9450 [tcl] Similarly for tcl when using -itcl.
9451
94522009-08-04: olly
9453 [PHP] Fix generated code to work with PHP 5.3.
9454
94552009-08-04: vmiklos
9456 [PHP] Various mathematical functions (which would conflict
9457 with the built-in PHP ones) are now automatically handled by
9458 adding a 'c_' prefix.
9459
94602009-08-03: wsfulton
9461 [C#] The std::vector<T> implementation is improved and now uses $typemap such
9462 that the proxy class for T no longer has to be specified in some macros
9463 for correct C# compilation; the following macros are deprecated, where
9464 CSTYPE was the C# type for the C++ class CTYPE:
9465
9466 SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE)
9467 usage should be removed altogether
9468
9469 SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE)
9470 should be replaced with:
9471 SWIG_STD_VECTOR_ENHANCED(CTYPE)
9472
9473 Some more details in csharp/std_vector.i
9474
9475 *** POTENTIAL INCOMPATIBILITY ***
9476
94772009-07-31: olly
9478 [Python] Fix indentation so that we give a useful error if the
9479 module can't be loaded. Patch from Gaetan Lehmann in SF#2829853.
9480
94812009-07-29: wsfulton
9482 Add $typemap(method, typelist) special variable macro. This allows
9483 the contents of a typemap to be inserted within another typemap.
9484 Fully documented in Typemaps.html.
9485
94862009-07-29: vmiklos
9487 [PHP] Static member variables are now prefixed with the
9488 class name. This allows static member variables with the
9489 same name in different classes.
9490
94912009-07-29: olly
9492 [Python] Add missing locks to std::map wrappers. Patch from
9493 Paul Hampson in SF#2813836.
9494
94952009-07-29: olly
9496 [PHP] Fix memory leak in PHP OUTPUT typemaps. Reported by Hitoshi
9497 Amano in SF#2826322.
9498
94992009-07-29: olly
9500 [PHP] Fix memory leak in PHP resource destructor for classes
9501 without a destructor and non-class types. Patch from Hitoshi Amano
9502 in SF#2825303.
9503
95042009-07-28: olly
9505 [PHP] Update warnings about clashes between identifiers and PHP
9506 keywords and automatic renaming to work with the PHP5 class
9507 wrappers. Fixes SF#1613679.
9508
95092009-07-28: vmiklos
9510 [PHP] If a member function is not public but it has a base
9511 which is public, then now a warning is issued and the member
9512 function will be public, as PHP requires this.
9513
95142009-07-21: vmiklos
9515 [PHP] Director support added.
9516
95172009-07-15: olly
9518 [Perl] Don't specify Perl prototype "()" for a constructor with a
9519 different name to the class, as such constructors can still take
9520 parameters.
9521
95222009-07-12: xavier98
9523 [Octave] Add support for Octave 3.2 API
9524
95252009-07-05: olly
9526 [PHP] Update the list of PHP keywords - "cfunction" is no longer a
9527 keyword in PHP5 and PHP 5.3 added "goto", "namespace", "__DIR__",
9528 and "__NAMESPACE__".
9529
95302009-07-03: olly
9531 [Tcl] To complement USE_TCL_STUBS, add support for USE_TK_STUBS
9532 and SWIG_TCL_STUBS_VERSION. Document all three in the Tcl chapter
9533 of the manual. Based on patch from SF#2810380 by Christian
9534 Gollwitzer.
9535
95362009-07-02: vmiklos
9537 [PHP] Added factory.i for PHP, see the li_factory testcase
9538 for more info on how to use it.
9539
95402009-07-02: wsfulton
9541 Fix -Wallkw option as reported by Solomon Gibbs.
9542
95432009-07-02: wsfulton
9544 Fix syntax error when a nested struct contains a comment containing a * followed
9545 eventually by a /. Regression from 1.3.37, reported by Solomon Gibbs.
9546
95472009-07-01: vmiklos
9548 [PHP] Unknown properties are no longer ignored in proxy
9549 classes.
9550
95512009-07-01: vmiklos
9552 [PHP] Fixed %newobject behaviour, previously any method
9553 marked with %newobject was handled as a constructor.
9554
95552009-06-30: olly
9556 [Ruby] Undefine close and connect macros defined by Ruby API
9557 headers as we don't need them and they can clash with C++ methods
9558 being wrapped. Patch from Vit Ondruch in SF#2814430.
9559
95602009-06-26: olly
9561 [Ruby] Fix to handle FIXNUM values greater than MAXINT passed for a
9562 double parameter.
9563
95642009-06-24: wsfulton
9565 Fix wrapping methods with default arguments and the compactdefaultargs feature
9566 where a class is passed by value and is assigned a default value. The SwigValueWrapper
9567 template workaround for a missing default constructor is no longer used as the code
9568 generated does not call the default constructor.
9569
95702009-06-16: wsfulton
9571 [Java,C#] Fix enum marshalling when %ignore is used on one of the enum items.
9572 Incorrect enum values were being passed to the C++ layer or compilation errors resulted.
9573
95742009-06-02: talby
9575 [Perl] Resolved reference.i overload support problem
9576 identified by John Potowsky.
9577
95782009-05-26: wsfulton
9579 [C#] Improved std::map wrappers based on patch from Yuval Baror. The C# proxy
9580 now implements System.Collections.Generic.IDictionary<>.
9581
9582 These std:map wrappers have a non-backwards compatible overhaul to make them
9583 like a .NET IDictionary. Some method names have changed as following:
9584 set -> setitem (use this[] property now)
9585 get -> getitem (use this[] property now)
9586 has_key -> ContainsKey
9587 del -> Remove
9588 clear -> Clear
9589
9590 The following macros used for std::map wrappers are deprecated and will no longer work:
9591 specialize_std_map_on_key
9592 specialize_std_map_on_value
9593 specialize_std_map_on_both
9594
9595 *** POTENTIAL INCOMPATIBILITY ***
9596
95972009-05-20: vmiklos
9598 [PHP] Add the 'thisown' member to classes. The usage of it
9599 is the same as the Python thisown one: it's 1 by default and
9600 you can set it to 0 if you want to prevent freeing it. (For
9601 example to prevent a double free.)
9602
96032009-05-14: bhy
9604 [Python] Fix the wrong pointer value returned by SwigPyObject_repr().
9605
96062009-05-13: mutandiz (Mikel Bancroft)
9607 [allegrocl] Minor tweak when wrapping in -nocwrap mode.
9608
96092009-05-11: wsfulton
9610 [C#] Improved std::vector wrappers on the C# proxy side from Yuval Baror. These
9611 implement IList<> instead of IEnumerable<> where possible.
9612
96132009-04-29: wsfulton
9614 [Java, C#] Add the 'notderived' attribute to the javabase and csbase typemaps.
9615 When this attribute is set, the typemap will not apply to classes that are derived
9616 from a C++ base class, eg
9617 %typemap(csbase, notderived="1") SWIGTYPE "CommonBase"
9618
96192009-04-29: olly
9620 [Python] Don't attempt to acquire the GIL in situations where we
9621 know that it will already be locked. This avoids some dead-locks
9622 with mod_python (due to mod_python bugs which are apparently
9623 unlikely to ever be fixed), and results in smaller wrappers which
9624 run a little faster (in tests with Xapian on x86-64 Ubuntu 9.04,
9625 the stripped wrapper library was 11% smaller and ran 2.7% faster).
9626
96272009-04-21: wsfulton
9628 [C#] Fix #2753469 - bool &OUTPUT and bool *OUTPUT typemaps initialisation.
9629
96302009-04-09: wsfulton
9631 Fix #2746858 - C macro expression using floating point numbers
9632
96332009-03-30: olly
9634 [PHP] The default out typemap for char[ANY] now returns the string up to a
9635 zero byte, or the end of the array if there is no zero byte. This
9636 is the same as Python does, and seems more generally useful than
9637 the previous behaviour of returning the whole contents of the array
9638 including any zero bytes. If you want the old behaviour, you can provide
9639 your own typemap to do this:
9640
9641 %typemap(out) char [ANY]
9642 %{
9643 RETVAL_STRINGL($1, $1_dim0, 1);
9644 %}
9645
William S Fulton0c454e72009-03-21 01:45:41 +00009646Version 1.3.39 (21 March 2009)
9647==============================
9648
96492009-03-19: bhy
9650 [Python] Fix the memory leak related to Python 3 unicode and C char* conversion,
9651 which can be shown in the following example before this fix:
9652
9653 from li_cstring import *
9654 i=0
9655 while True:
9656 i += 1
9657 n = str(i)*10
9658 test3(n)
9659
9660 This fix affected SWIG_AsCharPtrAndSize() so you cannot call this function with
9661 a null alloc and non-null cptr argument in Python 3, otherwise a runtime error
9662 will be raised.
9663
96642009-03-18: wsfulton
9665 [C#] std::vector<T> wrapper improvements for .NET 2 and also providing the
9666 necessary machinery to use the std::vector<T> wrappers with more advanced features such
9667 as LINQ - the C# proxy class now derives from IEnumerable<>. The default is now to
9668 generate code requiring .NET 2 as a minimum, although the C# code can be compiled
9669 for .NET 1 by defining the SWIG_DOTNET_1 C# preprocessor constant. See the
9670 std_vector.i file for more details.
9671
9672 *** POTENTIAL INCOMPATIBILITY ***
9673
96742009-03-12: wsfulton
9675 [Ruby] Fix #2676738 SWIG generated symbol name clashes.
9676
96772009-03-01: bhy
9678 [Python] Some fixes for Python 3.0.1 and higher support. In 3.0.1, the C API function
9679 PyObject_Compare is removed, so PyObject_RichCompareBool is used for replacement.
9680 Struct initilization of SwigPyObject and SwigPyObject_as_number changed to reflect
9681 the drop of tp_compare and nb_long.
9682
96832009-03-01: bhy
9684 [Python] Fix SF#2583160. Now the importer in Python shadow wrapper take care of the
9685 case that module already imported at other place.
9686
96872009-02-28: bhy
9688 [Python] Fix SF#2637352. Move struct declaration of SWIG_module in pyinit.swg before
9689 the method calls, since some C compiler don't allow declaration in middle of function
9690 body.
9691
96922009-02-21: wsfulton
9693 [Allegrocl] Fix seg fault wrapping some constant variable (%constant) types.
9694
96952009-02-20: wsfulton
9696 [CFFI] Fix seg faults when for %extend and using statements.
9697
96982009-02-20: wsfulton
9699 Fix SF #2605955: -co option which broke in 1.3.37.
9700
97012009-02-20: wsfulton
9702 New %insert("begin") section added. Also can be used as %begin. This is a new
9703 code section reserved entirely for users and the code within the section is generated
9704 at the top of the C/C++ wrapper file and so provides a means to put custom code
9705 into the wrapper file before anything else that SWIG generates.
9706
97072009-02-17: wsfulton
9708 'make clean-test-suite' will now run clean on ALL languages. Previously it only
9709 ran the correctly configured languages. This way it is now possible to clean up
9710 properly after running 'make partialcheck-test-suite'.
9711
97122009-02-14: wsfulton
9713 Extend attribute library support for structs/classes and the accessor functions use
9714 pass/return by value semantics. Two new macros are available and usage is identical
9715 to %attribute. These are %attributeval for structs/classes and %attributestring for
9716 string classes, like std::string. See attribute.swg for more details.
9717
97182009-02-13: wsfulton
9719 Add support for %extend and memberin typemaps. Previously the memberin typemaps were
9720 ignored for member variables within a %extend block.
9721
97222009-02-12: wsfulton
9723 Remove unnecessary temporary variable when wrapping return values that are references.
9724 Example of generated code for wrapping:
9725
9726 struct XYZ {
9727 std::string& refReturn();
9728 };
9729
9730 used to be:
9731
9732 std::string *result = 0 ;
9733 ...
9734 {
9735 std::string &_result_ref = (arg1)->refReturn();
9736 result = (std::string *) &_result_ref;
9737 }
9738
9739 Now it is:
9740
9741 std::string *result = 0 ;
9742 ...
9743 result = (std::string *) &(arg1)->refReturn();
9744
97452009-02-08: bhy
9746 Change the SIZE mapped by %pybuffer_mutable_binary and %pybuffer_binary in pybuffer.i from
9747 the length of the buffer to the number of items in the buffer.
9748
97492009-02-08: wsfulton
9750 Fix %feature not working for conversion operators, reported by Matt Sprague, for example:
9751 %feature("cs:methodmodifiers") operator bool "protected";
9752
97532009-02-07: wsfulton
9754 [MzScheme] Apply #2081967 configure changes for examples to build with recent PLT versions.
9755 Also fixes Makefile errors building SWIG executable when mzscheme package is installed
9756 (version 3.72 approx and later).
9757
97582009-02-04: talby
9759 [Perl] Fix SF#2564192 reported by David Kolovratnk.
9760 SWIG_AsCharPtrAndSize() now handles "get" magic.
9761
William S Fulton648fa402009-02-01 00:31:19 +00009762Version 1.3.38 (31 January 2009)
9763================================
9764
Haoyu Bai359c4f72009-03-19 14:20:38 +000097652009-01-31: bhy
William S Fulton648fa402009-02-01 00:31:19 +00009766 [Python] Fix SF#2552488 reported by Gaetan Lehmann. Now %pythonprepend
9767 and %pythonappend have correct indentation.
9768
Haoyu Bai359c4f72009-03-19 14:20:38 +000097692009-01-31: bhy
William S Fulton648fa402009-02-01 00:31:19 +00009770 [Python] Fix SF#2552048 reported by Gaetan Lehmann. The parameter list
9771 of static member function in generated proxy code should not have the
9772 'self' parameter.
9773
Haoyu Bai359c4f72009-03-19 14:20:38 +000097742009-01-29: wsfulton
William S Fulton648fa402009-02-01 00:31:19 +00009775 Fix regression introduced in 1.3.37 where the default output directory
9776 for target language specific files (in the absence of -outdir) was no
9777 longer the same directory as the generated c/c++ file.
9778
Haoyu Bai359c4f72009-03-19 14:20:38 +000097792009-01-28: wsfulton
William S Fulton648fa402009-02-01 00:31:19 +00009780 [Java, C#] Fix proxy class not being used when the global scope operator
9781 was used for parameters passed by value. Reported by David Piepgrass.
9782
Haoyu Bai359c4f72009-03-19 14:20:38 +000097832009-01-15: wsfulton
William S Fulton648fa402009-02-01 00:31:19 +00009784 [Perl] Fix seg fault when running with -v option, reported by John Ky.
9785
William S Fultonf2c57bd2009-01-13 18:21:18 +00009786Version 1.3.37 (13 January 2009)
9787================================
9788
97892009-01-13: mgossage
9790 [Lua] Added contract support for requiring that unsigned numbers are >=0
9791 Rewrote much of Examples/Lua/embed3.
9792 Added a lot to the Lua documentation.
9793
97942009-01-13: wsfulton
9795 Fix compilation error when using directors on protected virtual overloaded
9796 methods reported by Sam Hendley.
9797
97982009-01-12: drjoe
9799 [R] Fixed handling of integer arrays
9800
98012009-01-10: drjoe
9802 [R] Fix integer handling in r to deal correctly with signed
9803 and unsigned issues
9804
98052009-01-10: wsfulton
9806 Patch #1992756 from Colin McDonald - %contract not working for classes
9807 in namespace
9808
98092009-01-05: olly
9810 Mark SWIGPERL5, SWIGPHP5, and SWIGTCL8 as deprecated in the source
9811 code and remove documentation of them.
9812
98132008-12-30: wsfulton
9814 Bug #2430756. All the languages now define a macro in the generated C/C++
9815 wrapper file indicating which language is being wrapped. The macro name is the
9816 same as those defined when SWIG is run, eg SWIGJAVA, SWIGOCTAVE, SWIGCSHARP etc
9817 and are listed in the "Conditional Compilation" section in the documentation.
9818
98192008-12-23: wsfulton
9820 [Java] Fix #2153773 - %nojavaexception was clearing the exception feature
9821 instead of disabling it. Clearing checked Java exceptions also didn't work.
9822 The new %clearjavaexception can be used for clearing the exception feature.
9823
98242008-12-22: wsfulton
9825 Fix #2432801 - Make SwigValueWrapper exception safe for when copy constructors
9826 throw exceptions.
9827
98282008-12-21: wsfulton
9829 Apply patch #2440046 which fixes possible seg faults for member and global
9830 variable char arrays when the strings are larger than the string array size.
9831
98322008-12-20: wsfulton
9833 The ccache compiler cache has been adapted to work with SWIG and
9834 named ccache-swig. It now works with C/C++ compilers as well as SWIG
9835 and can result in impressive speedups when used to recompile unchanged
9836 code with either a C/C++ compiler or SWIG. Documentation is in CCache.html
9837 or the installed ccache-swig man page.
9838
98392008-12-12: wsfulton
9840 Apply patch from Kalyanov Dmitry which fixes parsing of nested structs
9841 containing comments.
9842
98432008-12-12: wsfulton
9844 Fix error message in some nested struct and %inline parsing error situations
9845 such as unterminated strings and comments.
9846
98472008-12-07: olly
9848 [PHP] Fix warnings when compiling generated wrapper with GCC 4.3.
9849
98502008-12-06: wsfulton
9851 [PHP] Deprecate %pragma(php4). Please use %pragma(php) instead.
9852 The following two warnings have been renamed:
9853 WARN_PHP4_MULTIPLE_INHERITANCE -> WARN_PHP_MULTIPLE_INHERITANCE
9854 WARN_PHP4_UNKNOWN_PRAGMA -> WARN_PHP_UNKNOWN_PRAGMA
9855
9856 *** POTENTIAL INCOMPATIBILITY ***
9857
98582008-12-04: bhy
9859 [Python] Applied patch SF#2158938: all the SWIG symbol names started with Py
9860 are changed, since they are inappropriate and discouraged in Python
9861 documentation (from http://www.python.org/doc/2.5.2/api/includes.html):
9862
9863 "All user visible names defined by Python.h (except those defined by
9864 the included standard headers) have one of the prefixes "Py" or "_Py".
9865 Names beginning with "_Py" are for internal use by the Python implementation
9866 and should not be used by extension writers. Structure member names do
9867 not have a reserved prefix.
9868
9869 Important: user code should never define names that begin with "Py" or "_Py".
9870 This confuses the reader, and jeopardizes the portability of the user
9871 code to future Python versions, which may define additional names beginning
9872 with one of these prefixes."
9873
9874 Here is a brief list of what changed:
9875
9876 PySwig* -> SwigPy*
9877 PyObject_ptr -> SwigPtr_PyObject
9878 PyObject_var -> SwigVar_PyObject
9879 PySequence_Base, PySequence_Cont, PySequence_Ref ->
9880 SwigPySequence_Base, SwigPySequence_Cont, SwigPySequence_Ref
9881 PyMap* -> SwigPyMap*
9882
9883 We provided a pyname_compat.i for backward compatibility. Users whose code having
9884 these symbols and do not want to change it could simply include this file
9885 at front of your code. A better solution is to run the converting tool on
9886 your code, which has been put in SWIG's SVN trunk (Tools/pyname_patch.py) and
9887 you can download it here:
9888 https://swig.svn.sourceforge.net/svnroot/swig/trunk/Tools/pyname_patch.py
9889
9890 *** POTENTIAL INCOMPATIBILITY ***
9891
98922008-12-02: wsfulton
9893 [Python] Apply patch #2143727 from Serge Monkewitz to fix importing base classes
9894 when the package option is specified in %module and that module is %import'ed.
9895
98962008-11-28: wsfulton
9897 [UTL] Fix #2080497. Some incorrect acceptance of types in the STL, eg a double * element
9898 passed into a vector<int *> constructor would be accepted, but the ensuing behaviour
9899 was undefined. Now the type conversion correctly raises an exception.
9900
99012008-11-24: wsfulton
9902 Add -outcurrentdir option. This sets the default output directory to the current
9903 directory instead of the path specified by the input file. This option enables
9904 behaviour similar to c/c++ compilers. Note that this controls the output directory,
9905 but only in the absence of the -o and/or -outdir options.
9906
99072008-11-23: wsfulton
9908 [ruby] Apply patch #2263850 to fix ruby/file.i ... rubyio.h filename change in
9909 ruby 1.9.
9910
99112008-11-23: wsfulton
9912 Apply patch #2319790 from Johan Hake to fix shared_ptr usage in std::tr1 namespace.
9913
99142008-11-21: wsfulton
9915 The use of the include path to find the input file is now deprecated.
9916 This makes the behaviour of SWIG the same as C/C++ compilers in preparation
9917 for use with ccache.
9918
99192008-11-16: wsfulton
9920 Fix -nopreprocess option to:
9921 - correctly report file names in warning and error messages.
9922 - use the original input filename that created the preprocessed output when
9923 determining the C++ wrapper file name (in the absence of -o). Previously
9924 the name of the input file containing the preprocessed output was used.
9925
99262008-11-11: wsfulton
9927 [Java] Add patch #2152691 from MATSUURA Takanori which fixes compiles using the
9928 Intel compiler
9929
99302008-11-01: wsfulton
9931 Add patch #2128249 from Anatoly Techtonik which corrects the C/C++ proxy
9932 class being reported for Python docstrings when %rename is used.
9933
99342008-11-01: wsfulton
9935 Add the strip encoder patch from Anatoly Techtonik #2130016. This enables an
9936 easy way to rename symbols by stripping a commonly used prefix in all the
9937 function/struct names. It works in the same way as the other encoders, such as
9938 title, lower, command etc outlined in CHANGES file dated 12/30/2005. Example
9939 below will rename wxAnotherWidget to AnotherWidget and wxDoSomething to
9940 DoSomething:
9941
9942 %rename("%(strip:[wx])s") "";
9943
9944 struct wxAnotherWidget {
9945 void wxDoSomething();
9946 };
9947
99482008-09-26: mutandiz
9949 [allegrocl]
9950 Lots of test-suite work.
9951 - Fix ordering of wrapper output and %{ %} header output.
9952 - Fix declarations of local vars in C wrappers.
9953 - Fix declaration of defined constants in C wrappers.
9954 - Fix declaration of EnumValues in C wrappers.
9955 - add some const typemaps to allegrocl.swg
9956 - add rename for operator bool() overloads.
9957
99582008-09-25: olly
9959 [PHP5] Fill in typemaps for SWIGTYPE and void * (SF#2095186).
9960
99612008-09-22: mutandiz (Mikel Bancroft)
9962 [allegrocl]
9963 - Support wrapping of types whose definitions are not seen by
9964 SWIG. They are treated as forward-referenced classes and if a
9965 definition is not seen are treated as (* :void).
9966 - Don't wrap the contents of unnamed namespaces.
9967 - More code cleanup. Removed some extraneous warnings.
9968 - start work on having the allegrocl mod pass the cpp test-suite.
9969
99702008-09-19: olly
9971 [PHP5] Add typemaps for long long and unsigned long long.
9972
99732008-09-18: wsfulton
9974 [C#] Added C# array typemaps provided by Antti Karanta.
9975 The arrays provide a way to use MarshalAs(UnmanagedType.LPArray)
9976 and pinning the array using 'fixed'. See arrays_csharp.i library file
9977 for details.
9978
99792008-09-18: wsfulton
9980 Document the optional module attribute in the %import directive,
9981 see Modules.html. Add a warning for Python wrappers when the
9982 module name for an imported base class is missing, requiring the
9983 module attribute to be added to %import, eg
9984
9985 %import(module="FooModule") foo.h
9986
99872008-09-18: olly
9988 [PHP5] Change the default input typemap for char * to turn PHP
9989 Null into C NULL (previously it was converted to an empty string).
9990 The new behaviour is consistent with how the corresponding output
9991 typemap works (SF#2025719).
9992
9993 If you want to keep the old behaviour, add the following typemap
9994 to your interface file (PHP's convert_to_string_ex() function does
9995 the converting from PHP Null to an empty string):
9996
9997 %typemap(in) char * {
9998 convert_to_string_ex($input);
9999 $1 = Z_STRVAL_PP($input);
10000 }
10001
100022008-09-18: olly
10003 [PHP5] Fix extra code added to proxy class constructors in the case
10004 where the only constructor takes no arguments.
10005
100062008-09-18: olly
10007 [PHP5] Fix wrapping of a renamed enumerated value of an enum class
10008 member (SF#2095273).
10009
100102008-09-17: mutandiz (Mikel Bancroft)
10011 [allegrocl]
10012 - Fix how forward reference typedefs are handled, so as not to conflict
10013 with other legit typedefs.
10014 - Don't (for now) perform an ffitype typemap lookup when trying to
10015 when calling compose_foreign_type(). This is actually a useful thing
10016 to do in certain cases, the test cases for which I can't currently
10017 locate :/. It's breaking some wrapping behavior that is more commonly
10018 seen, however. I'll readd in a more appropriate way when I can
10019 recreate the needed test case, or a user complains (which means
10020 they probably have a test case).
10021 - document the -isolate command-line arg in the 'swig -help' output.
10022 It was in the html docs, but not there.
10023 - small amount of code cleanup, removed some unused code.
10024 - some minor aesthetic changes.
10025
100262008-09-12: bhy
10027 [Python] Python 3.0 support branch merged into SWIG trunk. Thanks to
10028 Google Summer of Code 2008 for supporting this project! By default
10029 SWIG will generate interface files compatible with both Python 2.x
10030 and 3.0. And there's also some Python 3 new features that can be
10031 enabled by passing a "-py3" command line option to SWIG. These
10032 features are:
10033
10034 - Function annotation support
10035 Also, the parameter list of proxy function will be generated,
10036 even without the "-py3" option. However, the parameter list
10037 will fallback to *args if the function (or method) is overloaded.
10038 - Buffer interface support
10039 - Abstract base class support
10040
10041 For details of Python 3 support and these features, please see the
10042 "Python 3 Support" section in the "SWIG and Python" chapter of the SWIG
10043 documentation.
10044
10045 The "-apply" command line option and support of generating codes
10046 using apply() is removed. Since this is only required by very old
10047 Python.
10048
10049 This merge also patched SWIG's parser to solve a bug. By this patch,
10050 SWIG features able to be correctly applied on C++ conversion operator,
10051 such like this:
10052
10053 %feature("shadow") *::operator bool %{ ... %}
10054
100552008-09-02: richardb
10056 [Python] Commit patch #2089149: Director exception handling mangles
10057 returned exception. Exceptions raised by Python code in directors
10058 are now passed through to the caller without change. Also, remove
10059 the ": " prefix which used to be added to other director exceptions
10060 (eg, those due to incorrect return types).
10061
100622008-09-02: wsfulton
10063 [Python] Commit patch #1988296 GCItem multiple module linking issue when using
10064 directors.
10065
100662008-09-02: wsfulton
10067 [C#] Support for 'using' and 'fixed' blocks in the 'csin' typemap is now
10068 possible through the use of the pre attribute and the new terminator attribute, eg
10069
10070 %typemap(csin,
10071 pre=" using (CDate temp$csinput = new CDate($csinput)) {",
10072 terminator=" } // terminate temp$csinput using block",
10073 ) const CDate &
10074 "$csclassname.getCPtr(temp$csinput)"
10075
10076 See CSharp.html for more info.
10077
100782008-09-01: wsfulton
10079 [CFFI] Commit patch #2079381 submitted by Boris Smilga - constant exprs put into
10080 no-eval context in DEFCENUM
10081
100822008-08-02: wuzzeb
10083 [Chicken,Allegro] Commit Patch 2019314
10084 Fixes a build error in chicken, and several build errors and other errors
10085 in Allegro CL
10086
100872008-07-19: wsfulton
William S Fultonc6f8aad2015-08-02 20:13:40 +010010088 Fix building of Tcl examples/test-suite on Mac OS X reported by Gideon Simpson.
William S Fultonf2c57bd2009-01-13 18:21:18 +000010089
100902008-07-17: wsfulton
10091 Fix SF #2019156 Configuring with --without-octave or --without-alllang
10092 did not disable octave.
10093
100942008-07-14: wsfulton
10095 [Java, C#] Fix director typemaps for pointers so that NULL pointers are correctly
10096 marshalled to C#/Java null in director methods.
10097
100982008-07-04: olly
10099 [PHP] For std_vector.i and std_map.i, rename empty() to is_empty()
10100 since "empty" is a PHP reserved word. Based on patch from Mark Klein
10101 in SF#1943417.
10102
101032008-07-04: olly
10104 [PHP] The deprecated command line option "-make" has been removed.
10105 Searches on Google codesearch suggest that nobody is using it now
10106 anyway.
10107
101082008-07-04: olly
10109 [PHP] The SWIG cdata.i library module is now supported.
10110
101112008-07-03: olly
10112 [PHP] The deprecated command line option "-phpfull" has been
10113 removed. We recommend building your extension as a dynamically
10114 loadable module.
10115
101162008-07-02: olly
10117 [PHP4] Support for PHP4 has been removed. The PHP developers are
10118 no longer making new PHP4 releases, and won't even be providing
10119 patches for critical security issues after 2008-08-08.
10120
101212008-07-02: olly
10122 [Python] Import the C extension differently for Python 2.6 and
10123 later so that an implicit relative import doesn't produce a
10124 deprecation warning for 2.6 and a failure for 2.7 and later.
10125 Patch from Richard Boulton in SF#2008229, plus follow-up patches
10126 from Richard and Haoyu Bai.
10127
William S Fultona49edfb2008-06-25 00:16:40 +000010128Version 1.3.36 (24 June 2008)
10129=============================
10130
1013106/24/2008: wsfulton
10132 Remove deprecated -c commandline option (runtime library generation).
10133
1013406/24/2008: olly
10135 [PHP] Fix assertion failure when handling %typemap(in,numinputs=0)
10136 (testcase ignore_parameter).
10137
1013806/24/2008: olly
10139 [PHP] Fix segfault when wrapping a non-class function marked with
10140 %newobject (testcase char_strings).
10141
1014206/22/2008: wsfulton
10143 [Java] Add a way to use AttachCurrentThreadAsDaemon instead of AttachCurrentThread
10144 in director code. Define the SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON macro, see
10145 Lib/java/director.swg.
10146
1014706/21/2008: wsfulton
10148 [Ruby] Fix crashing in the STL wrappers (reject! and delete_if methods)
10149
1015006/19/2008: wsfulton
10151 [Java, C#] C# and Java keywords will be renamed instead of just issuing a warning
William S Fulton3dcc5012014-10-21 07:55:07 +010010152 and then generating uncompilable code. Warning 314 gives the new name when a
William S Fultona49edfb2008-06-25 00:16:40 +000010153 keyword is found.
10154
1015506/19/2008: wsfulton
10156 [R] Keyword handling added. R Keywords will be renamed as necessary.
10157 Warning 314 gives the new name when a keyword is found.
10158
1015906/17/2008: mgossage
10160 [Lua] Added missing support for bool& and bool*. Added runtest for li_typemaps testcase.
10161 (Bug #1938142)
10162
1016306/07/2008: bhy
10164 Added test case keyword_rename, then made the keyword renaming works properly
10165 by fixing Swig_name_make() for a incomplete condition checking.
10166
1016706/02/2008: wsfulton
10168 [Java, C#] Fix enum wrappers when using -noproxy.
10169
1017005/30/2008: bhy
10171 Added std::wstring into Lib/typemaps/primtypes.swg, since it is also a primitive
10172 type in SWIG - fixed SF #1976978.
10173
1017405/29/2008: wsfulton
10175 [Java, C#] Fix variable wrappers when using -noproxy.
10176
1017705/29/2008: bhy
10178 [Python] Fixed a typo of %#ifdef in Lib/python/pycontainer.swg, which is related
10179 to -extranative SWIG option - SF #1971977.
10180
1018105/20/2008: wsfulton
10182 New partialcheck makefile targets for partial testing of the test-suite. These
10183 just invoke SWIG, ie no compilation and no runtime testing. It can be faster
10184 when developing by just doing a directory diff of the files SWIG generates
10185 against those from a previous run. Example usage from the top level directory:
10186
10187 make partialcheck-test-suite
10188 make partialcheck-java-test-suite
10189
10190 This change also encompasses more flexibility in running the test-suite, eg
10191 it is possible to prefix the command line which runs any target language test
10192 with a tool. See the RUNTOOL, COMPILETOOL and SWIGTOOL targets in the common.mk
10193 file and makefiles in the test-suite directory. For example it is possible to
10194 run the runtime tests through valgrind using:
10195
10196 make check RUNTOOL="valgrind --leak-check=full"
10197
10198 or invoke SWIG under valgrind using:
10199
10200 make check SWIGTOOL="valgrind --tool=memcheck"
10201
1020205/19/2008: drjoe
10203 [R] Fixed define that was breaking pre-2.7. Checked in
10204 patch from Soren Sonnenburg that creates strings in
10205 version independent way
10206
1020705/15/2008: wsfulton
10208 [Java] Fix variable name clash in directors - SF #1963316 reported by Tristan.
10209
1021005/14/2008: wsfulton
10211 Add an optimisation for functions that return objects by value, reducing
10212 the number of copies of the object that are made. Implemented using an
10213 optional attribute in the "out" typemap called "optimal". Details in
10214 Typemaps.html.
10215
1021605/11/2008: olly
10217 [PHP] Check for %feature("notabstract") when generating PHP5 class
10218 wrapper.
10219
1022005/11/2008: wsfulton
10221 Fix SF #1943608 - $self substitution in %contract, patch submitted by
10222 Toon Verstraelen.
10223
1022405/09/2008: olly
10225 [PHP] Fix char * typemaps to work when applied to signed char * and
10226 unsigned char * (uncovered by testcase apply_strings).
10227
1022805/09/2008: wsfulton
10229 Fix wrapping of char * member variables when using allprotected mode.
10230 Bug reported by Warren Wang.
10231
1023205/09/2008: olly
10233 [PHP] Fix bad PHP code generated when wrapping an enum in a
10234 namespace (uncovered by testcase arrays_scope).
10235
1023605/09/2008: olly
10237 [PHP] SWIG now runs the PHP testsuite using PHP5, not PHP4. PHP4
10238 is essentially obsolete now, so we care much more about solid PHP5
10239 support.
10240
1024105/07/2008: wsfulton
10242 STL fixes when using %import rather than %include and the Solaris Workshop
10243 compiler and the Roguewave STL.
10244
1024505/07/2008: wsfulton
10246 Fix wrapping of overloaded protected methods when using allprotected mode.
10247 Bug reported by Warren Wang.
10248
1024905/03/2008: wsfulton
10250 Commit patch #1956607 to add -MT support from Richard Boulton.
10251 This patch mirrors the gcc -MT option which allows one to change the default
10252 Makefile target being generated when generating makefiles with the -M family
10253 of options. For example:
10254
Olly Betts12708c92013-09-25 17:29:33 +120010255 $ swig -java -MM -MT overriddenname -c++ example.i
10256 overriddenname: \
William S Fultona49edfb2008-06-25 00:16:40 +000010257 example.i \
10258 example.h
10259
1026004/30/2008: mgossage
10261 [Lua] Removed generation of _wrap_delete_XXXXX (wrappered destructor)
10262 which was unused and causing warning with g++ -Wall.
10263 Removed other unused warning in typemaps.i and other places.
10264 Added Examples/lua/embed3, and run tests a few test cases.
10265
1026604/24/2008: olly
10267 [Python] Fix generated code for IBM's C++ compiler on AIX (patch
10268 from Goeran Uddeborg in SF#1928048).
10269
1027004/24/2008: olly
10271 Rename BSIZE in Examples/test-suite/arrays_scope.i to BBSIZE to
10272 avoid a clash with BSIZE defined by headers on AIX with Perl
10273 (reported in SF#1928048).
10274
1027504/20/2008: wsfulton
10276 Add the ability to wrap all protected members when using directors.
10277 Previously only the virtual methods were available to the target language.
10278 Now all protected members, (static and non-static variables, non-virtual methods
10279 and static methods) are wrapped when using the allprotected mode. The allprotected
10280 mode is turned on in the module declaration:
10281
10282 %module(directors="1", allprotected="1") modulename
10283
William S Fulton9976dc92008-04-20 20:41:01 +000010284Version 1.3.35 (7 April 2008)
10285=============================
10286
1028704/07/2008: wsfulton
10288 [Lua] Add missing pointer reference typemaps
10289
1029004/06/2008: wsfulton
10291 Fix stack overflow when using typemap warning suppression, eg
10292 %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK_MSG)
10293
1029404/05/2008: wsfulton
10295 [Python] Fix shared_ptr typemaps so that %pythonnondynamic can be used. Also corrects
10296 display of the proxy class type. Reported by Robert Lupton.
10297
1029804/04/2008: olly
10299 [Python] Add %newobject reference to python memory management subsection of manual
10300 (patch from mdbeachy in SF#1894610).
10301
1030203/27/2008: wsfulton
10303 [Python] Fix shared_ptr typemaps where the pointer type is a templated type with
10304 with more than one parameter. Reported by Robert Lupton.
10305
1030603/27/2008: mgossage
10307 [Lua] Added a typemap DISOWN for SWIGTYPE* and SWIGTYPE[], and support for %delobject feature.
10308 Added Examples/lua/owner which demonstrates the use of the memory management.
10309
1031003/26/2008: wsfulton
10311 [Java] Apply patch #1844301 from Monty Taylor to suppress enum constructor
10312 unused warnings.
10313
1031403/26/2008: wsfulton
10315 [Python] Apply patch #1924524 from Casey Raymondson which ensures the
10316 "No constructor defined" message is displayed when attempting to call a
10317 constructor on a class that doesn't have a constructor wrapper, eg if
10318 the C++ class is abstract.
10319
1032003/26/2008: wsfulton
10321 [Python] Apply patch #1925702 from Casey Raymondson which removes warning 512
10322 for std::vector wrappers.
10323
1032403/26/2008: olly
10325 [Python] Apply GCC 4.3 warnings patch from Philipp Thomas
10326 (SF#1925122).
10327
1032803/21/2008: wsfulton
10329 [Python] Thread safety patch for STL iterators from Abhinandan Jain.
10330
1033103/17/2008: mgossage
10332 [Lua] Added %luacode feature to add source code into wrappers.
10333 Updated documentation to document this.
10334 Added Examples/lua/arrays to show its use (and typemaps)
10335
1033603/17/2008: olly
10337 Fix nonportable sed usage which failed on Mac OS X (and probably
10338 other platforms). Fixes SF#1903612.
10339
1034003/17/2008: olly
10341 Fix memory leak in SWIG's parser (based on patch from Russell
Olly Betts00d07a72010-05-27 07:14:20 +000010342 Bryant in SF#1914023).
William S Fulton9976dc92008-04-20 20:41:01 +000010343
1034403/12/2008: wsfulton
10345 Fix bug #1878285 - unnecessary cast for C struct creation wrappers.
10346
1034703/12/2008: wsfulton
10348 [Python] Remove debugging info when using shared_ptr support
10349
1035003/06/2008: mgossage
10351 [Lua] Updated documentation for Lua exceptions.
10352 Added Examples/lua/exception and Examples/lua/embed2.
10353 Small updates to the typemaps.
10354
1035503/04/2008: wsfulton
10356 [Java, C#] Add char *& typemaps.
10357
1035803/04/2008: wsfulton
10359 Fix occasional seg fault when attempting to report overloaded methods as being ignored.
10360
1036102/29/2008: wsfulton
10362 [Perl] Fix #1904537 Swig causes a Perl warning "x used only once" in Perl 5.10
10363 reported by Ari Jolma
10364
1036502/29/2008: wsfulton
10366 [Python] Add shared_ptr varin/varout typemaps for wrapping global variables.
10367
1036802/25/2008: wsfulton
10369 Fix $wrapname to work in %exception (fixes some wrap:name assertions)
10370
William S Fulton63fb0432008-02-28 23:12:16 +000010371Version 1.3.34 (27 February 2008)
10372=================================
10373
1037402/13/2008: wsfulton
10375 [R] Fix wrapping of global function pointer variables.
10376
1037702/13/2008: wsfulton
10378 Add new special variables for use within %exception:
10379 $wrapname - language specific wrapper name
10380 $overname - if a method is overloaded this contains the extra mangling used on
10381 the overloaded method
10382 $decl - the fully qualified C/C++ declaration of the method being wrapped
10383 without the return type
10384 $fulldecl - the fully qualified C/C++ declaration of the method being wrapped
10385 including the return type
10386
1038702/12/2008: drjoe
10388 [R] Now setting S4 flag in SWIG created objects. This
10389 fixes R-SWIG for 2.6 and warning for 2.6 failure has been removed.
10390
1039102/11/2008: mgossage
10392 [Lua] Added a patch by Torsten Landschoff to fix the unary minus issue
10393 Ran 'astyle --style=kr -2' across lua.cxx to neaten it up
10394
1039502/10/2008: wsfulton
10396 Bump SWIG_RUNTIME_VERSION to 4. This is because of the recently introduced API
10397 change in the conversion functions, ie change in definition of swig_converter_func.
10398 Anyone calling SWIG_TypeCast must pass in a valid value for the new additional
10399 (third) parameter and then handle the newly created memory if the returned value
10400 is set to SWIG_CAST_NEW_MEMORY else a memory leak will ensue.
10401
1040202/09/2008: wsfulton
10403 [Python] Experimental shared_ptr typemaps added. Usage is the same as the recently
10404 added Java and C# shared_ptr typemaps. Two macros are available, although these
10405 may well change in a future version:
10406
10407 For base classes or classes not in an inheritance chain:
10408 SWIG_SHARED_PTR(PROXYCLASS, TYPE)
10409 For derived classes:
10410 SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE)
10411
10412 The PROXYCLASS is the name of the proxy class, but is only required for Java/C#.
10413 Example usage:
10414
10415 %include "boost_shared_ptr.i"
10416
10417 SWIG_SHARED_PTR(Klass, Space::Klass)
10418 SWIG_SHARED_PTR_DERIVED(KlassDerived, Space::Klass, Space::KlassDerived)
10419
10420 namespace Space {
10421 struct Klass { ... };
10422 struct KlassDerived : Klass { ... };
10423 }
10424
10425 Further details to follow in future documentation, but the following features
10426 should be noted:
10427
10428 - Not restricted to boost::shared_ptr, eg std::tr1::shared_ptr can also be used.
10429 - Available typemap groups:
10430 (a) Typemaps for shared_ptr passed by value, reference, pointer and pointer
10431 reference.
10432 - (b) Typemaps for passing by raw value, raw pointer, raw reference, raw pointer
10433 reference.
10434 - The code being wrapped does not even have to use shared_ptr, SWIG can use
10435 shared_ptr as the underlying storage mechanism instead of a raw pointer due to
10436 the typemaps in group (b) above.
10437 - No array support as shared_ptr does not support arrays.
10438 - This works quite differently to the usual SWIG smart pointer support when
10439 operator-> is parsed by SWIG:
10440 - An additional smart pointer class is not generated reducing code bloat in
10441 the wrappers.
10442 - Using smart pointers and raw pointers can be mixed seamlessly.
10443 - Missing constructors for the smart pointers is no longer a problem and so
10444 separate factory type functions do not have to be written and wrapped.
10445 - The implicit C++ shared_ptr< derived class > to shared_ptr< base class >
10446 cast also works in the target language. This negates the necessity to write
10447 an explicit helper cast function providing the upcast which would need
10448 calling prior to passing a derived class to a method taking a shared_ptr to
10449 a base class.
10450
1045102/09/2008: wsfulton
10452 [Python] Add support for overriding the class registration function via a new
10453 "smartptr" feature. This is a very low level of customisation most users
10454 would never need to know. The feature will typically be used for intrusive
10455 smart pointers along with additional typemaps. Example usage of the feature:
10456
10457 %feature("smartptr", noblock=1) Foo { boost::shared_ptr< Foo > }
10458 class Foo {};
10459
10460 The generated Foo_swigregister function will then register boost::shared < Foo >
10461 (SWIGTYPE_p_boost__shared_ptrTFoo_t instead of SWIGTYPE_p_Foo) as the underlying
10462 type for instantiations of Foo.
10463
1046402/09/2008: wsfulton
10465 Features now supports the optional 'noblock' attribute for all usage of %feature.
10466 When specified, the { } braces are removed from the feature code. This is identical
10467 in behaviour to usage of 'noblock' in typemaps and is used when the preprocessor
10468 is required to operate on the code in the feature and the enclosing { } braces
10469 are not required. Example:
10470
10471 #define FOO foo
10472 %feature("smartptr", noblock="1") { FOO::bar }
10473
10474 The preprocessor then reduces this as if this had been used instead:
10475
10476 %feature("smartptr") "foo::bar"
10477
1047802/01/2008: olly
10479 [Python] Fix format string bug (SF#1882220).
10480
1048101/31/2008: wsfulton
10482 Additions to the %types directive. Now the conversion / casting code can be
10483 overridden to some custom code in the %types directive, like so:
10484
10485 %types(fromtype = totype) %{
10486 ... code to convert fromtype to totype and return ...
10487 %}
10488
10489 The special variable $from will be replaced by the name of the parameter of the
10490 type being converted from. The code must return the totype cast to void *. Example:
10491
10492 class Time;
10493 class Date;
10494 Date &Time::dateFromTime();
10495
10496 %types(Time = Date) %{
10497 Time *t = (Time *)$from;
10498 Date &d = t->dateFromTime();
10499 return (void *) &d;
10500 %}
10501
10502 resulting in the conversion / casting code looking something like:
10503
10504 static void *_p_TimeTo_p_Date(void *x) {
10505 Time *t = (Time *)x;
10506 Date &d = t->dateFromTime();
10507 return (void *) &d;
10508 }
10509
10510 This is advanced usage, please use only if you understand the runtime type system.
10511
1051201/30/2008: mgossage
10513 Small update to documentation in Typemaps.html, to warn about use of local
10514 variables in typemaps for multiple types.
10515
1051601/25/2008: wsfulton
10517 [Java] Fix bug reported by Kevin Mills in ARRAYSOFCLASSES typemaps where any
10518 changes made to an array element passed from Java to C are not reflected back
10519 into Java.
10520
1052101/24/2008: mgossage
10522 More updates to the configure script for detecting lua.
10523 Also looks in /usr/include/lua*
10524 Also changed typemaps.i not to check for NULL before freeing a pointer
10525
1052601/21/2008: wsfulton
10527 [Python] For STL containers, SWIG no longer attempts to convert from one
10528 STL container to another, eg from std::vector<int> to std::vector<double>
10529 or std::list<int> to std::vector<int> or even std::vector<Foo> to
10530 std::vector<Bar> as it previously did. In fact SWIG no longer attempts to
10531 convert any SWIG wrapped C++ proxy class that is also a Python sequence,
10532 whereas previously it would. Any non-SWIG Python sequence will still be
10533 accepted wherever an STL container is accepted. Overloaded methods using
10534 containers should be faster.
10535
1053601/18/2008: wsfulton
10537 [C#] Add 'directorinattributes' and 'directoroutattributes' typemap attributes
10538 for the imtype typemap. These should contain C# attributes which will
10539 be generated into the C# director delegate methods.
10540
1054101/18/2008: olly
10542 Fix handling of byte value 255 in input files on platforms where
10543 char is signed (it was getting mapped to EOF). Fixes SF#1518219.
10544
1054501/16/2008: wsfulton
10546 Fix template member variables wrapped by a smart pointer. Bug reported
10547 by Robert Lupton.
10548
1054901/14/2008: mgossage
10550 Substantial changes to configure script for detecting lua.
10551 Code can now link to liblua.a, liblua50.a or liblua51.a
10552 It's also a lot neater now.
10553
1055412/16/2007: wsfulton
10555 [Perl] Backed out #1798728 - numbers can be passed to functions taking char *
10556
1055712/16/2007: wsfulton
10558 Fix #1832613 - Templates and some typedefs involving pointers or function pointers
10559
1056012/12/2007: wsfulton
10561 [Java] Fix #1632625 - Compilation errors on Visual C++ 6 when using directors.
10562
1056312/12/2007: wsfulton
10564 [Perl] Fix #1798728 - numbers can be passed to functions taking char *.
10565
1056612/12/2007: wsfulton
10567 Fix #1819847 %template with just one default template parameter
10568
10569 template<typename T = int> class Foo {...};
10570 %template(FooDefault) Foo<>;
10571
1057212/12/2007: mgossage
10573 [Lua] Small correction on Lua.html
10574
1057512/09/2007: wsfulton
10576 Apply patch #1838248 from Monty Taylor for vpath builds of SWIG.
10577
1057812/08/2007: wsfulton
10579 [Lua] Fixes to remove gcc-4.2 warnings
10580
1058112/06/2007: wsfulton
10582 Fix #1734415 - template template parameters with default arguments such as:
10583
10584 template<typename t_item, template<typename> class t_alloc = pfc::alloc_fast >
10585 class list_t : public list_impl_t<t_item,pfc::array_t<t_item,t_alloc> > { ... };
10586
1058712/04/2007: mgossage
10588 [lua] Fix a bug in the class hierachy code, where the methods were not propagated,
10589 if the name ordering was in a certain order.
10590 Added new example programs (dual, embed) and runtime tests for test-suite.
10591
1059211/30/2007: wsfulton
10593 Fix using statements using a base class method where the methods were overloaded.
10594 Depending on the order of the using statements and method declarations, these
William S Fulton3dcc5012014-10-21 07:55:07 +010010595 were previously generating uncompilable wrappers, eg:
William S Fulton63fb0432008-02-28 23:12:16 +000010596
10597 struct Derived : Base {
10598 virtual void funk();
10599 using Base::funk;
10600 };
10601
William S Fultonefad1012007-11-23 22:31:25 +000010602Version 1.3.33 (November 23, 2007)
Olly Bettsfdcea432009-02-26 05:53:37 +000010603==================================
William S Fultonefad1012007-11-23 22:31:25 +000010604
1060511/21/2007: mikel
10606 [allegrocl] omit private slot type info in the classes/types
10607 defined on the lisp side. Fix bug in mapping of C/++ types
10608 to lisp types. Fix typo in modules generated defpackage form.
10609 Have std::string *'s automatically marshalled between foreign
10610 and lisp strings.
10611
1061211/20/2007: olly
10613 [Python] Fill in Python Dictionary functions list (patch from
10614 Jelmer Vernooij posted to swig-devel).
10615
1061611/20/2007: beazley
10617 Fixed a bug in the C scanner related to backslash characters.
10618
1061911/19/2007: wsfulton
10620 [Perl] Fix broken compilation of C++ wrappers on some compilers.
10621
1062211/16/2007: olly
10623 [Python] Don't pass Py_ssize_t for a %d printf-like format as
10624 that's undefined behaviour when sizeof(Py_ssize_t) != sizeof(int).
10625
Olly Bettsbe550092007-11-16 16:01:17 +000010626Version 1.3.32 (November 15, 2007)
10627==================================
10628
1062911/14/2007: wsfulton
10630 [R] Package name and dll name is now the same as the SWIG module
10631 name. It used to be the module name with _wrap as a suffix. The package
10632 and dll names can be modified using the -package and -dll commandline
10633 options.
10634
10635 *** POTENTIAL INCOMPATIBILITY ***
10636
1063711/11/2007: wsfulton
10638 [R] Add support for Windows (Visual C++ 8 tested)
10639
1064011/10/2007: olly
10641 [php] Fix makefile generated by -make (SF#1633679). Update
10642 documentation to mark "-make" as deprecated (none of the other
10643 SWIG backends seem to offer such a feature, it can't realistically
10644 generate a fully portable makefile, and the commands to build an
10645 extension are easy enough to write for the user's preferred build
10646 tool). Also recommend against the use of "-phpfull" (it's only
10647 really useful when static linking, and a dynamically loadable
10648 module is virtually always the better approach).
10649
1065011/09/2007: olly
10651 Fix --help output to note that `export SWIG_FEATURES' is required.
10652
1065310/29/2007: wsfulton
10654 [R] Fix seg fault on Windows
10655 [R] Examples R scripts are now platform independent
10656
1065710/30/2007: mgossage
10658 [lua] fixed bug in template classes which cases template_default2
10659 and template_specialization_defarg to fail.
10660 Added several warning filters into the overload's test cases.
10661 Added runtime tests for several codes.
10662 You can now make check-lua-test-suite with no errors and only a few warnings.
10663
1066410/30/2007: olly
10665 [guile] Fix the configure test to put GUILELINK in LIBS not LDFLAGS
10666 (SF#1822430).
10667
1066810/30/2007: olly
10669 [guile] Fix the guile examples on 64-bit platforms.
10670
1067110/29/2007: wsfulton
10672 [C#] Fix member pointers on 64 bit platforms.
10673
1067410/28/2007: olly
10675 [lua] Fix swig_lua_class instances to be static to allow multiple
10676 SWIG wrappers to be compiled into the same executable statically.
10677 Patch from Andreas Fredriksson (posted to the swig mailing list).
10678
1067910/28/2007: olly
10680 [lua] Fix Examples/lua to pass SRCS for C tests rather than CXXSRCS.
10681 The code as it was happened to work on x86, but broke on x86_64 (and
10682 probably any other platforms which require -fPIC).
10683
1068410/28/2007: wsfulton
10685 [Java, C#] New approach for fixing uninitialised variable usage on error in director
10686 methods using the new templated initialisation function SwigValueInit().
10687
1068810/28/2007: wsfulton
10689 [Perl] Use more efficient SvPV_nolen(x) instead of SvPV(x,PL_na) if SvPV_nolen is
10690 supported.
10691
1069210/26/2007: wuzzeb
10693 [Chicken] Fix global variables of class member function pointers.
10694 Other minor fixes, so all tests in the chicken test suite now pass
10695
1069610/25/2007: olly
10697 Fix UTL typecheck macro for a function taking char[] or const
10698 char[] (SF#1820132).
10699
1070010/22/2007: mkoeppe
10701 [Guile] Filter out -ansi -pedantic from CFLAGS while compiling test programs for Guile
10702 in configure. This enables running the test suite for Guile if it is installed and
10703 usable.
10704
1070510/22/2007: mkoeppe
10706 [Guile -scm] Fix testcases apply_signed_char and apply_strings
10707 by adding explicit casts to the appropriate $ltype.
10708
1070910/22/2007: wsfulton
10710 [Java, C#] Fix uninitialised variable usage on error in director methods.
10711
1071210/19/2007: wsfulton
10713 [Java, C#] Bug #1794247 - fix generated code for derived classes when csbase or javabase
10714 typemaps are used with the replace="1" attribute.
10715
1071610/19/2007: wsfulton
10717 [Python] Docs updated to suggest using distutils. Patch #1796681 from Christopher Barker.
10718
1071910/19/2007: olly
10720 [perl5] Clear errno before calls to strtol(), strtoul(), strtoll()
10721 and strtoull() which we check errno after to avoid seeing a junk
10722 value of errno if there isn't an error in the call.
10723
1072410/16/2007: wsfulton
10725 Deprecate %attribute_ref and replace with %attributeref. There is just an argument
10726 order change in order to maintain consistency with %attribute, from:
10727
10728 %attribute_ref(Class, AttributeType, AccessorMethod, AttributeName)
10729 to
10730 %attributeref(Class, AttributeType, AttributeName, AccessorMethod)
10731
1073210/16/2007: olly
Olly Bettsd3151872015-01-08 14:15:46 +130010733 [Tcl] Fix several occurrences of "warning: deprecated conversion
Olly Bettsbe550092007-11-16 16:01:17 +000010734 from string constant to 'char*'" from GCC 4.2 in generated C/C++
10735 code.
10736
1073710/16/2007: olly
10738 [PHP] Fix many occurrences of "warning: deprecated conversion from
10739 string constant to 'char*'" from GCC 4.2 in generated C/C++ code
10740 when compiling with a new enough version of PHP 5 (tested with
10741 PHP 5.2.3, but PHP 5.2.1 is probably the minimum requirement).
10742
1074310/15/2007: wsfulton
10744 Patch #1797133 from David Piepgrass fixes %attribute when the getter has the same name
10745 as the attribute name and no longer generate non-functional setter for read-only attributes.
10746
1074710/15/2007: olly
10748 [Tcl] Prevent SWIG_Tcl_ConvertPtr from calling the unknown proc.
10749 Add Examples/tcl/std_vector/ which this change fixes. Patch
10750 is from "Cliff C" in SF#1809819.
10751
1075210/12/2007: wsfulton
10753 [Java] Add DetachCurrentThread back in for directors. See entry dated 08/11/2006 and
10754 search for DetachCurrentThread on the mailing lists for details. The crashes on Solaris
10755 seem to be only present in jdk-1.4.2 and lower (jdk-1.5.0 and jdk-1.6.0 are okay), so
10756 anyone using directors should use a recent jdk on Solaris, or define (see director.swg)
10757 SWIG_JAVA_NO_DETACH_CURRENT_THREAD to the C++ compiler to get old behaviour.
10758
1075910/12/2007: wsfulton
10760 [Java] Ensure the premature garbage collection prevention parameter (pgcpp) is generated
10761 when there are C comments in the jtype and jstype typemaps.
10762
1076310/12/2007: wuzzeb
10764 Added a testsuite entry for Bug #1735931
10765
1076610/09/2007: olly
10767 Automatically rerun autogen.sh if configure.in is modified.
10768
1076910/09/2007: olly
10770 Enhance check-%-test-suite rule and friends to give a more helpful
10771 error message if you try them for a language which doesn't exist
10772 (e.g. "make check-php-test-suite" rather than the correct
10773 "make check-php4-test-suite").
10774
1077510/09/2007: olly
10776 Add make rule to regenerate Makefile from Makefile.in if it has
10777 changed.
10778
1077910/09/2007: olly
10780 [php] Fix long-standing memory leak in wrapped constructors and
10781 wrapped functions/methods which return an object.
10782
1078310/08/2007: olly
10784 Fix Makefile.in to read check.list files correctly in a VPATH
10785 build.
10786
1078710/07/2007: wsfulton
10788 [C#, Java] Experimental shared_ptr typemaps added
10789
1079009/27/2007: mgossage
10791 [lua] added more verbose error messages for incorrect typechecks.
10792 Added a routine which checks the exact number of parameters passed to a function
10793 (breaks operator_overloading for unary minus operator, currently disabled).
10794 Reorganised the luatypemaps.swg to tidy it up.
10795 Added a lot of %ignores on the operators not supported by lua.
10796 Added support for constant member function pointers & runtest for member_pointer.i
10797 Added first version of wchar.i
10798
1079909/25/2007: wsfulton
10800 [C#, Java] throws typemaps for std::wstring using C# patch #1799064 from David Piepgrass
10801
1080209/24/2007: wsfulton
10803 [Tcl] Apply #1771313 to fix bug #1650229 - fixes long long and unsigned long long
10804 handling.
10805
1080609/20/2007: olly
10807 [Java] Eliminate some unnecessary uses of a temporary buffer
10808 allocated using new[]. SF#1796609.
10809
1081009/19/2007: wsfulton
10811 [C#] The $csinput special variable can be used in the csvarin typemap where it is always
10812 expanded to 'value'.
10813
1081409/19/2007: wsfulton
10815 [C#] Fix bug reported by Glenn A Watson and #1795260 where the cstype typemap used the 'ref'
10816 keyword in the typemap body, it produced uncompilable C# properties (variable wrappers).
10817 The type for the property now correctly comes from the 'out' attribute in the cstype typemap.
10818
1081909/19/2007: wsfulton
10820 [Java] Fix const std::wstring& typemaps
10821
1082209/19/2007: wsfulton
10823 [Java] Ensure the premature garbage collection prevention parameter (pgcpp) is generated
10824 where a parameter is passed by pointer reference, eg in the std::vector wrappers. The pgcpp
10825 is also generated now when user's custom typemaps use a proxy class in the jstype typemap
10826 and a 'long' in the jtype typemap.
10827
1082809/18/2007: olly
10829 [php] Add typemaps for handling parameters of type std::string &
10830 which are modified by the wrapped function.
10831
1083209/17/2007: olly
10833 [python] Split potentially long string literals to avoid hitting
10834 MSVC's low fixed limit on string literal length - patch from
10835 SF#1723770, also reported as SF#1630855.
10836
1083709/17/2007: olly
10838 [ocaml] Fix renaming of overloaded methods in the method_table -
10839 my patch from SF#940399.
10840
1084109/17/2007: olly
10842 [python] Simpler code for SWIG_AsVal_bool() which fixes a "strict
10843 aliasing" warning from GCC - patch from SF#1724581 by Andrew
10844 Baumann.
10845
1084609/17/2007: olly
10847 [perl5] Use sv_setpvn() to set a scalar from a pointer and length
10848 - patch from SF#174460 by "matsubaray".
10849
1085009/17/2007: olly
10851 When wrapping C++ code, generate code which uses
10852 std::string::assign(PTR, LEN) rather than assigning
10853 std::string(PTR, LEN). Using assign generates more efficient code
10854 (tested with GCC 4.1.2).
10855
1085609/07/2007: wsfulton
10857 Fix %ignore on constructors which are not explicitly declared [SF #1777712]
10858
1085909/05/2007: wuzzeb (John Lenz)
10860 - Change r_ltype in typesys.c to store a hashtable instead of a single value.
10861 several very subtle bugs were being caused by multiple ltypes being mapped
10862 to a single mangled type, mostly when using typedefed template parameters.
10863 Now, r_ltype stores a hashtable of possible ltypes, and when generating the
10864 type table, all the ltypes are added into the swig_type_info structure.
10865
1086608/31/2007: wsfulton
10867 SF #1754967 from James Bigler.
10868 - Fix bug in turning on warnings that were turned off by default. Eg 'swig -w+309' will now
10869 turn on the normally suppressed warning 309.
10870
10871 - New -Wextra commandline option which enables the extra warning numbers:
10872 202,309,403,512,321,322 (this is the list of warnings that have always been suppressed by
10873 default). By specifying -Wextra, all warnings will be turned on, but unlike -Wall,
10874 warnings can still be selectively turned on/off using %warnfilter,
10875 #pragma SWIG nowarn or further -w commandline options, eg:
10876 swig -Wextra -w309
10877 will turn on all warnings except 309.
10878
1087908/28/2007: wsfulton
10880 - New debugging options, -debug-module <n> and -debug-top <n> to display the parse tree at
10881 various stages, where <n> is a comma separated list of stages 1-4.For example, to
10882 display top of parse tree at stages 1 and 3:
10883 swig -debug-top 1,3
10884
10885 - Deprecate the following options which have equivalents below:
10886 -dump_parse_module => -debug-module 1
10887 -dump_module => -debug-module 4
10888 -dump_parse_top => -debug-top 1
10889 -dump_top => -debug-top 4
10890
10891 - Renamed some commandline options for naming consistency across all options:
10892 -debug_template => -debug-template
10893 -debug_typemap => -debug-typemap
10894 -dump_classes => -debug-classes
10895 -dump_tags => -debug-tags
10896 -dump_typedef => -debug-typedef
10897 -dump_memory => -debug-memory
10898
1089908/25/2007: olly
10900 [PHP5] Fix handling of double or float parameters with an integer
10901 default value.
10902
1090308/25/2007: olly
10904 [PHP5] Generate __isset() methods for setters for PHP 5.1 and later.
10905
1090608/20/2007: wsfulton
10907 [Java C#] Fix director bug #1776651 reported by Stephane Routelous which occurred when
10908 the director class name is the same as the start of some other symbols used within
10909 the director class.
10910
1091108/17/2007: wsfulton
10912 Correct behaviour for templated methods used with %rename or %ignore and the empty
10913 template declaration - %template(). A warning is issued if the method has not been
10914 renamed.
10915
1091608/16/2007: mutandiz (Mikel Bancroft)
10917 [allegrocl] Name generated cl file based on input file rather than by
10918 module name. It was possible to end up with a mypackage.cl and a test_wrap.c
10919 when parsing a test.i input file. Confusing. Also, include external-format
10920 templates for :fat and :fat-le automatically to avoid these being compiled
10921 at runtime.
10922
1092308/15/2007: efuzzyone
10924 [cffi] Apply patch #1766076 from Leigh Smith adding support for newly introduced
10925 in cffi :long-long and :unsigned-long-long.
10926
1092708/10/2007: wsfulton
10928 [Java] Add documentation patch #1743573 from Jeffrey Sorensen. It contains a neat
10929 idea with respect to better memory management by the JVM of C++ allocated memory.
10930
1093108/10/2007: wsfulton
10932 [Perl] Apply patch #1771410 from Wade Brainerd to fix typedef XS(SwigPerlWrapper) in
10933 perlrun.swg for ActiveState Perl build 822 and Perl 5.8.9 and 5.10 branches.
10934
1093508/10/2007: wsfulton
10936 [Lua] const enum reference typemaps fixed.
10937
1093808/09/2007: wsfulton
10939 [C#] Added missing support for C++ class member pointers.
10940
1094108/09/2007: wsfulton
Sylvestre Ledru7dac1bc2012-08-08 09:19:26 +000010942 [C#, Java] Add support for $owner in the "out" typemaps like in the scripting
Olly Bettsbe550092007-11-16 16:01:17 +000010943 language modules. Note that $owner has always been supported in the "javaout" / "csout"
10944 typemaps.
10945
1094608/01/2007: wsfulton
10947 Fix smart pointer handling for classes that have templated methods within the smart
10948 pointer type. Problem reported by craigdo at ee.washington.edu.
10949
1095007/31/2007: efuzzyone
10951 [cffi] fixed memory access after being freed bug. thanks to Martin Percossi.
10952 package name clos changed to cl. thanks to Ralf Mattes
10953
1095407/24/2007: wsfulton
10955 Parallel make support added for the examples and test-suite for developers who have
10956 more than one CPU. Now parallel make can be used for checking in addition to building
10957 the SWIG executable. Some typical checking examples:
10958
10959 make -j8 -k check
10960 make -j4 check-java-test-suite
10961 make -j2 check-java-examples
10962
1096307/19/2007: mgossage
10964 Fixed bug that stopped configure working on mingw (applied dos2unix to configure.in)
10965
1096607/10/2007: mgossage
10967 [lua] Extra compatibility with Lua 5.1 (updated SWIG_init, docs, examples, test suite)
10968 Removed name clash for static link of multiple modules
10969
1097007/05/2007: mgossage
10971 [lua] Fix a bug in SWIG_ALLOC_ARRAY()
10972 improved the error messages for incorrect arguments.
10973 Changed the output of swig_type() to use the human readable form of the type,
10974 rather than the raw swig type.
10975
1097607/03/2007: wsfulton
10977 [C#] Fix directors for some overloaded methods where the imtype resulted in identical
10978 methods being generated in the C# director class, eg void foo(int *) and void foo(double *)
10979 used to generated two of these:
10980
10981 private void SwigDirectorfoo(IntPtr p) { ... }
10982
1098306/25/2007: wsfulton
10984 [Java, C#] Some parameter name changes in std_vector.i allowing better targeting
10985 of typemaps for method parameters (for memory management of containers of pointers).
10986
1098706/07/2007: mutandiz (Mikel Bancroft)
10988 [allegrocl]
10989 fix foreign-type constructor to properly look for ffitype typemap
10990 bindings. fix inout_typemaps.i for strings.
10991
1099206/06/2007: olly
10993 [Ruby]
10994 Use whichever of "long" or "long long" is the same size as "void*"
10995 to hold pointers as integers, rather than whichever matches off_t.
10996 Fixes compilation on OS X and GCC warnings on platforms where
10997 sizeof(void*) < sizeof(off_t) (SF patch #1731979).
10998
1099906/06/2007: olly
11000 [PHP5]
11001 Fix handling of a particular case involving overloaded functions
11002 with default parameters.
11003
1100406/05/2007: mutandiz (Mikel Bancroft)
11005 [allegrocl]
11006 Fix case where we'd pass fully qualified identifiers
11007 (i.e. NS1::NS2::FOO) to swig-insert-id. All namespaces
11008 should be stripped.
11009
11010 Fix bug in TypedefHandler introduced by last fix.
11011
1101206/05/2007: olly
11013 Fix reporting of filenames in errors after %include (patch from
11014 Leigh Smith in #1731040; also reported as #1699940).
11015
1101605/31/2007: olly
11017 [Python]
11018 Fix "missing initialiser" warning when compiling generated C/C++
11019 wrapper code with Python 2.5 with warnings enabled (patch from
11020 bug#1727668 from Luke Moore).
11021
1102205/29/2007: olly
11023 [Python]
11024 Split docstrings into separate string literals at each newline when
11025 generating C/C++ wrapper code (the C/C++ compiler will just combine
11026 them back into a single string literal). This avoids MSVC
11027 complaining that the strings are too long (problem reported by
11028 Bo Peng on the mailing list).
11029
1103005/28/2007: olly
11031 [Python]
11032 Escape backslashes in docstrings.
11033
1103405/26/2007: olly
11035 [Python]
11036 Fix autodoc generation of enums to be more consistent with how the
11037 enums are wrapped - patch #1697226 from Josh Cherry.
11038
1103905/26/2007: olly
11040 [PHP5]
11041 Fix wrapping of methods and functions which return a pointer to a
11042 class (bug#1700788) and those which have overloaded forms returning
11043 both classes and non-classes (bug#1712717, thanks to Simon
11044 Berthiaume for the patch).
11045
1104605/25/2007: wsfulton
11047 Fixed %rename inconsistency in conversion operators as reported by Zhong Ren. The matching
11048 is now done on the operator name in the same way as it is done for parameters. For example:
11049
11050 %rename(opABC) Space::ABC::operator ABC() const;
11051 %rename(methodABC) Space::ABC::method(ABC a) const;
11052 namespace Space {
11053 class ABC {
11054 public:
11055 void method(ABC a) const {}
11056 operator ABC() const { ABC a; return a; }
11057 };
11058 }
11059
11060 Note that qualifying the conversion operator previously may or may not have matched.
11061 Now it definitely won't, so this will not match:
11062
11063 %rename(opABC) Space::ABC::operator Space::ABC() const;
11064
11065 in the same way that this does not match:
11066
11067 %rename(methodABC) Space::ABC::method(Space::ABC a) const;
11068
11069 The documentation has been improved with respect to %rename, namespaces and templates.
11070 Conversion operators documentation too.
11071
11072 *** POTENTIAL INCOMPATIBILITY ***
11073
1107405/16/2007: mutandiz
11075 [allegrocl]
11076 Fix bad generation of local var ltype's in functionWrapper().
11077 Try to work better with the backward order in which swig
11078 unrolls nested class definitions.
11079 cleaned up a little unnecessary code/debug printf's.
11080 Remove warning when replacing $ldestructor for ff:foreign-pointer
11081
1108205/12/2007: olly
11083 [Python]
11084 swig -python -threads now generates C/C++ code which uses Python's
11085 own threading abstraction (from pythread.h) rather than OS specific
11086 code. The old code failed to compile on MS Windows. (See SF patch
11087 tracker #1710341).
11088
1108905/04/2007: gga
11090 [Ruby]
11091 Changed STL renames to be global renames. This fixes
11092 STL functions not being renamed when autorename is on.
11093 This is a not a totally perfect work-around, but better.
11094 Someone really needs to fix the template renaming code.
11095 (See bug #1545634)
11096
1109705/04/2007 gga
11098 [All]
11099 Changed %rename("%(undercase)s") a little so that single
11100 numbers at the end of a function are not undercased. That is:
11101 getSomething -> get_something
11102 get2D -> get_2d
11103 get234 -> get_234
11104 BUT:
11105 asFloat2 -> as_float2
11106 (Bug #1699714)
11107
1110805/03/2007: gga
11109 [Ruby]
11110 Made __swigtype__ => @__swigtype__ so it can be accessed
11111 from the scripting language (and follows Ruby's official
11112 documentation, just in case).
11113 Made tracking => @__trackings__ for same reason.
11114 Currently storing ivars without the @ seems valid, but
11115 the PickAxe says this is not correct, so just in case...
11116
1111705/03/2007: gga
11118 [Ruby]
11119 Applied patch for -minherit bug and exception classes.
11120 This issue should be revisited more closely, as Multiple
11121 Inheritance in Ruby is still problematic.
11122 (patch/bug #1604878)
11123
1112405/03/2007: gga
11125 [Ruby]
11126 Overloaded functions in ruby will now report to the user
11127 the possible prototypes when the user mistypes the number or
11128 type of a parameter.
11129
1113005/03/2007: gga
11131 [Ruby]
11132 Forgot to document the bug fixing of an old bug regarding
11133 exceptions.
11134 (bug #1458247)
11135
1113605/03/2007: gga
11137 [Ruby]
11138 Fixed Ruby documentation to use the proper css styles for
11139 each section. Added autodoc section to Ruby's docs to
11140 document the features supported by Ruby in documenting its modules.
11141 Made rdoc documentation spit out the full name of the class +
11142 method name. Albeit this will make the current rdoc not recognize
11143 the method, this is still needed to disambiguate between different
11144 classes with similar methods (rdoc was created to document the
11145 ruby source which only contains one class per c file, unlike swig)
11146 I have patched rdoc to make it more friendly to swig. This
11147 patch needs to be merged in the ruby std library now.
11148
1114905/03/2007: gga
11150 [Ruby]
11151 Changed flag -feature to be -init_name to better reflect its
11152 purpose and avoid confusion with -features.
11153
1115405/03/2007: gga
11155 [Ruby]
11156 Improved autodoc generation.
11157 Added autodoc .swg files to Ruby library for easily adding
11158 documentation to common Ruby methods and STL methods.
11159 Fixed autodoc documenting of getters and setters and module.
11160 Made test suite always generate autodocs.
11161
1116205/03/2007: gga
11163 [Ruby]
11164 Removed some warnings from STL and test suite.
11165
1116605/02/2007: mgossage
11167 [Lua] Fixed issues with C++ classes and hierachies across multiple
11168 source files. Fixed imports test case & added run test.
11169 Added Examples/imports.
11170 Added typename for raw lua_State*
11171 Added documentation on native functions.
11172
1117305/02/2007: gga
11174 [Ruby]
11175 Docstrings are now supported.
11176 %feature("autodoc") and %feature("docstring") are now
11177 properly supported in Ruby. These features will generate
11178 a _wrap.cxx file with rdoc comments in them.
11179
1118005/02/2007: gga
11181 [Ruby]
11182 STL files have been upgraded to follow the new swig/python
11183 Lib/std conventions.
11184 This means std::vector, std::set, std::map, set::multimap,
11185 std::multiset, std::deque and std::string are now properly
11186 supported, including their iterators, support for containing
11187 ruby objects (swig::GC_VALUE) and several other ruby
11188 enhancements.
11189 std::complex, std::ios, std::iostream, std::iostreambuf and
11190 std::sstream are now also supported.
11191 std::wstring, std::wios, std::wiostream, std::wiostreambuf
11192 and std::wsstream are supported verbatim with no unicode
11193 conversion.
11194
11195 std_vector.i now mimics the behavior of Ruby Arrays much more
11196 closely, supporting slicing, shifting, unshifting,
11197 multiple indexing and proper return values on assignment.
11198
11199 COMPATABILITY NOTE: this changes the older api a little bit in
11200 that improper indexing would previously (incorrectly) raise
11201 exceptions. Now, nil is returned instead, following ruby's
11202 standard Array behavior.
11203
1120405/02/2007: gga
11205 [Ruby]
11206 Changed the value of SWIG_TYPECHECK_BOOL to be 10000 (ie. higher
11207 than that of all integers).
11208 This is because Ruby allows typecasting
11209 integers down to booleans which can make overloaded functions on
11210 bools and integers to fail.
11211 (bug# 1488142)
11212
1121305/02/2007: gga
11214 [Ruby]
11215 Fixed a subtle bug in multiple argouts that could get triggered if
11216 the user returned two or more arguments and the first one was an
11217 array.
11218
1121905/01/2007: gga
11220 [Ruby]
11221 Improved the documentation to document the new features
11222 added, add directorin/out/argout typemaps, etc.
11223
1122405/01/2007: gga
11225 [Ruby]
11226 Added %initstack and %ignorestack directives for director
11227 functions. These allow you to control whether a director
11228 function should re-init the Ruby stack.
11229 This is sometimes needed for an embedded Ruby where the
11230 director method is used as a C++ callback and not called
11231 by the user from ruby code.
11232 Explanation:
11233 Ruby's GC needs to be aware of the running OS stack in order to
11234 mark any VALUE (Ruby objects) it finds there to avoid collection
11235 of them. This allows the ruby API to be very simple and allows
11236 you to write code like "VALUE a = sth" anywhere without needing
11237 to do things like refcounting like python.
11238 By default, the start of the stack is set when ruby_init() is
11239 called. If ruby is inited within main(), as it usually is the
11240 case with the main ruby executable, ruby will be able to calculate
11241 its stack properly. However, when this is not possible, as when
11242 ruby is embedded as a plugin to an application where main is not
11243 available, ruby_init() will be called in the wrong place, and
11244 ruby will be incorrectly tracking the stack from the function
11245 that called ruby_init() forwards only, which can lead to
11246 all sorts of weird crashes or to ruby thinking it has run out of
11247 stack space incorrectly.
11248 To avoid this, director (callback) functions can now be tagged
11249 to try to reset the ruby stack, which will solve the issues.
11250 NOTE: ruby1.8.6 still contains a bug in it in that its function
11251 to reset the stack will not always do so. This bug is triggered
11252 very rarely, when ruby is called from two very distinct places
11253 in memory, like a branch of main() and another dso. This bug
11254 has now been reported to ruby-core and is pending further
11255 investigation.
11256 (bug #1700535 and patch #1702907)
11257
1125804/30/2007: wsfulton
11259 Fix #1707582 - Restore building from read-only source directories.
11260
1126104/30/2007: gga
11262 [Ruby]
11263 Ruby will now report the parameter index properly on type
11264 errors as well as the class and value of the incorrect
11265 argument passed.
11266 (feature request #1699670)
11267
1126804/30/2007: gga
11269 [Ruby]
11270 Ruby no longer creates the free_Class function if the class
11271 contains its own user defined free function (%freefunc).
11272 (bug #1702882)
11273
1127404/30/2007: gga
11275 [Ruby]
11276 Made directors raise a ruby exception for incorrect argout
11277 returned values if RUBY_EMBEDDED is set, instead of throwing
11278 an actual SwigDirector exception.
11279 This will prevent crashes when ruby is embedded and unaware
11280 of the SwigDirector exception.
11281
1128204/30/2007: gga
11283 [Ruby]
11284 Removed the need for -DSWIGEXTERN.
11285 Changed swig_ruby_trackings to be a static variable, but also
11286 be kept within a hidden instance variable in the SWIG module.
11287 This allows properly dealing with trackings across multiple
11288 DSOs, which was previously broken.
11289 (bug #1700535 and improvement to patch #1702907)
11290
1129104/29/2007: gga
11292 [Ruby] Fixed GC memory issues with trackings that could lead
11293 to segfaults when dealing, mainly, with static variables.
11294 (bug #1700535 and patch #1702907)
11295
1129604/29/2007: gga
11297 [Ruby]
11298 Fixed String conversion using old ruby1.6 macros. Now
11299 StringValuePtr() is used if available. This removes warnings
11300 when converting strings with \0 in them.
11301 (bug #1700535 and patch #1702907)
11302
1130304/29/2007: gga
11304 [Ruby]
11305 Fixed the argout count in directors for Ruby. Previously,
11306 ignored or "numinputs=0" typemaps would incorrectly not get
11307 counted towards the argout count.
11308 (bug/patch #1545585)
11309
1131004/29/2007: gga
11311 [Ruby]
11312 Upgraded Ruby converter to recognize "numinputs=0". Previously,
11313 only the old "ignore" flag was checked (which would currently
11314 still work properly, but is deprecated).
11315
1131604/29/2007: gga
11317 [Ruby - but should be made generic]
11318
11319 %feature("numoutputs","0") added.
11320
11321 This feature allows you to ignore the output of a function so
11322 that it is not added to a list of output values
11323 ( ie. argouts ).
11324 This should also become a feature of %typemap(directorout)
11325 as "numoutputs"=0, just like "numinputs"=0 exists.
11326
11327 %feature("directors"=1)
11328
11329 %include <typemaps.i>
11330
11331 %feature("numoutputs","0") { Class::member_function1 };
11332 %typemap(out) MStatus { // some code, like check mstatus
11333 // and raise exception if wrong };
11334
11335 %inline %{
11336 typedef int MStatus;
11337 class Class {
11338
11339 // one argument returned, but director out code added
11340 // MStatus is discarded as a return (out) parameter.
11341 virtual MStatus member_function1( int& OUTPUT );
11342
11343 // two arguments returned, director out code added
11344 // MStatus is not discarded
11345 virtual MStatus member_function2( int& OUTPUT );
11346 };
11347 %}
11348
11349
1135004/21/2007: olly
11351 Fix parsing of float constants with an exponent (e.g. 1e-02f)
11352 (bug #1699646).
11353
1135404/20/2007: olly
11355 [Python] Fix lack of generation of docstrings when -O is used.
11356 Also, fix generation of docstrings containing a double quote
11357 character. Patch from Richard Boulton in bug#1700146.
11358
1135904/17/2007: wsfulton
11360 [Java, C#] Support for adding in Java/C# code before and after the intermediary call,
11361 specifically related to the marshalling of the proxy type to the intermediary type.
11362 The javain/csin typemap now supports the 'pre' and 'post' attributes to achieve this.
11363 The javain typemap also supports an optional 'pgcppname' attribute for premature garbage
11364 collection prevention parameter naming and the csin typemap supports an optional 'cshin'
11365 attribute for the parameter type used in a constructor helper generated when the type is used
11366 in a constructor. Details in the Java.html and CSharp.html documentation.
11367
1136804/16/2007: olly
11369 Don't treat `restrict' as a reserved identifier in C++ mode
11370 (bug#1685534).
11371
1137204/16/2007: olly
11373 [PHP5] Fix how zend_throw_exception() is called (bug #1700785).
11374
1137504/10/2007: olly
11376 Define SWIGTEMPLATEDISAMBIGUATOR to template for aCC (reported on
11377 swig-user that this is needed).
11378
1137904/04/2007: olly
11380 [PHP5] If ZTS is enabled, release <module>_globals_id in MSHUTDOWN
11381 to avoid PHP interpreter crash on shutdown. This solution was
11382 suggested here: http://bugs.php.net/bug.php?id=40985
11383
1138404/03/2007: olly
11385 [PHP4] Add missing ZTS annotations to generated C++ wrapper code
11386 to fix compilation failures when using ZTS enabled SWIG (Linux
11387 distributions tend to disable ZTS, but notably the Windows build
11388 uses it by default).
11389
1139004/01/2007: efuzzyone
11391 [CFFI] Patch #1684261: fixes handling of unsigned int literals, thanks Leigh Smith.
11392 Also, improved documentation.
11393
1139403/30/2007: olly
11395 Avoid generating '<:' token when using SwigValueWrapper<> on a type
11396 which starts with '::' (patch #1690948).
11397
1139803/25/2007: wuzzeb (John Lenz)
11399 [perl5] Add SWIG_fail to the SWIG_exception macro. Fixes a few problems reported
11400 on the mailing list.
11401
1140203/23/2007: wsfulton
11403 String copying patch from Josh Cherry reducing memory consumption by about 25%.
11404
1140503/21/2007: wsfulton
11406 [Java] Apply patch #1631987 from Ulrik Peterson - bool INOUT typemaps
11407 fail on big endian machines.
11408
1140903/16/2007: wsfulton
11410 Fix seg fault given dodgy C++ code: namespace abc::def { }
11411
1141203/16/2007: wsfulton
11413 [Java] Fixes so that ARRAYSOFCLASSES and ARRAYSOFENUMS in arrays_java.i can be applied
11414 to pointer types.
11415
1141603/03/2007: olly
11417 [PHP5] When we know the literal numeric value for a constant, use
11418 that to initialise the const member in the PHP wrapper class.
11419
1142003/02/2007: olly
11421 [PHP5] Fix PHP wrapper code generated for certain cases of
11422 overloaded forms with default arguments.
11423
1142402/26/2007: efuzzyone
11425 [CFFI] Patch #1656395: fixed hex and octal values bug, thanks to Arthur Smyles.
11426
1142702/22/2007: mgossage
11428 [Lua] Fixed bug in typemaps which caused derived_byvalue and rname test cases to fail.
11429 Updated derived_byvalue.i to explain how to find and fix the problem
11430
1143101/25/2007: wsfulton
11432 Fix #1538522 and #1338527, forward templated class declarations without a
11433 name for the templated class parameters, such as:
11434
11435 template <typename, class> class X;
11436
1143701/23/2007: mgossage
11438 [Lua] Patch #1640862: <malloc.h> replaced by <stdlib.h>
11439 Patch #1598063 Typo in typemaps.i
11440
1144101/22/2007: mgossage
11442 [Lua] Added a lua specific carrays.i which adds the operator[] support.
11443 modified the main code to make it not emit all the class member functions & accessors
11444 Note: C structs are created using new_XXX() while C++ classes use XXX() (should be standardised)
11445 Updated test case: li_carrays
11446 Updated the documentation.
11447
1144801/12/2007: wsfulton
11449 [Php] Add support for newfree typemaps (sometimes used by %newobject)
11450
1145101/12/2007: beazley
11452 New command line option -macroerrors. When supplied, this will force
11453 the C scanner/parser to report proper location information for code contained
11454 inside SWIG macros (defined with %define). By default, SWIG merely reports
11455 errors on the line at which a macro is used. With this option, you
11456 can expand the error back to its source---something which may simplify
11457 debugging.
11458
1145901/12/2007: beazley
11460 [Internals] Major overhaul of C/C++ scanning implementation. For quite
11461 some time, SWIG contained two completely independent C/C++ tokenizers--
11462 the legacy scanner in CParse/cscanner.c and a general purpose scanner
11463 in Swig/scanner.c. SWIG still has two scanning modules, but the C parser
11464 scanner (CParse/cscanner.c) now relies upon the general purpose
11465 scanner found in Swig/scanner.c. As a result, it is much smaller and
11466 less complicated. This change also makes it possible to maintain all
11467 of the low-level C tokenizing in one central location instead of two
11468 places as before.
11469
11470 ***POTENTIAL FLAKINESS***
11471 This change may cause problems with accurate line number reporting
11472 as well as error reporting more generally. I have tried to resolve this
11473 as much as possible, but there might be some corner cases.
11474
1147501/12/2007: mgossage
11476 [Lua] Added typemap throws for std::string*, typemap for SWIGTYPE DYNAMIC,
11477 changed the existing throws typemap to throw a string instead of making a copy of
11478 the object (updating a few test cases to deal with the change).
11479 fixed test case: dynamic_casts, exception_partial_info, li_std_string, size_t
11480
1148101/03/2007: beazley
11482 [Internals]. Use of swigkeys.c/.h variables is revoked. Please use
11483 simple strings for attribute names.
11484
1148512/30/2006: beazley
11486 Internal API functions HashGetAttr() and HashCheckAttr() have been revoked.
11487 Please use Getattr() to retrieve attributes. The function Checkattr() can
11488 be used to check attributes. Note: These functions have been revoked
11489 because they only added a marginal performance improvement at the expense
11490 code clarity.
11491
1149212/26/2006: mgossage
11493 [Lua] Added more STL (more exceptions, map, size_t),
11494 fixed test case: conversion_ns_template.
11495
1149612/21/2006: mgossage
11497 [Lua] Update to throw errors when setting immutables,
11498 and allowing user addition of module variables.
11499
1150012/20/2006: wsfulton
11501 Fix typedef'd variable wrappers that use %naturalvar, eg, std::string.
11502
1150312/14/2006: wsfulton
11504 [C#] Add std::wstring and wchar_t typemaps
11505
1150612/14/2006: olly
11507 [php] Fix bug #1613673 (bad PHP5 code generated for getters and
11508 setters).
11509
1151012/02/2006: wsfulton, John Lenz, Dave Beazley
11511 Move from cvs to Subversion for source control
11512
1151311/30/2006: beazley
11514 Cleaned up swigwarnings.swg file not to use nested macro
11515 definitions.
11516
1151711/12/2006: wsfulton
11518 [Java, C#] Fix for %extend to work for static member variables.
11519
William S Fultone32fea62006-11-29 21:53:50 +000011520Version 1.3.31 (November 20, 2006)
11521==================================
11522
1152311/12/2006: Luigi Ballabio
11524 [Python] Alternate fix for Python exceptions bug #1578346 (the previous one broke Python
11525 properties in modern classes)
11526
1152711/12/2006: wsfulton
11528 -fakeversion commandline option now generates the fake version into the generated wrappers
11529 as well as displaying it when the -version commandline option is used.
11530
1153114/11/2006: mgossage
11532 [lua] update to typemap for object by value, to make it c89 compliant
11533
William S Fulton1c44dd02006-11-15 23:48:44 +000011534Version 1.3.30 (November 13, 2006)
Olly Bettsfdcea432009-02-26 05:53:37 +000011535==================================
William S Fulton1c44dd02006-11-15 23:48:44 +000011536
William S Fulton1c44dd02006-11-15 23:48:44 +00001153711/12/2006: wsfulton
11538 [java] Remove DetachCurrentThread patch from 08/11/2006 - it causes segfaults
11539 on some systems.
11540
1154111/12/2006: wsfulton
11542 [python] Fix #1578346 - Python exceptions with -modern
11543
1154411/10/2006: wsfulton
11545 Fix #1593291 - Smart pointers and inheriting from templates
11546
1154711/09/2006: wsfulton
11548 Fix director operator pointer/reference casts - #1592173.
11549
1155011/07/2006: wsfulton
11551 Add $self special variable for %extend methods. Please use this instead of just 'self'
11552 as the C++ 'this' pointer.
11553
1155411/07/2006: mutandiz
11555 [allegrocl]
11556 allegrocl.swg: swig-defvar updated to allow specifying of
11557 non-default foreign type (via :ftype keyword arg).
11558 allegrocl.cxx: Specify proper access type for enum values.
11559
1156011/03/2006: wsfulton
11561 [Java/C#] Fix const std::string& return types for directors as reported by
11562 Mark Donselzmann
11563
1156410/29/2006: wsfulton
11565 [Java] Remove DeleteLocalRef from end of director methods for now as it is causing a
11566 seg fault when run on Solaris 8.
11567
1156810/29/2006: wuzzeb (John Lenz)
11569 [Guile] Patch from Chris Shoemaker to clean up some warnings in the generated code.
11570
1157110/29/2006: wsfulton
11572 [Java] Important fix to prevent early garbage collection of the Java proxy class
11573 while it is being used in a native method. The finalizer could destroy the underlying
11574 C++ object while it was being used. The problem occurs when the proxy class is no
11575 longer strongly reachable after a native call. The problem seems to occur in
11576 memory stress situations on some JVMs. It does not seem to occur on the
11577 Sun client JVM up to jdk 1.5. However the 1.6 client jdk has a more aggressive garbage
11578 collector and so the problem does occur. It does occur on the Sun server
11579 JVMs (certainly 1.4 onwards). The fix entails passing the proxy class into the native
11580 method in addition to the C++ pointer in the long parameter, as Java classes are not
11581 collected when they are passed into JNI methods. The extra parameter can be suppressed
11582 by setting the nopgcpp attribute in the jtype typemap to "1" or using the new -nopgcpp
11583 commandline option.
11584
11585 See Java.html#java_pgcpp for further details on this topic.
11586
1158710/24/2006: wsfulton
11588 [C#] Fix smart pointer wrappers. The virtual/override/new keyword is not generated
11589 for each method as the smart pointer class does not mirror the underlying pointer
11590 class inheritance hierarchy. SF #1496535
11591
1159210/24/2006: mgossage
11593 [lua] added support for native methods & member function pointers.
11594 fixed test cases arrays_dimensionless & cpp_basic. Added new example (functor).
11595 tidied up a little of the code (around classHandler).
11596
1159710/17/2006: wsfulton
11598 [C#, Java] directorout typemap changes to fall in line with the other director
11599 languages. $result is now used where $1 used to be used. Please change your typemaps
11600 if you have a custom directorout typemap.
11601
1160210/18/2006: wsfulton
11603 Some fixes for applying the char array typemaps to unsigned char arrays.
11604
1160510/17/2006: wsfulton
11606 [C#, Java] Add in const size_t& and const std::size_t& typemaps.
11607
1160810/15/2006: efuzzyone
11609 [CFFI] Suppress generating defctype for enums, thanks to Arthur Smyles. Patch 1560983.
11610
1161110/14/2006: wuzzeb (John Lenz)
11612 [Chicken] Minor fix to make SWIG work with the (as yet unreleased) chicken 2.5
11613
11614 [Guile,Chicken] Fix SF Bug 1573892. Added an ext_test to the test suite to test
11615 this bug, but this test can not really be made generic because the external code must
11616 plug into the target language interpreter directly.
11617 See Examples/test-suite/chicken/ext_test.i and ext_test_external.cxx
11618
11619 Added a %.externaltest to common.mk, and any interested language modules can
11620 copy and slightly modify either the chicken or the guile ext_test.i
11621
1162210/14/2006: mgossage
11623 [Lua] added OUTPUT& for all number types, added a long long type
11624 fixed several test cases.
11625 update: changed typemaps to use SWIG_ConvertPtr rather than SWIG_MustGetPointer
11626 started spliting lua.swg into smaller parts to make it neater
11627
1162810/13/2006: wsfulton
11629 [C#, Java] Marginally better support for multiple inheritance only in that you can
11630 control what the base class is. This is done using the new 'replace' attribute in the
11631 javabase/csbase typemap, eg in the following, 'Me' will be the base class,
11632 no matter what Foo is really derived from in the C++ layer.
11633
William S Fultonc10a84c2022-08-20 22:14:58 +010011634 %typemap(javabase, replace="1") Foo "Me"
11635 %typemap(csbase, replace="1") Foo "Me"
William S Fulton1c44dd02006-11-15 23:48:44 +000011636
11637 Previously it was not possible for the javabase/csbase typemaps to override the C++ base.
11638
1163910/12/2006: wsfulton
11640 [Java] Remove potential race condition on the proxy class' delete() method
11641 (it is now a synchronized method, but is now customisable by changing the
Sylvestre Ledru7dac1bc2012-08-08 09:19:26 +000011642 methodmodifiers attribute in the javadestruct or javadestruct_derived typemap)
William S Fulton1c44dd02006-11-15 23:48:44 +000011643
11644 [C#] Remove potential race condition on the proxy class' Dispose() method,
11645 similar to Java's delete() above.
11646
11647 *** POTENTIAL INCOMPATIBILITY ***
11648
1164910/12/2006: wsfulton
11650 [Ruby, Python] Remove redundant director code in %extend methods (%extend
11651 methods cannot be director methods)
11652
1165310/12/2006: wsfulton
11654 [Ruby, Python] Fix #1505594 - director objects not returned as director objects
11655 in %extend methods.
11656
1165710/11/2006: wsfulton
11658 [Java] Fix #1238798 - Directors using unsigned long long or any other type
11659 marshalled across the JNI boundary using a Java class (where the jni typemap
11660 contains jobject).
11661
1166210/06/2006: wsfulton
11663 Fix #1162194 - #include/%include within a structure
11664
1166510/06/2006: wsfulton
11666 Fix #1450661, string truncation in String_seek truncating Java/C# enums.
11667
1166810/06/2006: mgossage
11669 [Lua] Fix #1569587. The name is now correct.
11670
1167110/04/2006: wsfulton
11672 Director fixes for virtual conversion operators
11673
1167410/04/2006: olly
11675 [php] Fix #1569587 for PHP. Don't use sizeof() except with string
11676 literals. Change some "//" comments to "/* */" for portability.
11677
1167810/04/2006: mgossage
11679 [Lua] Partial Fix #1569587. The type is now correct, but the name is still not correct.
11680
1168110/03/2006: wsfulton
11682 [Ruby] Fix #1527885 - Overloaded director virtual methods sometimes produced
William S Fulton3dcc5012014-10-21 07:55:07 +010011683 uncompilable code when used with the director:except feature.
William S Fulton1c44dd02006-11-15 23:48:44 +000011684
1168510/03/2006: wsfulton
11686 Directors: Directors are output in the order in which they are declared in
11687 the C++ class rather than in some pseudo-random order.
11688
1168910/03/2006: mmatus
11690 Fix #1486281 and #1471039.
11691
1169210/03/2006: olly
11693 [Perl] Fix for handling strings with zero bytes from Stephen Hutsal.
11694
1169509/30/2006: efuzzyone
11696 [CFFI] Bitfield support and vararg support due to Arthur Smyles.
11697 C expression to Lisp conversion, thanks to Arthur Smyles for the initial
11698 idea, it now supports conversion for a whole range of C expressions.
11699
1170009/28/2006: wsfulton
11701 Fix #1508327 - Overloaded methods are hidden when using -fvirtual optimisation.
11702 Overloaded methods are no longer candidates for elimination - this mimics
11703 C++ behaviour where all overloaded methods must be defined and implemented
11704 in a derived class in order for them to be available.
11705
1170609/25/2006: wsfulton
11707 [Ruby, Python, Ocaml] Fix #1505591 Throwing exceptions in extended directors
11708
1170909/25/2006: wsfulton
11710 Fix #1056100 - virtual operators.
11711
1171209/24/2006: olly
11713 Don't accidentally create a "<:" token (which is the same as "[" in C++).
11714 Fixes bug # 1521788.
11715
1171609/23/2006: olly
11717 [Ruby] Support building with recent versions of the Ruby 1.9
11718 development branch. Fixes bug #1560092.
11719
1172009/23/2006: olly
11721 Templates can now be instantiated using negative numbers and
11722 constant expressions, e.g.:
11723
11724 template<int q> class x {};
11725 %template(x_minus1) x<-1>;
11726 %template(x_1plus2) x<1+2>;
11727
11728 Also, constant expressions can now include comparisons (>, <, >=,
11729 <=, !=, ==), modulus (%), and ternary conditionals (a ? b : c).
11730
11731 Fixes bugs #646275, #925555, #956282, #994301.
11732
1173309/22/2006: wsfulton
11734 Fix %ignore on director methods - Bugs #1546254, #1543533
11735
1173609/20/2006: wsfulton
11737 Fix %ignore on director constructors
11738
1173909/20/2006: wsfulton
11740 Fix seg faults and asserts when director methods are ignored (#1543533)
11741
1174209/20/2006: wsfulton
11743 Fix out of source builds - bug #1544718
11744
1174509/20/2006: olly
11746 Treat a nested class definition as a forward declaration rather
11747 than ignoring it completely, so that we generate correct code for
11748 passing opaque pointers to the nested class (fixes SF bug #909387).
11749
1175009/20/2006: olly
11751 *** POTENTIAL INCOMPATIBILITY ***
11752 [php] Overload resolution now works. However to allow this, SWIG
11753 generated wrappers no longer coerce PHP types (which reverts a change
11754 made in 1.3.26). So for example, if a method takes a string, you
11755 can no longer pass a number without explicitly converting it to a
11756 string in PHP using: (string)x
11757
1175809/18/2006: mgossage
11759 [ALL] fix on swiginit.swg, has been reported to crash on several test cases
11760 found and fixed problem in imports under python (mingw)
11761
1176209/16/2006: wsfulton
11763 [Python] Patch from Michal Marek for Python 2.5 to fix 64 bit array indexes on
11764 64 bit machines.
11765
1176609/13/2006: wsfulton
11767 The explicitcall feature has been scrapped. This feature was introduced primarily
11768 to solve recursive director method calls. Director upcall improvements made instead:
11769
11770 [Python, Ruby, Ocaml] The swig_up flag is no longer used. The required mutexes
11771 wrapping this flag are also no longer needed. The recursive calls going from C++
11772 to the target language and back again etc are now avoided by a subtlely different
11773 approach. Instead of using the swig_up flag in each director method to indicate
11774 whether the explicit C++ call to the appropriate base class method or a normal
11775 polymorphic C++ call should be made, the new approach makes one of these calls
11776 directly from the wrapper method.
11777
11778 [Java, C#] The recursive call problem when calling a C++ base class method from
11779 Java/C# is now fixed. The implementation is slightly different to the other languages
11780 as the detection as to whether the explicit call or a normal polymorphic call is made
11781 in the Java/C# layer rather than in the C++ layer.
11782
1178309/11/2006: mgossage
11784 [ALL] updated swiginit.swg to allow multiple interpreters to use multiple
11785 swig modules at once. This has been tested in Lua (mingw & linux),
11786 perl5 & python (linux) only.
11787
1178809/11/2006: mgossage
11789 [lua] added support for passing function pointers as well as native lua object
11790 into wrappered function.
11791 Added example funcptr3 to demonstrate this feature
11792
1179309/05/2006: olly
11794 [php] Rename ErrorCode and ErrorMsg #define-s to SWIG_ErrorCode
11795 and SWIG_ErrorMsg to avoid clashes with code the user might be
11796 wrapping (patch from Darren Warner in SF bug #1466086). Any
11797 user typemaps which use ErrorCode and/or ErrorMsg directly will
11798 need adjusting - you can easily fix them to work with both old
11799 and new SWIG by changing to use SWIG_ErrorMsg and adding:
11800
11801 #ifndef SWIG_ErrorMsg
11802 #define SWIG_ErrorMsg() ErrorMsg()
11803 #endif
11804
1180508/29/2006: olly
11806 [php] Move constant initialisation from RINIT to MINIT to fix a
11807 warning when using Apache and mod_php. We only need to create
11808 PHP constants once when we're first initialised, not for every HTTP
11809 request.
11810
1181108/21/2006: mgossage
11812 [Lua]
11813 Bugfix #1542466 added code to allow mapping Lua nil's <-> C/C++ NULL's
11814 updated various typemaps to work correctly with the changes
11815 added voidtest_runme.lua to show the features working
11816
1181708/19/2006: wuzzeb (John Lenz)
11818 [Guile] Add feature:constasvar to export constants as variables instead of functions
11819 that return the constant value.
11820
1182108/11/2006: wsfulton
11822 [Java] DetachCurrentThread calls have been added so that natively created threads
11823 no longer prevent the JVM from exiting. Bug reported by Thomas Dudziak and
11824 Paul Noll.
11825
1182608/10/2006: wsfulton
11827 [C#] Fix director protected methods so they work
11828
1182907/25/2006: mutandiz
11830 [allegrocl]
11831 more additions to std::string, some tweaks and small bug fixes
11832 -nocwrap mode.
11833
1183407/21/2006: mgossage
11835 [Lua]
11836 Bugfix #1526022 pdated std::string to support strings with '\0' inside them
11837 updated typemaps.i to add support for pointer to pointers
11838
1183907/19/2006: mutandiz
11840 [allegrocl]
11841 - Add std_string.i support.
11842 - Add newobject patch submitted by mkoeppe (thanks!)
11843 - Fix type name mismatch issue for nested type definitions.
11844 specifically typedefs in templated class defns.
11845
1184607/18/2006: mgossage
11847 Bugfix #1522858
11848 updated lua.cxx to support -external-runtime command
11849
1185007/14/2006: wuzzeb (John Lenz)
11851 Increment the SWIG_RUNTIME_VERSION to 3, because of the
11852 addition of the owndata member in swig_type_info.
11853 Reported by: Prabhu Ramachandran
11854
1185507/05/2006: wsfulton
11856 Search path fixes:
11857 - Fix search path for library files to behave as documented in Library.html.
11858 - Fix mingw/msys builds which did not find the SWIG library when installed.
11859 - Windows builds also output the mingw/msys install location when running
11860 swig -swiglib.
11861 - The non-existent and undocumented config directory in the search path has
11862 been removed.
11863
1186407/05/2006: wsfulton
11865 Fix $symname special variable expansion.
11866
1186707/04/2006: wuzzeb (John Lenz)
11868 [Chicken]
11869 Add %feature("constasvar"), which instead of exporting a constant as a
11870 scheme function, exports the constant as a scheme variable. Update the
11871 documentation as well.
11872
1187307/04/2006: wsfulton
11874 [See entry of 09/13/2006 - explicitcall feature and documentation to it removed]
11875 New explicitcall feature which generates additional wrappers for virtual methods
11876 that call the method explicitly, not relying on polymorphism to make the method
11877 call. The feature is a feature flag and is enabled like any other feature flag.
11878 It also recognises an attribute, "suffix" for mangling the feature name, see
11879 SWIGPlus.html#SWIGPlus_explicitcall documentation for more details.
11880
11881 [Java, C#]
11882 The explicitcall feature is also a workaround for solving the recursive calls
11883 problem when a director method makes a call to a base class method. See
11884 Java.html#java_directors_explicitcall for updated documentation.
11885
1188606/28/2006: joe (Joseph Wang)
11887 [r] Initial support for R
11888
1188906/20/2006: wuzzeb (John Lenz)
11890 [Chicken]
11891 Minor fixes to get apply_strings.i testsuite to pass
11892 Remove integers_runme.scm from the testsuite, because SWIG and Chicken does
11893 handle overflows.
11894
1189506/19/2005: olly
11896 [php] Add support for generating PHP5 class wrappers for C++
11897 classes (use "swig -php5").
11898
1189906/17/2006: olly
11900 [php] Added some missing keywords to the PHP4 keyword list, and
11901 fixed __LINE__ and __FILE__ which were in the wrong category.
11902 Also added all the keywords new in PHP5, and added comments
11903 noting the PHP4 keywords which aren't keywords in PHP5.
11904
1190506/17/2006: olly
11906 [php] Don't segfault if PHP Null is passed as this pointer (e.g.
11907 Class_method(Null)) - give a PHP Error instead.
11908
1190906/15/2006: mutandiz
11910 [allegrocl]
11911 Add initial support for std::list container class.
11912 Fix a few bugs in helper functions.
11913
1191405/13/2006: wsfulton
11915 [Java] Replace JNIEXPORT with SWIGEXPORT, thereby enabling the possibility
11916 of using gcc -fvisibility=hidden for potentially smaller faster loading wrappers.
11917
1191805/13/2006: wsfulton
11919 Fix for Makefiles for autoconf-2.60 beta
11920
1192105/13/2006: wsfulton
11922 Vladimir Menshakov patch for compiling wrappers with python-2.5 alpha.
11923
1192405/12/2006: wsfulton
11925 Fix buffer overflow error when using large %feature(docstring) reported
11926 by Joseph Winston.
11927
1192805/12/2006: wsfulton
11929 [Perl] Operator overload fix from Daniel Moore.
11930
1193105/25/2006: mutandiz
11932 [allegrocl]
11933 Fix bug in generation of CLOS type declarations for unions
11934 and equivalent types.
11935
1193605/24/2006: mutandiz
11937 [allegrocl]
11938 Don't require a full class definition to generate a CLOS wrapper.
11939
1194005/20/2006: olly
11941 [php] GCC Visibility support now works with PHP.
11942
1194305/19/2006: olly
11944 [php] Removed support for -dlname (use -module instead). Fixed
11945 naming of PHP extension module to be consistent with PHP
11946 conventions (no "php_" prefix on Unix; on PHP >= 4.3.0, handle Unix
11947 platforms which use something other than ".so" as the extension.)
11948
1194905/13/2006: wsfulton
11950 [C#] Director support added
11951
1195205/07/2006: olly
11953 [php] Don't segfault if PHP Null is passed where a C++ reference
11954 is wanted.
11955
1195605/05/2006: olly
11957 [php] Fix wrappers generated for global 'char' variables to not
11958 include a terminating zero byte in the PHP string.
11959
1196005/03/2006: wsfulton
11961 Modify typemaps so that char * can be applied to unsigned char * or signed char *
11962 types and visa versa.
11963
1196405/03/2006: efuzzyone
11965 [cffi]Thanks to Luke J Crook for this idea.
11966 - a struct/enum/union is replaced with :pointer only if
11967 that slot is actually a pointer to that type. So,:
11968 struct a_struct { int x; } and
11969 struct b_struct { a_struct struct_1; };
11970 will be converted as:
11971 (cffi:defcstruct b_struct
11972 (struct_1 a_struct))
11973 - Other minor fixes in lispifying names.
11974
1197505/02/2006: wsfulton
11976 Fix possible redefinition of _CRT_SECURE_NO_DEPRECATE for VC++.
11977
1197804/14/2006: efuzzyone
11979 [cffi]
11980 Thanks to Thomas Weidner for the patch.
11981 - when feature export is set (export 'foo) is
11982 generated for every symbol
11983 - when feature inline is set (declaim (inline foo)) is
11984 generated before every function definition
11985 - when feature intern_function is set
11986 #.(value-of-intern-function "name" "nodeType" package)
11987 is emitted instead of the plain symbol. A sample swig-lispify
11988 is provided.
11989 - every symbol is prefixed by it's package.
11990
1199104/13/2006: efuzzyone
11992 [cffi]
11993 Fixed the generation of wrappers for global variables.
11994 Added the option [no]swig-lisp which turns on/off generation
11995 of code for swig helper lisp macro, functions, etc.
11996
William S Fultonb902ae02006-05-03 20:59:42 +000011997Version 1.3.29 (March 21, 2006)
11998===============================
11999
1200004/05/2006: mutandiz
12001 [allegrocl]
12002 Fix output typemap of char so it produces a character instead
12003 of an integer. Also adds input/output typemaps for 'char *'.
12004
12005 add command-line argument -isolate to generate an interface
12006 file that won't interfere with other SWIG generated files that
12007 may be used in the same application.
12008
1200903/20/2005: mutandiz
12010 [allegrocl]
12011 More tweaks to INPUT/OUTPUT typemaps for bool.
12012
12013 Fix constantWrapper for char and string literals.
12014
12015 find-definition keybindings should work in ELI/SLIME.
12016 Output (in-package <module-name>) to lisp wrapper
12017 instead of (in-package #.*swig-module-name*).
12018
12019 slight rework of multiple return values.
12020
12021 doc updates.
12022
1202303/17/2005: mutandiz
12024 [allegrocl]
12025 mangle names of constants generated via constantWrapper.
12026
12027 When using OUTPUT typemaps and the function has a non-void
12028 return value, it should be first in the values-list, followed
12029 by the OUTPUT mapped values.
12030
12031 Fix bug with boolean parameters, which needed to be
12032 passed in as int values, rather than T or NIL.
12033
1203403/15/2006: mutandiz
12035 [allegrocl]
12036 Generate wrappers for constants when in C++ or -cwrap mode.
12037 Make -cwrap the default, since it is most correct. Users
12038 can use the -nocwrap option to avoid the creation of a .cxx
12039 file when interfacing to C code.
12040
12041 When in -nocwrap mode, improve the handling of converting
12042 infix literals to prefix notation for lisp. This is very
12043 basic and not likely to be improved upon since this only
12044 applies to the -nocwrap case. Literals we can't figure out
12045 will result in a warning and be included in the generated
12046 code.
12047
12048 validIdentifier now more closely approximates what may be
12049 a legal common lisp symbol.
12050
12051 Fix typemap error in allegrocl.swg
12052
1205303/12/2006: mutandiz
12054 [allegrocl]
12055 fix up INPUT/OUTPUT typemaps for bool.
12056 Generate c++ style wrapper functions for struct/union members
12057 when -cwrap option specified.
12058
1205903/10/2006: mutandiz
12060 [allegrocl]
12061 Fix bug in C wrapper generation introduced by last allegrocl
12062 commit.
12063
1206403/10/2006: wsfulton
12065 [Java]
12066 Commit #1447337 - Delete LocalRefs at the end of director methods to fix potential leak
12067
1206803/10/2006: wsfulton
12069 Fix #1444949 - configure does not honor --program-prefix.
12070 Removed non-standard configure option --with-release-suffix. Fix the autoconf standard
12071 options --program-prefix and --program-suffix which were being shown in the help,
12072 but were being ignored. Use --program-suffix instead of --with-release-suffix now.
12073
1207403/10/2006: wsfulton
12075 [Java]
12076 Fix #1446319 with patch from andreasth - more than one wstring parameter in director methods
12077
1207803/07/2006: mkoeppe
12079 [Guile]
12080 Fix for module names containing a "-" in non-"shadow" mode.
12081 Patch from Aaron VanDevender (#1441474).
12082
1208303/04/2006: mmatus
12084 - Add -O to the main program, which now enables -fastdispatch
12085
12086 [Python]
12087
12088 - Add the -fastinit option to enable faster __init__
12089 methods. Setting 'this' as 'self.this.append(this)' in the python
12090 code confuses PyLucene. Now the initialization is done in the
12091 the C++ side, as reported by Andi and Robin.
12092
12093 - Add the -fastquery option to enable faster SWIG_TypeQuery via a
12094 python dict cache, as proposed by Andi Vajda
12095
12096 - Avoid to call PyObject_GetAttr inside SWIG_Python_GetSwigThis,
12097 since this confuses PyLucene, as reported by Andi Vajda.
12098
1209903/02/2006: wsfulton
12100 [Java]
12101 Removed extra (void *) cast when casting pointers to and from jlong as this
12102 was suppressing gcc's "dereferencing type-punned pointer will break strict-aliasing rules"
12103 warning. This warning could be ignored in versions of gcc prior to 4.0, but now the
12104 warning is useful as gcc -O2 and higher optimisation levels includes -fstrict-aliasing which
12105 generates code that doesn't work with these casts. The assignment is simply never made.
12106 Please use -fno-strict-aliasing to both suppress the warning and fix the bad assembly
12107 code generated. Note that the warning is only generated by the C compiler, but not
12108 the C++ compiler, yet the C++ compiler will also generate broken code. Alternatively use
12109 -Wno-strict-aliasing to suppress the warning for gcc-3.x. The typemaps affected
12110 are the "in" and "out" typemaps in java.swg and arrays_java.swg. Users ought to fix
12111 their own typemaps to do the same. Note that removal of the void * cast simply prevents
12112 suppression of the warning for the C compiler and nothing else. Typical change:
12113
12114 From:
12115 %typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)(void *)&$input; %}
12116 To:
12117 %typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %}
12118
12119 From:
12120 %typemap(out) SWIGTYPE * %{ *($&1_ltype)(void *)&$result = $1; %}
12121 To:
12122 %typemap(out) SWIGTYPE * %{ *($&1_ltype)&$result = $1; %}
12123
1212403/02/2006: mkoeppe
12125 [Guile -scm]
12126 Add typemaps for "long long"; whether the generated code compiles, however, depends
12127 on the version and configuration of Guile.
12128
1212903/02/2006: wsfulton
12130 [C#]
12131 Add support for inner exceptions. If any of the delegates are called which construct
12132 a pending exception and there is already a pending exception, it will create the new
12133 exception with the pending exception as an inner exception.
12134
1213503/02/2006: wsfulton
12136 [Php]
12137 Added support for Php5 exceptions if compiling against Php5 (patch from Olly Betts).
12138
1213903/01/2006: mmatus
12140 Use the GCC visibility attribute in SWIGEXPORT.
12141
12142 Now you can compile (with gcc 3.4 or later) using
12143 CFLAGS="-fvisibility=hidden".
12144
12145 Check the difference for the 'std_containers.i' python
12146 test case:
12147
12148 Sizes:
12149
12150 3305432 _std_containers.so
12151 2383992 _std_containers.so.hidden
12152
12153 Exported symbols (nm -D <file>.so | wc -l):
12154
12155 6146 _std_containers.so
12156 174 _std_containers.so.hidden
12157
Olly Bettsc6e4dea2013-10-15 11:25:11 +130012158 Execution times:
William S Fultonb902ae02006-05-03 20:59:42 +000012159
12160 real 0m0.050s user 0m0.039s sys 0m0.005s _std_containers.so
12161 real 0m0.039s user 0m0.026s sys 0m0.007s _std_containers.so.hidden
12162
12163 Read http://gcc.gnu.org/wiki/Visibility for more details.
12164
12165
1216602/27/2006: mutandiz
12167 [allegrocl]
12168 Add support for INPUT, OUTPUT, and INOUT typemaps.
12169 For OUTPUT variables, the lisp wrapper returns multiple
12170 values.
12171
1217202/26/2006: mmatus
12173
12174 [Ruby] add argcargv.i library file.
12175
12176 Use it as follow:
12177
12178 %include argcargv.i
12179
12180 %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) }
12181
12182 %inline {
12183 int mainApp(size_t argc, const char **argv)
12184 {
12185 return argc;
12186 }
12187 }
12188
12189 then in the ruby side:
12190
12191 args = ["asdf", "asdf2"]
12192 n = mainApp(args);
12193
12194
12195 This is the similar to the python version Lib/python/argcargv.i
12196
1219702/24/2006: mgossage
12198
12199 Small update Lua documents on troubleshooting problems
12200
1220102/22/2006: mmatus
12202
12203 Fix all the errors reported for 1.3.28.
12204 - fix bug #1158178
12205 - fix bug #1060789
12206 - fix bug #1263457
12207 - fix 'const char*&' typemap in the UTL, reported by Geoff Hutchison
12208 - fixes for python 2.1 and the runtime library
12209 - fix copyctor + template bug #1432125
12210 - fix [ 1432152 ] %rename friend operators in namespace
12211 - fix gcc warning reported by R. Bernstein
12212 - avoid assert when finding a recursive scope inheritance,
12213 emit a warning in the worst case, reported by Nitro
12214 - fix premature object deletion reported by Paul in tcl3d
12215 - fix warning reported by Nitro in VC7
12216 - more fixes for old Solaris compiler
12217 - fix for python 2.3 and gc_refs issue reported by Luigi
12218 - fix fastproxy for methods using kwargs
12219 - fix overload + protected member issue reported by Colin McDonald
12220 - fix seterrormsg as reported by Colin McDonald
12221 - fix directors, now the test-suite runs again using -directors
12222 - fix for friend operator and Visual studio and bug 1432152
12223 - fix bug #1435090
12224 - fix using + %extend as reported by William
12225 - fix bug #1094964
12226 - fix for Py_NotImplemented as reported by Olly and Amaury
12227 - fix nested namespace issue reported by Charlie
12228
12229 and also:
12230
12231 - allow director protected members by default
12232 - delete extra new lines in swigmacros[UTL]
12233 - cosmetic for generated python code
12234 - add the factory.i library for UTL
12235 - add swigregister proxy method and move __repr__ to a
12236 single global module [python]
12237
1223802/22/2006: mmatus
12239
12240 When using directors, now swig will emit all the virtual
12241 protected methods by default.
12242
12243 In previous releases, you needed to use the 'dirprot'
Olly Bettsc6e4dea2013-10-15 11:25:11 +130012244 option to achieve the same.
William S Fultonb902ae02006-05-03 20:59:42 +000012245
12246 If you want, you can disable the new default behaviour,
12247 use the 'nodirprot' option:
12248
12249 swig -nodirprot ...
12250
12251 and/or the %nodirector feature for specific methods, i.e.:
12252
12253 %nodirector Foo::bar;
12254
12255 struct Foo {
12256 virtual ~Foo();
12257
12258 protected:
12259 virtual void bar();
12260 };
12261
12262
12263 As before, pure abstract protected members are allways
12264 emitted, independent of the 'dirprot/nodirprot' options.
12265
12266
1226702/22/2006: mmatus
12268 Add the factory.i library for languages using the UTL (python,tcl,ruby,perl).
12269
12270 factory.i implements a more natural wrap for factory methods.
12271
12272 For example, if you have:
12273
12274 ---- geometry.h --------
12275 struct Geometry {
12276 enum GeomType{
12277 POINT,
12278 CIRCLE
12279 };
12280
12281 virtual ~Geometry() {}
12282 virtual int draw() = 0;
12283
12284 //
12285 // Factory method for all the Geometry objects
12286 //
12287 static Geometry *create(GeomType i);
12288 };
12289
12290 struct Point : Geometry {
12291 int draw() { return 1; }
12292 double width() { return 1.0; }
12293 };
12294
12295 struct Circle : Geometry {
12296 int draw() { return 2; }
12297 double radius() { return 1.5; }
12298 };
12299
12300 //
12301 // Factory method for all the Geometry objects
12302 //
12303 Geometry *Geometry::create(GeomType type) {
12304 switch (type) {
12305 case POINT: return new Point();
12306 case CIRCLE: return new Circle();
12307 default: return 0;
12308 }
12309 }
12310 ---- geometry.h --------
12311
12312
12313 You can use the %factory with the Geometry::create method as follows:
12314
12315 %newobject Geometry::create;
12316 %factory(Geometry *Geometry::create, Point, Circle);
12317 %include "geometry.h"
12318
12319 and Geometry::create will return a 'Point' or 'Circle' instance
12320 instead of the plain 'Geometry' type. For example, in python:
12321
12322 circle = Geometry.create(Geometry.CIRCLE)
12323 r = circle.radius()
12324
12325 where 'circle' now is a Circle proxy instance.
12326
12327
1232802/17/2006: mkoeppe
12329 [MzScheme] Typemaps for all integral types now accept the full range of integral
12330 values, and they signal an error when a value outside the valid range is passed.
12331 [Guile] Typemaps for all integral types now signal an error when a value outside
12332 the valid range is passed.
12333
1233402/13/2006: mgossage
12335 [Documents] updated the extending documents to give a skeleton swigging code
12336 with a few typemaps.
12337 [Lua] added an extra typemap for void* [in], so a function which requires a void*
12338 can take any kind of pointer
12339
William S Fulton4752a482006-02-12 21:37:49 +000012340Version 1.3.28 (February 12, 2006)
12341==================================
12342
1234302/11/2006: mmatus
12344 Fix many issues with line counting and error reports.
12345
1234602/11/2006: mmatus
12347 [Python] Better static data member support, if you have
12348
12349 struct Foo {
12350 static int bar;
12351 };
12352
12353 then now is valid to access the static data member, ie:
12354
12355 f = Foo()
12356 f.bar = 3
12357
12358 just as in C++.
12359
12360
1236102/11/2006: wsfulton
12362 [Perl]
12363 Fixed code generation to work again with old versions of Perl
12364 (5.004 and later tested)
12365
1236602/04/2006: mmatus
12367 [Python] Add the %extend_smart_pointer() directive to extend
12368 SWIG smart pointer support in python.
12369
12370 For example, if you have a smart pointer as:
12371
12372 template <class Type> class RCPtr {
12373 public:
12374 ...
12375 RCPtr(Type *p);
12376 Type * operator->() const;
12377 ...
12378 };
12379
12380 you use the %extend_smart_pointer directive as:
12381
12382 %extend_smart_pointer(RCPtr<A>);
12383 %template(RCPtr_A) RCPtr<A>;
12384
12385 then, if you have something like:
12386
12387 RCPtr<A> make_ptr();
12388 int foo(A *);
12389
12390 you can do the following:
12391
12392 a = make_ptr();
12393 b = foo(a);
12394
12395 ie, swig will accept a RCPtr<A> object where a 'A *' is
12396 expected.
12397
12398 Also, when using vectors
12399
12400 %extend_smart_pointer(RCPtr<A>);
12401 %template(RCPtr_A) RCPtr<A>;
12402 %template(vector_A) std::vector<RCPtr<A> >;
12403
12404 you can type
12405
12406 a = A();
12407 v = vector_A(2)
12408 v[0] = a
12409
12410 ie, an 'A *' object is accepted, via implicit conversion,
12411 where a RCPtr<A> object is expected. Additionally
12412
12413 x = v[0]
12414
12415 returns (and sets 'x' as) a copy of v[0], making reference
12416 counting possible and consistent.
12417
12418 %extend_smart_pointer is just a collections of new/old
12419 tricks, including %typemaps and the new %implicitconv
12420 directive.
12421
1242202/02/2006: mgossage
12423 bugfix #1356577, changed double=>lua_number in a few places.
12424 added the std::pair wrapping
12425
1242601/30/2006: wsfulton
12427 std::string and std::wstring member variables and global variables now use
12428 %naturalvar by default, meaning they will now be wrapped as expected in all languages.
12429 Previously these were wrapped as a pointer rather than a target language string.
12430 It is no longer necessary to add the following workaround to wrap these as strings:
12431
12432 %apply const std::string & { std::string *}
12433
12434 *** POTENTIAL INCOMPATIBILITY ***
12435
1243601/28/2006: mkoeppe
12437 [Guile -scm]
12438 Add typemaps for handling of member function pointers.
12439
1244001/24/2006: mmatus
12441 - Better support for the %naturalvar directive, now it
12442 works with the scripting languages as well as
12443 Java/C#.
12444
12445 Now, it can also be applied to class types:
12446
12447 %naturalvar std::string;
12448 %include <std_string.i>
12449
Sylvestre Ledru7dac1bc2012-08-08 09:19:26 +000012450 that will tell swig to use the 'natural' wrapping
William S Fulton4752a482006-02-12 21:37:49 +000012451 mechanism to all std::string global and member
12452 variables.
12453
12454 - Add support for the %allowexcept feature along the
12455 scripting languages, which allows the %exception feature
12456 to be applied to the variable access methods. Also, add
12457 the %exceptionvar directive to specify a distintic
12458 exception mechanism only for variables.
12459
12460
12461 - Add more docs for the %delobject directive to mark a method as a
12462 destructor, 'disowning' the first argument. For example:
12463
12464 %newobject create_foo;
12465 %delobject destroy_foo;
12466
12467 Foo *create_foo() { return new Foo(); }
12468 void destroy_foo(Foo *foo) { delete foo; }
12469
12470 or in a member method as:
12471
12472 %delobject Foo::destroy;
12473
12474 class Foo {
12475 public:
12476 void destroy() { delete this;}
12477
12478 private:
12479 ~Foo();
12480 };
12481
12482
1248301/24/2006: mgossage
12484 [Lua]
12485 - Removed the type swig_lua_command_info & replace with luaL_reg
12486 (which then broke the code), fixed this
12487 - added an additional cast in the typemaps for enum's
12488 due to the issue that VC.Net will not allow casting of
12489 a double to an enum directly. Therefore cast to int then to enum
12490 (thanks to Jason Rego for this observation)
12491
1249201/16/2006: mmatus (Change disabled... will be back in CVS soon)
12493 Add initial support for regexp via the external library
12494 RxSpencer. SWIG doesn't require this library to compile
12495 and/or run. But if you specify --with-rxspencer, and the
12496 library is found during installation, then swig will use
12497 it in three places:
12498
12499 - In %renames rules, via the new rxsmatch rules, for example:
12500
12501 %rename("%(lowercase)",rxsmatch$name="GSL_.*") "";
12502 %rename("%(lowercase)",rxsmatch$nodeType="enum GSL_.*") "";
12503
12504 rxsmatch is similar to the match rule, it just uses
12505 the RxSpencer regexp library to decide if there is a
12506 match with the provided regexp. As with the match
12507 rule, you can also use the negate rule notrxsmatch.
12508
12509 - In the %rename target name via the rxstarget option, for example:
12510
12511 %rename("%(lowercase)",rxstarget=1) "GSL_.*";
12512
12513 where the target name "GSL.*" is now understood as a
12514 regexp to be matched.
12515
12516 - In the new encoder "rxspencer", which looks like:
12517
12518 %(rxspencer:[regexp][replace])s
12519
12520 where "regexp" is the regular expression and "replace"
12521 is a string used as a replacement, where the @0,@1,...,@9
12522 pseudo arguments are used to represent the
12523 corresponding matching items in the reg expression.
12524
12525 For example:
12526
12527 %(rxspencer:[GSL.*][@0])s <- Hello ->
12528 %(rxspencer:[GSL.*][@0])s <- GSLHello -> GSLHello
12529 %(rxspencer:[GSL(.*)][@1])s <- GSLHello -> Hello
12530 %(rxspencer:[GSL(.*)][gsl@1])s <- GSLHello -> gslHello
12531
12532 Another example could be:
12533
12534 %rename("%(lowercase)s",sourcefmt="%(rxspencer:[GSL_(.*)][@1])s",%$isfunction) "";
12535
12536 which take out the prefix "GSL_" and returns all the
12537 function names in lower cases, as following:
12538
12539 void GSL_Hello(); -> hello();
12540 void GSL_Hi(); -> hi();
12541 const int GSL_MAX; -> GSL_MAX; // no change, is not a function
12542
12543 We use the RxSpencer as an initial test bed to
12544 implemention while we decide which library will be
12545 finally added to swig.
12546
12547 You can obtain the RxSpencer library from
12548
12549 http://arglist.com/regex (Unix)
12550
12551 or
12552
12553 http://gnuwin32.sourceforge.net/packages.html (Windows)
12554
12555 Once installed, use "man rxspencer" to get more info
12556 about the regexp format, or just google rxspencer.
12557
12558 Since now you can enable the rxsmatch rules (see above),
12559 the simple or '|' support for the match rules
12560 (01/12/2006: mmatus) is disabled. Still, if you have
12561 problems with the rxspencer library, you can re-enable
12562 the simple 'match or' support using
12563 -DSWIG_USE_SIMPLE_MATCHOR.
12564
12565
1256601/16/2006: mmatus
12567 Change the %rename predicates to use the prefix '%$', as in:
12568
12569 %rename("%(utitle)s",%$isfunction,%$ismember) "";
12570
Olly Betts2f3bf142014-02-23 16:52:08 +130012571 to avoid clashes with other swig macros/directives.
William S Fulton4752a482006-02-12 21:37:49 +000012572
1257301/14/2006: cfisavage
12574 [Ruby]
12575 Added support for Ruby bang! methods via a new %bang feature.
12576 Bang methods end in exclamation points and indicate that the
12577 object being processed will be modified in-place as
12578 opposed to being copied.
12579
1258001/12/2006: cfisavage
12581 [Ruby]
12582 Updated the Ruby module to automatically convert
12583 method names to lower_case_with_underscores using the
12584 new %rename functionality.
12585
1258601/12/2006: mmatus
12587 - Add aliases for 'case' encoders used with %rename/%namewarn
12588
12589 %(uppercase)s hello_world -> HELLO_WORLD
12590 %(lowercase)s HelloWorld -> helloworld
12591 %(camelcase)s hello_world -> HelloWorld
12592 %(undercase)s HelloWorld -> hello_world
12593
12594
1259501/12/2006: mmatus
12596 - Add the -dump_parse_module and -dump_parse_top options,
12597 which are similar to -dump_module and -dump_top, but they
12598 dump the node trees just after parsing, showing only the
12599 attributes visible at the parsing stage, and not the added
12600 later in typemap.cxx, allocate.cxx, lang.cxx or elsewhere.
12601
12602 Besides debugging porpuses, these options are very useful
12603 if you plan to use %rename in an "advance way", since it
12604 shows only and all the node's attributes you can use
12605 inside the match rules.
12606
12607
1260801/12/2006: mmatus
12609 - Add predicates to %rename, so, you don't need to
12610 remember, for example, how to match a member function.
12611
12612 Now it is easy, for example to use the 'utitle' encoder
12613 in all the member methods, you type:
12614
12615 %rename("%(utitle)s",%isfunction,%ismember) "";
12616
12617 or to ignore all the enumitems in a given class:
12618
12619 %rename("$ignore", %isenumitem, %classname="MyClass") "";
12620
12621 Available predicates are (see swig.swg):
12622
12623 %isenum
12624 %isenumitem
12625 %isaccess
12626 %isclass
12627 %isextend
12628 %isextend
12629 %isconstructor
12630 %isdestructor
12631 %isnamespace
12632 %istemplate
12633 %isconstant
12634
12635 %isunion
12636 %isfunction
12637 %isvariable
12638 %isimmutable
12639
12640 %isstatic
12641 %isfriend
12642 %istypedef
12643 %isvirtual
12644 %isexplicit
12645 %isextern
12646
12647 %ismember
12648 %isglobal
12649 %innamespace
12650
12651 %ispublic
12652 %isprotected
12653 %isprivate
12654
12655 %classname
12656
12657 These predicates correspond to specific 'match'
12658 declarations, which sometimes are not as evident as the
12659 predicates names.
12660
12661
12662 - Add the or '|' operation in %rename match, for
12663 example to capitalize all the constants (%constant or
12664 const cdecl):
12665
12666 %rename("%(upper)s",match="cdecl|constant",%isimmutable) "";
12667
12668
12669
1267001/12/2006: mgossage
12671 - Partial fixed of errors under C89, bug #1356574
12672 (converted C++ style comments to C style)
12673 - Added patches from [email protected] #1379988 and #1388343
12674 missing a 'return' statement for error conditions
12675 also updated the %init block bug #1356586
12676
1267701/10/2006: mmatus
12678 - Add the 'utitle' encoder, as an example of how to add
12679 your own encoder. I added the encoder method in misc.c
12680 but developers can add others, the same way, inside any
12681 target language.
12682
12683 Well, 'utitle' is the reverse of 'ctitle', ie:
12684
12685 %rename("%(ctitle)s") camel_case; -> CamelCase;
12686 %rename("%(utitle)s") CamelCase; -> camel_case;
12687
12688
1268901/10/2006: cfisavage
12690 [Ruby]
12691 Updated Ruby Exception handling. Classes that are specified in throws clauses,
12692 or are marked as %exceptionclass, are now inherited from rb_eRuntimeError.
12693 This allows instances of these classes to be returned to Ruby as exceptions.
12694 Thus if a C++ method throws an instance of MyException, the calling Ruby
12695 method will get back a MyException object. To see an example,
12696 look at ruby/examples/exception_class.
12697
1269801/10/2006: mmatus
12699
12700 - Add the %catches directive, which complements the %exception
12701 directive in a more automatic way. For example, if you have
12702
12703 int foo() throw(E1);
12704
12705 swig generates the proper try/catch code to dispatch E1.
12706
12707 But if you have:
12708
12709
12710 int barfoo(int i) {
12711 if (i == 1) {
12712 throw E1();
12713 } else {
12714 throw E2();
12715 }
12716 return 0;
12717 }
12718
12719 ie, where there is no explicit exception specification in the decl, you
12720 end up doing:
12721
12722 %exception barfoo {
12723 try {
12724 $action
12725 } catch(E1) { ... }
12726 } catch(E2) { ... }
12727 }
12728
12729 which is very tedious. Well, the %catches directive defines
12730 the list of exceptions to catch, and from swig:
12731
12732 %catches(E1,E2) barfoo(int i);
12733 int barfoo(int i);
12734
12735 is equivalent to
12736
12737 int barfoo(int i) throw(E1,E2);
12738
12739 Note, however, that the %catches list doesn't have to
12740 correspond to the C++ exception specification. For example, if you
12741 have:
12742
12743 struct E {};
12744 struct E1 : E {};
12745 struct E2 : E {};
12746
12747 int barfoo(int i) throw(E1,E2);
12748
12749 you can define
12750
12751 %catches(E) barfoo(int i);
12752
12753 and swig will generate an action code equivalent to
12754
12755 try {
12756 $action
12757 } catch(E &_e) {
12758 <raise _e>;
12759 }
12760
12761 Of course, you still have to satisfy the C++ restrictions,
12762 and the catches list must be compatible (not the same)
12763 as the original list of types in the exception specification.
12764
12765 Also, you can now specify that you want to catch the
12766 unknown exception '...', for example:
12767
12768 %catches(E1,E2,...) barfoo(int);
12769
12770 In any case, the %catches directive will emit the
12771 code to convert into the target language error/exception
12772 using the 'throws' typemap.
12773
12774 For the '...' case to work, you need to
12775 write the proper typemap in your target language. In the
12776 UTL, this looks like:
12777
12778 %typemap(throws) (...) {
12779 SWIG_exception(SWIG_RuntimeError,"unknown exception");
12780 }
12781
Mikel Bancroft4aabff82006-02-27 21:45:07 +00001278201/09/2006: mutandiz
12783 [Allegrocl]
12784
12785 Fixes a number of SEGVs primarily in the handling of
12786 various anonymous types. Found in a pass through the
12787 swig test-suite. Still more to do here, but this is a
12788 good checkpoint.
12789
12790 Adds -cwrap and -nocwrap as an allegrocl specific
12791 command-line argument. Controls generating of a C
12792 wrapper file when wrapping C code. By default only a
12793 lisp file is created for C code wrapping.
12794
12795 Doc updates for the command-line arguments and fixes as
12796 pointed out on swig-devel
William S Fulton4752a482006-02-12 21:37:49 +000012797
1279801/05/2006: wsfulton
12799 [Java] Fix unsigned long long and const unsigned long long & typemaps
12800 - Bug #1398394 with patch from Dries Decock
12801
1280201/06/2006: mmatus
12803 Add 'named' warning codes, now in addition to:
12804
12805 %warnfilter(813);
12806
12807 you can use
12808
12809 %warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE);
12810
12811 just use the same code name found in Source/Include/swigwarn.h
12812 plus the 'SWIG' prefix.
12813
12814 If a developer adds a new warning code, the Lib/swigwarn.swg file
12815 will be generated when running the top level make.
12816
1281701/05/2006: cfisavage
12818 [Ruby]
12819 Reimplemented object tracking for Ruby. The new implementation works
12820 by expanding the swig_class structure for Ruby by adding a trackObjects
12821 field. This field can be set/unset via %trackobjects as explained
12822 in the Ruby documentation. The new implementation is more robust
12823 and takes less code to implement.
12824
1282501/05/2006: wsfulton
12826 Fix for %extend and static const integral types, eg:
12827
12828 class Foo {
12829 public:
12830 %extend {
12831 static const int bar = 42;
12832 }
12833 };
12834
1283512/30/2005: mmatus
12836
12837 - Add info for old and new debug options:
12838
12839 -dump_top - Print information of the entire node tree, including system nodes
12840 -dump_module - Print information of the module node tree, avoiding system nodes
12841 -dump_classes - Print information about the classes found in the interface
12842 -dump_typedef - Print information about the types and typedefs found in the interface
12843 -dump_tags - Print information about the tags found in the interface
12844 -debug_typemap - Print information for debugging typemaps
12845 -debug_template - Print information for debugging templates
12846
12847 - Add the fakeversion. If you have a project that uses
12848 configure/setup.py, or another automatic building system
12849 and requires a specific swig version, let say 1.3.22
12850 you can use:
12851
12852 SWIG_FEATURES="-fakeversion 1.3.22"
12853
12854 or
12855
12856 swig -fakeversion 1.3.22
12857
12858 and then swig -version will report 1.3.22 instead of the
12859 current version.
12860
12861 Typical use would be
12862
12863 SWIG_FEATURES="-fakeversion 1.3.22" ./configure
12864
1286512/30/2005: mmatus
12866
12867 - Add option/format support to %rename and %namewarn.
12868 Now %namewarn can force renaming, for example:
12869
12870 %namewarn("314: import is a keyword",rename="_%s") "import";
12871
12872 and rename can also support format forms:
12873
12874 %rename("swig_%s") import;
12875
12876 Now, since the format is processed via swig Printf, you
12877 can use encoders as follows:
12878
12879 %rename("%(title)s") import; -> Import
12880 %rename("%(upper)s") import; -> IMPORT
12881 %rename("%(lower)s") Import; -> import
12882 %rename("%(ctitle)s") camel_case; -> CamelCase
12883
12884 This will allow us to add more encoders, as the
12885 expected one for regular expressions.
12886
12887 - Add the above 'ctitle' encoder, which does the camel case:
12888
12889 camel_case -> CamelCase
12890
12891 - Also, while we get the regexp support, add the 'command' encoder,
12892 you can use it as follows
12893
12894 %rename("%(command:sed -e 's/\([a-z]\)/\U\\1/' <<< )s") import;
12895
12896 then swig will popen the command
12897
12898 "sed -e 's/\([a-z]\)/\U\\1/' <<< import"
12899
12900 see below for anonymous renames for better examples.
12901
12902 - The rename directive now also allows:
12903
12904 - simple match: only apply the rename if a type match
12905 happen, for example
12906
12907 %rename(%(title)s,match="enumitem") hello;
12908
12909 enum Hello {
12910 hi, hello -> hi, Hello
12911 };
12912 int hello() -> hello;
12913
12914 - extended match: only apply the rename if the 'extended attribute' match
12915 occurred, for example:
12916
12917 // same as simple match
12918 %rename(%(title)s,match$nodeType="enumitem") hello;
12919
12920 enum Hello {
12921 hi, hello -> hi, Hello
12922 };
12923
12924 Note that the symbol '$' is used to define the attribute name in
12925 a 'recursive' way, for example:
12926
12927 // match only hello in 'enum Hello'
12928 %rename(%(title)s,match$parentNode$type="enum Hello") hello;
12929
12930 enum Hello {
12931 hi, hello -> hi, Hello // match
12932 };
12933
12934 enum Hi {
12935 hi, hello -> hi, hello // no match
12936 };
12937
12938 here, for Hello::hi, the "parentNode" is "Hello", and its "type"
12939 is "enum Hello".
12940
12941
12942 - Anonymous renames: you can use 'anonymous' rename directives, for example:
12943
12944 // rename all the enum items in Hello
12945 %rename(%(title)s,match$parentNode$type="enum Hello") "";
12946
12947 enum Hello {
12948 hi, hello -> Hi, Hello // match both
12949 };
12950
12951 enum Hi {
12952 hi, hello -> hi, hello // no match
12953 };
12954
12955 // rename all the enum items
12956 %rename(%(title)s,match$nodeType="enumitem") "";
12957
12958 // rename all the items in given command (sloooow, but...)
12959 %rename(%(command:<my external cmd>)s) "";
12960
12961
12962 Anonymous renames with commands can be very powerful, since you
12963 can 'outsource' all the renaming mechanism (or part of it) to an
12964 external program:
12965
12966 // Uppercase all (and only) the names that start with 'i'
12967 %rename("%(command:awk '/^i/{print toupper($1)}' <<<)s") "";
12968
12969 int imported() -> IMPORTED;
12970 int hello() -> hello
12971
12972 Note that if the 'command' encoder returns an empty string, swig
12973 understands that no rename is necessary.
12974
12975 Also note that %rename 'passes' the matched name. For example, in
12976 this case
12977
12978 namespace ns1 {
12979 int foo();
12980 }
12981
12982 namespace ns2 {
12983 int bar();
12984 }
12985
12986 the external program only receives "foo" and "bar". If needed,
12987 however, you can request the 'fullname'
12988
12989 %rename("%(command:awk 'awk '/ns1::/{l=split($1,a,"::"); print toupper(a[l])}'' <<<)s",fullname=1) "";
12990
12991 ns1::foo -> FOO
12992 ns2::bar -> bar
12993
12994 - Mixing encoders and matching: of course, you can do mix commands
12995 and match fields, for example:
12996
12997 %rename("%(<my encoder for fncs>)",match="cdecl") "";
12998 %rename("%(<my encoder for enums>)",match="enumitem") "";
12999 %rename("%(<my encoder for enums inside a class>)",match="enumitem",
13000 match$parentNode$parentNode$nodeType="class") "";
13001
13002 Use "swig -dump_parse_module" to see the attribute names you can use to
13003 match a specific case.
13004
13005 - 'sourcefmt' and 'targetfmt': sometimes you need to
13006 process the 'source' name before comparing, for example
13007
13008 %namewarn("314: empty is a keyword",sourcefmt="%(lower)s") "empty";
13009
13010 then if you have
13011
13012 int Empty(); // "Empty" is the source
13013
13014 you will get the keyword warning since 'Empty' will be
13015 lower cased, via the sourcefmt="%(lower)s" option,
13016 before been compared to the 'target' "empty".
13017
13018 There is an additional 'targetfmt' option to process the
13019 'target' before comparing.
13020
13021 - complementing 'match': you can use 'notmatch', for example
13022
13023 %namewarn("314: empty is a keyword",sourcefmt="%(lower)s",notmatch="namespace") "empty";
13024
13025 here, the name warning will be applied to all the symbols except namespaces.
13026
13027
1302812/30/2005: mmatus
13029
13030 - Add initial support for gcj and Java -> <target language> mechanism.
13031
13032 See examples in:
13033
13034 Examples/python/java
13035 Examples/ruby/java
13036 Examples/tcl/java
13037
13038 to see how to use gcj+swig to export java classes into
13039 python/ruby/tcl.
13040
13041 The idea is to put all the common code for gcj inside
13042
13043 Lib/gcj
13044
13045 and localize specific types such as jstring, as can be found
13046 in
13047
13048 Lib/python/jstring.i
13049 Lib/ruby/jstring.i
13050 Lib/tcl/jstring.i
13051
13052 Using the UTL, this is very easy, and the perl version for
13053 jstring.i will be next.
13054
13055
1305612/29/2005: mmatus
13057 - Add the copyctor feature/directive/option to enable the automatic
13058 generation of copy constructors. Use as in:
13059
13060 %copyctor A;
13061
13062 struct A {
13063
13064 };
13065
13066 then this will work
13067
13068 a1 = A();
13069 a2 = A(a1);
13070
13071 Also, since it is a feature, if you just type
13072
13073 %copyctor;
13074
13075 that will enable the automatic generation for all the
13076 classes. It is also equivalent to
13077
13078 swig -copyctor -c++ ...
13079
13080 Notes:
13081
13082 1.- The feature only works in C++ mode.
13083
13084 2.- The automatic creation of the copy constructor will
13085 usually produce overloading. Hence, if the target
13086 language doesn't support overloading, a special name
13087 will be used (A_copy).
13088
13089 3.- For the overloading reasons above, it is probably not
13090 a good idea to use the flag when, for example, you are
13091 using keywords in Python.
13092
13093 4.- The copyctor automatic mechanism follows more or less
13094 the same rules as the default constructor mechanism,
13095 i.e., a copy constructor will not be added if the
13096 class is abstract or if there is a pertinent non-public
13097 copy ctor in the class or its hierarchy.
13098
13099 Hence, it might be necessary for you to complete the
13100 class declaration with the proper non-public copy ctor
13101 to avoid a wrong constructor addition.
13102
13103 - Fix features/rename for templates ctor/dtor and other
13104 things around while adding the copyctor mechanism.
13105
13106
1310712/27/2005: mmatus
13108 - Add the 'match' option to typemaps. Assume you have:
13109
13110 %typemap(in) SWIGTYPE * (int res) {..}
13111 %typemap(freearg) SWIGTYPE * { if (res$argnum) ...}
13112
13113 then if you do
13114
13115 %typemap(in) A * {...}
13116
13117 swig will 'overload the 'in' typemap, but the 'freearg'
13118 typemap will be also applied, even when this is wrong. The old
13119 solutions is to write:
13120
13121 %typemap(in) A * {...}
William S Fultonc10a84c2022-08-20 22:14:58 +010013122 %typemap(freeag) A * ""
William S Fulton4752a482006-02-12 21:37:49 +000013123
13124 overload 'freearg' with an empty definition.
13125
13126 The problem is, however, there is no way to know you need
13127 to do that until you start getting broken C++ code, or
13128 worse, broken runtime code.
13129
13130 The same applies to the infamous 'typecheck' typemap,
13131 which always confuses people, since the first thing you do
13132 is to just write the 'in' typemap.
13133
13134 The 'match' option solves the problem, and if instead you write:
13135
13136 %typemap(in) SWIGTYPE * (int res) {..}
13137 %typemap(freearg,match="in") SWIGTYPE * { if (res$argnum) ...}
13138 %typemap(typecheck,match="in",precedence...) SWIGTYPE * {...}
13139
13140 it will tell swig to apply the 'freearg/typecheck'
13141 typemaps only if they 'match' the type of the 'in'
13142 typemap. The same can be done with other typemaps as:
13143
13144 %typemap(directorout) SWIGTYPE * {...}
13145 %typemap(directorfree,match="directorout") SWIGTYPE * {...}
13146
13147
1314812/27/2005: mmatus
13149 - Add the 'naturalvar' option/mode/feature to treat member
13150 variables in a more natural way, ie, similar to the global
13151 variable behavior.
13152
13153 You can use it in a global way via the command line
13154
13155 swig -naturalvar ...
13156
13157 or the module mode option
13158
13159 %module(naturalvar=1)
13160
13161 both forms make swig treat all the member variables in the
13162 same way it treats global variables.
13163
13164 Also, you can use it in a case by case approach for
13165 specific member variables using the directive form:
13166
13167 %naturalvar Bar::s;
13168
13169 Then, in the following case for example:
13170
13171 std::string s;
13172 struct Bar {
13173 std::string s;
13174 };
13175
13176 you can do:
13177
13178 b = Bar()
13179 b.s ="hello"
13180 cvar.s = "hello"
13181
13182 if (b.s != cvar.s):
13183 raise RuntimeError
13184
13185
13186 This is valid for all the languages, and the
13187 implementation is based on forcing the use of the
13188 const SWIGTYPE& (C++)/SWIGTYPE (C) typemaps for the
13189 get/set methods instead of the SWIGTYPE * typemaps.
13190 Hence, for 'naturalvar' to work, each target language
13191 must implement 'typemap(in/out) const Type&' properly.
13192
13193 The 'naturalvar' option replaces or makes workarounds such as:
13194
13195 %apply const std::string & { std::string *}
13196
13197 unnecessary.
13198
13199 Note1: If your interface has other kinds of workarounds to
13200 deal with the old 'unnatural' way to deal with member
13201 variables (returning/expecting pointers), the
13202 'naturalvar' option could break them.
13203
13204 Note2: the option has no effect on unnamed types, such
13205 as unnamed nested unions.
13206
13207
1320812/27/2005: mmatus
13209 - Add more 'expressive' result states for the typemap
13210 libraries.
13211
13212 In the past, for scripting languages, you would do checking something like:
13213
13214 if (ConvertPtr(obj,&vptr,ty,flags) != -1) {
13215 // success
13216 } else {
13217 // error
13218 }
13219
13220 Now the result state can carry more information,
13221 including:
13222
13223 - Error state: like the old -1/0, but with error codes from swigerrors.swg.
13224
13225 int res = ConvertPtr(obj,&vptr,ty,flags);
13226 if (SWIG_IsOK(res)) {
13227 // success code
13228 } else {
13229 SWIG_Error(res); // res carries the error code
13230 }
13231
13232 - Cast rank: when returning a simple successful
13233 conversion, you just return SWIG_OK, but if you need
13234 to do a 'cast', you can add the casting rank, ie:
13235
13236 if (PyFloat_Check(obj)) {
13237 value = PyFloat_AsDouble(obj);
13238 return SWIG_OK;
13239 } else if (PyInt_Check(obj)) {
13240 value = (double) PyInt_AsLong(obj);
13241 return SWIG_AddCast(SWIG_OK);
13242 }
13243
13244 later, the casting rank is used to properly dispatch
13245 the overloaded function, for example. This of course
13246 requires your language to support and use the new
13247 dispatch cast/rank mechanism (Now mainly supported in
13248 perl and python, and easily expandable to ruby and tcl).
13249
13250 - [UTL] Add support for the new 'expressive' result states.
13251
1325212/27/2005: mmatus
13253 - Add support for the C++ implicit conversion mechanism, which
13254 required some modifications in parser.y (to recognize
13255 'explicit') and overload.cxx (to replace $implicitconv as
13256 needed).
13257
13258 Still, real support in each target language requires each
13259 target language to be modified. Python provides an example,
13260 see below.
13261
13262
13263 - Add support for native C++ implicit conversions, ie, if you
13264 have
13265
13266 %implicitconv A;
13267
13268 struct A {
13269 int ii;
13270 A() {ii = 1;}
13271 A(int) {ii = 2;}
13272 A(double) {ii = 3;}
13273 explicit A(char *s) {ii = 4;}
13274 };
13275
13276 int get(const A& a) {return a.ii;}
13277
13278 you can call:
13279
13280 a = A()
13281 ai = A(1)
13282 ad = A(1.0)
13283 as = A("hello")
13284
13285 # old forms
13286 get(a) -> 1
13287 get(ai) -> 2
13288 get(ad) -> 3
13289 get(as) -> 4
13290
13291 #implicit conversions
13292 get(1) -> 2
13293 get(1.0) -> 3
13294 get("hello") -> Error, explicit constructor
13295
13296 Also, as in C++, now implicit conversions are supported in
13297 variable assigments, and if you have:
13298
13299 A ga;
13300 struct Bar {
13301 A a;
13302 };
13303
13304 you can do:
13305
13306 cvar.ga = A(1)
13307 cvar.ga = 1
13308 cvar.ga = 1.0
13309 cvar.ga = A("hello")
13310 cvar.ga = "hello" -> error, explicit constructor
13311
13312 b = Bar()
13313 b.a = A("hello")
13314 b.a = 1
13315 b.a = 1.0
13316 b.a = "hello" -> error, explicit constructor
13317
13318 Note that the last case, assigning a member var directly,
13319 also requires the 'naturalvar' option.
13320
13321 This support now makes the old '%implicit' macro, which
13322 was found in 'implicit.i' and it was fragile in many ways,
13323 obsolete, and you should use the new '%implicitconv'
13324 directive instead.
13325
13326 Note that we follow the C++ conventions, ie, in the
13327 following the implicit conversion is allowed:
13328
13329 int get(A a) {return a.ii;}
13330 int get(const A& a) {return a.ii;}
13331
13332 but not in these cases:
13333
13334 int get(A *a) {return a->ii;}
13335 int get(A& a) {return a.ii;}
13336
13337 Also, it works for director methods that return a by value
13338 result, ie, the following will work:
13339
13340 virtual A get_a() = 0;
13341
13342 def get_a(self):
13343 return 1
13344
13345 but not in this case:
13346
13347 virtual const A& get_a() = 0;
13348 virtual A& get_a() = 0;
13349 virtual A* get_a() = 0;
13350
13351 Notes:
13352
13353 - the implicitconv mechanism is implemented by directly
13354 calling/dispatching the python constructor, triggering a
13355 call to the __init__method. Hence, if you expanded the
13356 __init__ method, like in:
13357
13358 class A:
13359 def __init__(self,args):
13360 <swig code>
13361 <my code here>
13362
13363 then 'my code' will also be executed.
13364
13365 - Since the %implicitconv directive is a SWIG feature, if you type:
13366
13367 %implicitconv;
13368
13369 that will enable implicit conversion for all the classes in
13370 your module.
13371
13372 But if you are worried about performance, maybe that will be
13373 too much, especially if you have overloaded methods, since
13374 to resolve the dispatching problem, python will efectively
13375 try to call all the implicit constructors as needed.
13376
13377 - For the same reason, it is highly recommended that you use
13378 the new 'castmode' when mixing implicit conversion and
13379 overloading.
13380
13381 - [python] The %implicit directive is declared obsolete, and
13382 you should use %implicitconv instead. If you include
13383 the implicit.i file, a warning will remind you of this.
13384
13385 Note: Since %implicit is fragile, just replacing it by
13386 %implicitconv could lead to different behavior. Hence, we
13387 don't automatically switch from to the other, and the user
13388 must migrate to the new %implicitconv directive manually.
13389
13390
1339112/26/2005: wsfulton
13392 [C#]
13393 Modify std::vector wrappers to use std::vector::value_type as this is
13394 closer to the real STL declarations for some methods, eg for push_back().
13395 Fixes some compilation errors for some compilers eg when the templated
13396 type is a pointer.
13397
13398 [Java]
13399 std::vector improvements - a few more methods are wrapped and specializations are
13400 no longer required. The specialize_std_vector macro is no longer needed (a
13401 warning is issued if an attempt is made to use it).
13402
1340312/26/2005: wsfulton
13404 [Java, C#]
13405 Add in pointer reference typemaps. This also enables one to easily wrap
13406 std::vector<T> where T is a pointer.
13407
1340812/24/2005: efuzzyone
13409 [CFFI] The cffi module for SWIG:
13410 - Fully supports C, but provides limited supports for C++, in
13411 particular C++ support for templates and overloading needs to
13412 be worked upon.
13413
1341412/23/2005: mmatus
13415 [python] Add the castmode that allows the python
13416 type casting to occur.
13417
13418 For example, if you have 'int foo(int)', now
13419
13420 class Ai():
13421 def __init__(self,x):
13422 self.x = x
13423 def __int__(self):
13424 return self.x
13425
13426 foo(1) // Ok
13427 foo(1.0) // Ok
13428 foo(1.3) // Error
William S Fulton9f75dfd2023-12-24 13:44:34 +000013429 ai = Ai(4)
William S Fulton4752a482006-02-12 21:37:49 +000013430 foo(ai) // Ok
13431
13432 The castmode, which can be enabled either with the
13433 '-castmode' option or the %module("castmode") option, uses
13434 the new cast/rank dispatch mechanism. Hence, now if you
13435 have 'int foo(int); int foo(double);', the following works
13436 as expected:
13437
13438 foo(1) -> foo(int)
13439 foo(1.0) -> foo(double)
13440 ai = Ai(4)
13441 foo(ai) -> foo(int)
13442
13443 Note1: the 'castmode' could disrupt some specialized
13444 typemaps. In particular, the "implicit.i" library seems to
13445 have problem with the castmode. But besides that one, the
13446 entire test-suite compiles fine with and without the
13447 castmode.
13448
13449 Note2: the cast mode can't be combined with the fast
13450 dispatch mode, ie, the -fastdispatch option has no effect
13451 when the cast mode is selected. The penalties, however,
13452 are minimum since the cast dispatch code is already based
13453 on the same fast dispatch mechanism.
13454
13455 See the file overload_dispatch_cast_runme.py file for
13456 new cases and examples.
13457
1345812/22/2005: mmatus
13459 Add the cast and rank mechanism to dispatch overloading
13460 functions. The UTF supports it now, but for each language
13461 it must be decided how to implement and/or when to use it.
13462
13463 [perl] Now perl uses the new cast and rank dispatch
13464 mechanism, which solves all the past problems known
13465 in perl, such as the old '+ 1' problem:
13466
13467 int foo(int);
13468
13469 $n = 1
13470 $n = $n + 1
13471 $r = foo(n)
13472
13473 also works:
13474
13475 foo(1);
13476 foo("1");
13477 foo(1.0);
13478 foo("1.0");
13479
13480 but fails
13481
13482 foo("l");
13483
13484 and when overloading foo(int) and foo(double);
13485
13486 foo(1) -> foo(int)
13487 foo(1.0) -> foo(double)
13488 foo("1") -> foo(int)
13489 foo("1.0") -> foo(double)
13490 foo("l") -> error
13491 foo($n) -> foo(int) for good perl versions
13492 foo($n) -> foo(double) for old bad perl versions
13493
13494 when overloading foo(int), foo(char*) and foo(double):
13495
13496 foo(1) -> foo(int)
13497 foo(1.0) -> foo(double)
13498 foo("1") -> foo(char*)
13499 foo("1.0") -> foo(char*)
13500 foo("l") -> foo(char*)
13501
13502 Note: In perl the old dispatch mechanism was broken,
13503 so, we don't provide an option to enable the old one
13504 since, again, it was really really broken.
13505
13506 See 'overload_simple_runme.pl' for more cases and tests.
13507
13508 PS: all the old known issues are declared resolved, any
13509 new "problem" that could be discovered is declared,
13510 a priori, as "features" of the new dispatch mechanism
13511 (until we find another solution at least).
13512
13513
13514 *** POTENTIAL INCOMPATIBILITY ***
13515
13516 As with the introduction of the UTF, some things could
13517 now start to work as expected, and people used to deal or
13518 workaround previous bugs related to the dispatch
13519 mechanism, could see now a difference in perl behavior.
13520
1352112/21/2005: mmatus
13522 - The '-nodefault' flag (pragma and feature) now generates
13523 a warning, and recommends to use the explicit
13524 -nodefaultctor and -nodefaultdtor options.
13525
13526 The reason to split the 'nodefault' behavior is that, in
13527 general, ignoring the default destructor generates memory
13528 leaks in the target language. Hence, is too risky just to
13529 disable both the default constructor and destructor
13530 at the same time.
13531
13532 If you need to disable the default destructor, it is
13533 also recommended you use the directive form:
13534
13535 %nodefaultdtor MyVerySpecialClass;
13536
13537 for specific classes, and always avoid using the global
13538 -nodefault and -nodefaultdtor options.
13539
1354012/21/2005: wsfulton
13541 [Java, C#]
13542 Fix incorrect code generation when the intermediary classname is changed
13543 in the module directive from its default. For example:
13544
13545 %module(jniclassname="myimclassnewname") "mymodule" // Java
13546 %module(imclassname="myimclassnewname") "mymodule" // C#
13547
13548 Add in new special variable $imclassname. See docs.
13549
1355012/17/2005: mmatus
13551 [Python]
13552 - Add the -aliasobj0/-noaliasobj0 options to use with
13553 -fastunpack and/or -O and old typemaps that use 'obj0'
13554 directly.
13555
13556 So, if you compile your code using -O and get errors about
13557 the undeclared 'obj0' variable, run again using
13558
13559 swig -O -aliasobj0 -python ....
13560
13561 For new typemaps, never use 'obj0' directly, if needed,
13562 use the '$self' name that will be properly expanded to
13563 'obj0' (nofastunpack) or 'swig_obj[0]' (fastunpack).
13564
13565 If you have no idea what I am talking about, better, that
13566 means you have no typemap with this problem.
13567
13568
1356912/14/2005: mmatus
13570 [Python]
13571 - Add the -fastunpack/-nofastunpack options to enable/disable
13572 the use of the internal UnpackTuple method, instead of
13573 calling the one from the python C API.
13574
13575 The option -O now also implies -fastunpack.
13576
13577
1357812/11/2005: mmatus
13579 [Python]
13580 - Add the -proxydel/-noproxydel options to enable/disable
13581 the generation of proxy/shadow __del__ methods, even
13582 when now they are redundant, since they are empty.
13583 However, old interfaces could rely on calling them.
13584
13585 The default behavior is to generate the __del__ methods
13586 as in 1.3.27 or older swig versions.
13587
13588 The option -O now also implies -noproxydel.
13589
1359012/10/2005: mmatus
13591 [UTF]
Olly Bettsf9106072016-01-12 13:37:39 +130013592 - Fix unnecessary calls to SWIG_TypeQuery for 'char *'
William S Fulton4752a482006-02-12 21:37:49 +000013593 and 'wchar_t *', problem found by Clay Culver while
13594 profiling the PyOgre project.
13595
13596
13597 [Python]
13598 - Add the -dirvtable/-nodirvtable to enable/disable
13599 a pseudo virtual table used for directors, avoiding
13600 the need to resolve the python method at each call.
13601
13602 - Add the -safecstrings/-nosafecstrings options to
13603 enable/disable the use of safe conversions from PyString
13604 to char *. Python requires you to never change the internal
13605 buffer directly, and hence 'safectrings' warranties that
13606 but returning a copy of the internal python string buffer.
13607
13608 The default, as in previous releases, is to return a
13609 pointer to the buffer (nosafecstrings), so, it is the user's
13610 responsibility to avoid its modification.
13611
13612 - Add the -O option to enable all the optimization options
13613 at once, initially equivalent to
13614
13615 -modern -fastdispatch -dirvtable -nosafecstrings -fvirtual
13616
1361712/08/2005: mmatus
13618
13619 - Add the -fastdispatch option (fastdispatch feature). This
13620 enables the "fast dispatch" mechanism for overloaded
13621 methods provided by Salvador Fandi~no Garc'ia (#930586).
13622
13623 The resulting code is smaller and faster since less type
13624 checking is performed. However, the error messages you
13625 get when the overloading is not resolved could be
13626 different from what the traditional method returns.
13627
13628 With the old method you always get an error such as
13629
13630 "No matching function for overloaded ..."
13631
13632 with the new method you can also get errors such as
13633
13634 "Type error in argument 1 of type ..."
13635
13636 See bug report #930586 for more details.
13637
13638 So, this optimization must be explicitly enabled by users.
13639
13640 The new mechanism can be used as:
13641
13642 swig -fastdispatch
13643
13644 or using the feature form
13645
13646 %feature("fastdispatch") method;
13647 or
13648 %fastdispatch method;
13649
13650
1365112/06/2005: mmatus
13652
13653 - Several memory and speed improvements, specially for
13654 templates. Now swig is up to 20 faster than before for
13655 large template interfaces, such as the std_containers.i
13656 and template_matrix.i files in the python test-suite.
13657
13658 Memory footprint is also reduced in consideration of small
13659 pcs/architectures.
13660
13661 - add commandline options -cpperraswarn and -nocpperraswarn" to force
13662 the swig preprocessor to treat the #error directive as a #warning.
13663
13664 the pragmas
13665
13666 #pragma SWIG cpperraswarn=1
13667 #pragma SWIG cpperraswarn=0
13668
13669 are equivalent to the command line options, respectively.
13670
13671
1367212/06/2005: mmatus
13673 [Python] The generated code is now more portable, especially
13674 for Windows. Following
13675
13676 http://www.python.org/doc/faq/windows.html
13677
13678 Py_None is never accessed as a structure, plus other
13679 tricks mentioned there.
13680
1368112/06/2005: mmatus
13682 [Python] Added initial support for threads based in the
13683 proposal by Joseph Winston.
13684
13685 The user interface is as follows:
13686
13687 1.- the module thread support is enable via the "threads" module
13688 option, i.e.
13689
13690 %module("threads"=1)
13691
13692 2.- Equivalent to that, is the new '-threads' swig option
13693
13694 swig -threads -python ...
13695
13696 3.- You can partially disable thread support for a given
13697 method using:
13698
13699 %feature("nothread") method;
13700 or
13701 %nothread method;
13702
13703 also, you can disable sections of the thread support,
13704 for example
13705
13706 %feature("nothreadblock") method;
13707 or
13708 %nothreadblock method;
13709
13710 %feature("nothreadallow") method;
13711 or
13712 %nothreadallow method;
13713
13714 the first disables the C++/python thread protection, and the
13715 second disables the python/C++ thread protection.
13716
13717 4.- The current thread support is based in the PyGIL
13718 extension present in python version 2.3 or later, but
13719 you can provide the thread code for older versions by
13720 defining the macros in pythreads.swg.
13721
13722 If you get a working implementation for older versions,
13723 please send us a patch.
13724
13725 For the curious about performance, here are some numbers
13726 for the profiletest.i test, which is used to check the speed
13727 of the wrapped code:
13728
13729 nothread 9.6s (no thread code)
13730 nothreadblock 12.2s (only 'allow' code)
13731 nothreadallow 13.6s (only 'block' code)
13732 full thread 15.5s ('allow' + 'block' code)
13733
13734 i.e., full thread code decreases the wrapping performance by
13735 around 60%. If that is important to your application, you
13736 can tune each method using the different 'nothread',
13737 'nothreadblock' or 'nothreadallow' features as
13738 needed. Note that for some methods deactivating the
13739 'thread block' or 'thread allow' code is not an option,
13740 so, be careful.
13741
13742
1374311/26/2005: wsfulton
13744 SWIG library files use system angle brackets everywhere for %include, eg
13745 %include "std_common.i"
13746 becomes
13747 %include <std_common.i>
13748
1374911/26/2005: wsfulton
13750 [Java, C#]
13751 Typesafe enums and proper enums have an extra constructor so that enum item values that
13752 are initialised by another enum item value can be wrapped without having to use %javaconstvalue/
13753 %csconstvalue for when using %javaconst(1)/%csconst(1). Suggestion by
13754 Bob Marinier/Douglas Pearson.
13755 For example:
13756
13757 typedef enum
13758 {
13759 xyz,
13760 last = xyz
13761 } repeat;
13762
1376311/21/2005: mmatus
13764 [ruby + python]
13765
13766 Fixes for directors + pointers. This is an ugly problem without an easy
13767 solution. Before we identified this case as problematic:
13768
13769 virtual const MyClass& my_method();
13770
13771 but it turns out that all the cases where a pointer, array or
13772 reference is returned, are problematic, even for
13773 primitive types (as int, double, char*, etc).
13774
13775 To try to fix the issue, a new typemap was added,
13776 'directorfree', which is used to 'free' the resources
13777 allocated during the 'directorout' phase. At the same
13778 time, a primitive garbage collector engine was added to
13779 deal with orphaned addresses, when needed.
13780
13781 The situation is much better now, but still it is possible to have
13782 memory exhaustation if recursion is used.
13783
13784 So, still you need to avoid returning pointers, arrays or
13785 references when using director methods.
13786
13787 - Added stdint.i - typemaps for latest C99 integral types found in stdint.h.
13788
1378911/14/2005: wsfulton
13790 More types added to windows.i, eg UINT8, WORD, BYTE etc.
13791 Including windows.i will also enable SWIG to parse the __declspec Microsoft
13792 extension, eg __declspec(dllimport). Also other Windows calling conventions
13793 such as __stdcall.
13794
1379511/10/2005: wsfulton
13796 New library file for Windows - windows.i. This file will contain useful type
13797 information for users who include windows.h. Initial support is for the
13798 non ISO integral types: __int8, __int16, __int32, __int64 and unsigned versions.
13799 The unsigned versions previously could not be parsed by SWIG. SF #872013.
13800
1380111/09/2005: wsfulton
13802 [Java, C#] Portability warning for files which will overwrite each other on case
13803 insensitive file systems such as FAT32/NTFS. This will occur, for example, when two
13804 class names are the same barring case. The warning is issued on all platforms and
13805 can be suppressed with the usual warning suppression techniques. SF bug #1084507.
13806
1380711/09/2005: wsfulton
13808 ./configure --with-python --with-ruby --with-perl5 etc enable these languages,
13809 ie the --with-xxxx options, where no path is specified, work the same as if
13810 the option was not specified at all. Based on patches #1335042 #1329048 #1329047.
13811
1381211/09/2005: dancy
13813
13814 [Allegrocl]
13815 Add C++ support to the Allegrocl module. Further
13816 enhances the C support as well. Some of the
13817 features:
13818
13819 - MUCH better generation of foreign types based on
13820 the C/C++ types for use in defining the FFI on
13821 the lisp side. We don't pass everything as a (* :void)
13822 any longer.
13823
13824 - Uses typemaps for better control of type conversions
13825 and code generation in the generated lisp and c++ wrapper
13826 code.
13827
13828 - CLOS wrapping of pointers returned from foreign space
13829 makes it easier to differentiate pointers in user code.
13830 The wrapping objects can be passed directly to FF calls.
13831
13832 - Defun wrapping of FF calls, allowing for more lispy
13833 interface. Conversion, GCing, of lisp objects to
13834 foreign objects can be done in the wrapping defun via
13835 the use of typemaps.
13836
13837 - overload dispatching implemented on the lisp side
13838 using generic functions.
13839
13840 - Templates and synonymous types supported.
13841
1384211/07/2005: mmatus
13843
13844 [Python] Adding proper support for multi-inheritance in
13845 the python side, ie, if you have two C++ wrapped class, Foo
13846 and Bar, now:
13847
13848 class MyPythonClass(Foo,Bar):
13849 ....
13850
13851 will properly work, even with directors, and the
13852 deallocation of Foo.this and Bar.this will follow
13853 correctly. Before, a class could only have one 'this'
13854 instance (unlike C++), only the last base class was
13855 properly deleted, or detected with directors.
13856
13857 Now 'self.this' can be a list, which will contain the C++
13858 instance pointers for all the base classes.
13859
13860 Also, swig.this is responsible for deallocating the C++
13861 instance(s), and the __del__ method is not emitted unless
13862 the user preppend/append some code to it.
13863
13864 - Swig can now detect memory leaks, ie, if you still
13865 don't use proxy/shadow classes, and type something like
13866
13867 import _example
13868 f = _example.new_Foo()
13869
13870 and forget to call _example.delete_Foo(f), then swig will
13871 tell you that there is a memory leak.
13872
13873 Otherwise, if you always use the proxy classes, you probably
13874 you will never ever see this warning unless there is
13875 something wrong inside the swig wrapping code.
13876
13877
13878 *** POTENTIAL INCOMPATIBILITY ***
13879
13880 If you overloaded the __del__ method, and call the base
13881 one without a try block, as in
13882
13883 class MyClass(SwigClass):
13884
13885 def __del__(self):
13886 <your code here>
13887 SwigClass.__del__(self)
13888
13889 python could complain that the method SwigClass.__del__ is
13890 undefined. Try to use instead:
13891
13892 def __del__(self):
13893 <your code here>
13894 try: SwigClass.__del__(self)
13895 except: pass
13896
13897 or simply
13898
13899 def __del__(self):
13900 <your code here>
13901
1390211/02/2005: mmatus
13903
13904 [Python] Adding more fun to STL/STD containers, now you
13905 can do
13906
13907 %template(pyset) std::set<PyObject *>;
13908 %template(pyvector) std::vector<PyObject *>;
13909 %template() std::pair<PyObject *,PyObject *>;
13910 %template(pyvector) std::map<PyObject *,PyObject *>;
13911 ....
13912
13913 The same applies to std::list, std::deque, std::multiset, etc.
13914
13915 Then, at the python side you can do now:
13916
13917 # C++ std::vector as native python sequence
13918 v = pyvector([1,"hello",(1,2)])
13919 print v[1]
13920 >> 'hello'
13921 print v[2]
13922 >> (1,2)
13923
13924 # C++ std::set as native python sequence
13925 s = pyset()
13926 s.insert((1,2))
13927 s.insert(1)
13928 s.insert("hello")
13929 sum=()
13930 for i in s:
13931 sum +=(i,)
13932 print sum
13933 >>> (1, 'hello', (1, 2))
13934
13935 # C++ std::map as native python sequence
13936 m = pymap()
13937 m["foo"] = "hello"
13938 m[1] = (1,2)
13939 pm = {}
13940 for k in m:
13941 pm[k] = m[k]
13942 print pm
13943 >>> {1: (1, 2), 'foo': 'hello'}
13944
13945 ie, the STD/STL containers work as real native python
13946 container, with arbitrary item types and so.
13947
13948 But since normal C++ containers do not properly ref/unref
13949 their items, you should use the safer versions:
13950
13951 %template(pyset) std::set<swig::PyObject_ptr>;
13952 %template(pyvector) std::vector<swig::PyObject_ptr>;
13953 %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
13954 %template(pyvector) std::map<swig::PyObject_ptr,swig::PyObject_ptr>;
13955 ....
13956
13957 where swig::PyObject_ptr is a PyObject * envelope class provided
13958 to safely incref/decref the python object.
13959
13960 So, now you can use all the STL/STD containers as native
13961 Python containers.
13962
13963 Note 1: std::map, std::set and the other 'ordered'
13964 containers will properly use PyObject_Compare for sorting,
13965 when needed.
13966
13967 Note 2: all the STL/STD containers have a limit size of
13968 SIZE_MAX, ie, you can have manage containers larger than
13969 INT_MAX, the python limit.
13970
13971
1397211/02/2005: mmatus
13973
13974 [Python]
13975 - add 'iterator()' method for all sequences and additionally
13976 'key_iterator()' for maps.
13977
13978 'iterator()' will always return the native C++ iterator.
13979 Additionally, in maps, 'key_iterator()' will return a python
13980 iterator using only the map keys.
13981
13982 In general the sequence method __iter__ will call
13983 'iterator()', returning the native C++ iterator, but in
13984 maps it will call 'key_iterator()', maintaining
13985 backward compatibility.
13986
13987 Hence, for std::maps, you can play then with the native
13988 C++ iterator, which value is a (key, value) pair, by
13989 calling map.iterator(), as with map.begin(), map.end(), etc.
13990
13991 The difference is that map.iterator() returns a safe
13992 'closed' iterator, while map.begin() and map.end() are
13993 'open' iterators.
13994
13995 A 'closed' iterator knows the begin and the end of the
13996 sequence, and it never can seg. fault. An 'open'
13997 iterator, as in C++, can seg. fault at the C++ side.
13998
13999 # a closed iterator is safe in the following example.
14000 # the next() method will throw a StopIteration
14001 # exception as needed
14002
14003 i = seq.iterator()
14004 try:
14005 while True:
14006 sum += i.next()
14007 except: pass
14008
14009 # an open iterator always need to be checked,
14010 # or it will crash at the C++ side
14011
14012 current = seq.begin()
14013 end = seq.end()
14014 while (current != end):
14015 sum += current.next()
14016
14017
14018 [Python]
14019 - Finally, when we call
14020
14021 f = Foo()
14022
14023 the construction is 'one-way'. Before construction was done
14024 something like
14025
14026 Foo() (python) -> _new_Foo() (C++)
14027 new_Foo() (C++) -> FooPtr() (python)
14028 FooPtr() (python) -> Foo() (python)
14029
14030 and returning a pointer was done like
14031
14032 NewPointerObj() (C++) -> FooPtr() (python)
14033 FooPtr(python) -> Foo() (python)
14034
14035
14036 ie, we when going back and forward between the C++ and
14037 python side.
14038
14039 Now since there is no FooPtr the construction process is
14040
14041 Foo() (python) -> _new_Foo() (C++)
14042 _new_Foo() (C++) -> NewPointerObj() (C++) (no shadow class)
14043
14044 and returning a pointer is done
14045
14046 NewPointerObj() (C++) (with shadow class) -> NewInstaceObj() (C++)
14047
14048 where NewInstanceObj creates a new instance without
14049 calling __init__ and it doesn't go 'back' to python, is
14050 'pure' C API.
14051
14052 - With this change, and the other ones in the
14053 PySwigObject type, which now carries the thisown and
14054 swig_type_info pointer, the generated code should be as
14055 fast as boost::Python and/or the other python wrappers
14056 based in pure Python/C API calls.
14057
14058 As a reference, the profiletest_runme.py example, which
14059 does a simple call function many times, such as this code:
14060
14061 import profiletest
14062
14063 a = profiletest.A()
14064 b = profiletest.B()
14065 for i in range(0,1000000)
14066 a = b.fn(a)
14067
14068
14069 where fn is defined as 'A* B::fn(A *a) {return a;}',
14070 produces the following times
14071
14072 nomodern modern
14073 swig-1.3.26 19.70s 5.98s
14074 swig-CVS 0.99s 0.98s
14075
14076
14077 Clearly, there is a large improvement for the python
14078 'nomodern' mode. Still, the 'modern' mode is around
14079 6 times faster than before. For the same test, but
14080 using the non-shadow version of the module, we get
14081
14082 _profiletest (non-shadow)
14083 swig-1.3.26 0.80s
14084 swig-CVS 0.60s
14085
14086 Hence, now for practical purposes, the proxy overhead
14087 is insignificant.
14088
14089 Note that the performance numbers we are showing is for
14090 a simple module (two types) and a simple function (one
14091 argument). For real situations, for modules with many
14092 more types and/or functions with many more parameters,
14093 you will see even better results.
14094
14095
1409610/31/2005: mmatus
14097 [Python]
14098
14099 - Finally, no more ClassPtr proxy classes. You will see
14100 only a clean Class proxy class in the .py file.
14101
14102 - No more 'real' thisown attribute either, the PySwigObject now
14103 carries the ownership info.
14104
14105 You can also do something like
14106
14107 print self.this.own()
14108 >>> True
14109
14110 self.this.disown()
14111 self.this.own(0)
14112 print self.this.own()
14113 >>> False
14114
14115 self.this.acquire()
14116 self.this.own(1)
14117 print self.this.own()
14118 >>> True
14119
14120 Still the old way,
14121
14122 print self.thisown
14123 >>> True
14124
14125 self.thisown = 0
14126 print self.thisown
14127 >>> False
14128
14129 self.thisown = 1
14130 print self.thisown
14131 >>> True
14132
14133 is supported, and python dispatches the proper method
14134 calls as needed.
14135
14136
14137 - Support for iterators in STL/STD containers, for example, if you have
14138
14139 %template<set_string> std::set<std::string>;
14140
14141 you can use the C++ iterators as:
14142
14143 s = set_string()
14144
14145 s.append("c")
14146 s.append("a")
14147 s.append("b")
14148
14149 b = s.begin()
14150 e = s.end()
14151 sum = ""
14152 while (b != e):
14153 sum += b.next()
14154 print sum
14155
14156 >>> "abc"
14157
14158 advance the iterator as in C++
14159
14160 current = s.begin()
14161 current += 1
14162 print current.value()
14163 >>> "b"
14164
14165 now using the reverse operators
14166
14167 b = s.rbegin()
14168 e = s.rend()
14169 sum = ""
14170 while (b != e):
14171 sum += b.next()
14172 print sum
14173
14174 >>> "cba"
14175
14176 or the 'previous' method
14177
14178 b = s.begin()
14179 e = s.end()
14180 sum = ""
14181 while (b != e):
14182 sum += e.previous()
14183 print sum
14184
14185 >>> "cba"
14186
14187 or just as in a python fashion
14188
14189 for i in s:
14190 sum += i
14191
14192 Note 1: Iterators in C++ are very powerful, but
14193 dangerous too. And in python you can shoot yourself in the foot
14194 just like in C++, so, be careful.
14195
14196 Note 2: the iterators are 'light', ie, they do not
14197 convert sequence elements until you request to do so, via
14198 next(), value() or previous(). If you just increment/decrement one
14199 no conversion is performed, for example:
14200
14201
14202 b = s.begin()
14203 b += 1
14204 b.incr()
14205 b.incr(2)
14206 b.decr(2)
14207 b.decr()
14208 b -= 1
14209
14210 only the iterator is modified, and not value wrapper
14211 is generated. Other typical C++ operations are also
14212 available, such as:
14213
14214 print s.end() - s.begin()
14215 >>> 3
14216 f = s.begin() + 1
14217 print f.value()
14218 >>> "b"
14219 l = s.end() - 1
14220 print l.value()
14221 >>> "c"
14222
14223 etc. Of course, the 'find', 'insert', 'erase', and
14224 so on methods also supports iterators now, ie:
14225
14226 i = s.begin()
14227 i += 1
14228 s.erase(i)
14229 for i in s:
14230 sum += i
14231 print sum
14232 >>> "ac"
14233
14234 *** POTENTIAL INCOMPATIBILITY ***
14235
14236 There is no more 'thisown' attribute. If you use it, python
14237 will translate the following code as follows:
14238
14239 if (self.thisown): ==> if (self.this.own()):
14240 self.thisown = 1 ==> self.this.own(1)
14241 self.thisown = 0 ==> self.this.own(0)
14242
14243 Still, maybe in some unusual cases the translation will not be
14244 100% correct, so if you have a problem, please report it
14245 and/or use the new 'self.this.own()' accessor.
14246
14247
14248 *** POTENTIAL INCOMPATIBILITY ***
14249
14250 There is no more ClassPtr classes in the python code. Hence,
14251 if in the past you needed to resort to some kind of trickery
14252 with them, or overcome their presence, it is no longer
14253 required, but the extra code you added could now break
14254 things.
14255
14256 If needed, you can use the option -classptr, i.e.,
14257
14258 swig -classptr -python ...
14259
14260 to generate the old ClassPtr classes.
14261
14262
1426310/30/2005: mkoeppe
14264 [Guile] Make declared and defined linkage of SWIG_init consistent.
14265 Reported by Steven G. Johnson (SF patch 1315498).
14266
1426710/26/2005: mmatus
14268
14269 - Added the attribute.i file to the global library director.
14270 Now it can be used from other languages that do not use
14271 the unified typemap library as well.
14272
14273 So, if you have something like:
14274
14275 %include attribute.i
14276
14277 %attribute(A, int, a, get_a, set_a);
14278
14279 struct A
14280 {
14281 int get_a() const;
14282 void set_a(int aa);
14283 };
14284
14285 %attribute_ref(B, int, c);
14286
14287 struct B
14288 {
14289 int& c();
14290 };
14291
14292 then in the target language the 'A.a' and 'B.c' attributes will
14293 be visible, ie, you can access them as plain variables:
14294
14295 f = A()
14296 f.a = 3
14297 g = B()
14298 g.c = 3
14299
14300 h = f.a + g.c
14301
14302 and the proper get/set methods will be dispatched. See
14303 attribute.i for more info.
14304
14305 - More cleanups around and adding more test-cases. The
14306 DISOWN typemap now is tested and working in all the
14307 languages that use the unified typemap library, ie, tcl,
14308 ruby, perl and python.
14309
14310
1431110/25/2005: mmatus
14312
14313 - Perl, complete the DISOWN typemap.
14314
14315 - added the attribute.i file to the unified typemap
14316 library (before was only usable from python).
14317
14318 - unify the names for the setter and getter methods in
14319 perl,tcl,ruby and python, so, the attribute.i library
14320 can work across them.
14321
14322 - see the li_attribute.i test-case or the library file
14323
14324 Lib/typemaps/attribute.swg
14325
14326 for more info about how to use it.
14327
14328
14329
14330
1433110/24/2005: mmatus
14332
14333 - Perl now uses the unified typemap library.
14334
14335 - Changes in ruby to use the $track option in typemaps.
14336
14337 - Changes in the unified typemap library to follow the
14338 convention that all macros that are not used in the
14339 C/C++ side starts with %, such as
14340
14341 %delete
14342 %new_array
14343
14344 etc.
14345
14346 - Documenting fragments, see fragments.swg.
14347
14348 - Cleaner way to use the unified typemap library, include
14349 just <typemaps/swigtypes.swg>.
14350
14351 Check some of the supported languages: perl, tcl, ruby,
14352 python.
14353
14354 Always start with the head file, such as
14355
14356 python/python.swg
14357 tcl/tcl8.swg
14358 ruby/ruby.swg
14359 perl5/perl5.swg
14360
14361 and the principal file that invokes the unified library, such as
14362
14363 python/pytypemaps.swg
14364 tcl/tcltypemaps.swg
14365 ruby/rubytypemaps.swg
14366 perl/perltypemaps.swg
14367
14368 The file that provide the specialization for each
14369 language are the one that provides the basic types:
14370
14371 python/pyprimtypes.swg
14372 ruby/rubyprimtypes.swg
14373 tcl/tclprimtypes.swg
14374 perl5/perlprimtypes.swg
14375
14376 and the string manipulation:
14377
14378 python/pystrings.swg
14379 ruby/rubystrings.swg
14380 tcl/tclstrings.swg
14381 perl5/perlstrings.swg
14382
14383
14384 The rest of the files, such as carray.i, are mostly one
14385 line files that include the proper typemap library
14386 version.
14387
14388 *** POTENTIAL INCOMPATIBILITY in Perl ***
14389
14390 Some missing/wrong typemaps could start working properly,
14391 and change the old expected behavior in Perl.
14392
1439310/23/2005: wuzzeb
14394 Chicken:
14395 + pointers to member functions finally work properly
14396 + add test of member function pointers to cpp_basic.i
14397
1439810/20/2005: dancy
14399 [allegrocl] Added C++ support. Large update, many changes. See
14400 newly added Allegro Common Lisp section in lisp.html
14401
1440210/20/2005: mmatus
14403 Ruby, Tcl, Python:
14404
14405 - Uniform way to fail (label fail:), now finally
14406 SWIG_exception works across the three languages and all
14407 the typemaps.
14408
14409 - Add proper cleanup code to ruby
14410
14411 - More valgrind fixes
14412
14413 - Simplify the inline use, it seems a small interface of
14414 20,000 lines (plus many many templates) can break
14415 gcc -O3 easily.
14416
14417 - Finalize the typemaps library. All the old *.i files
14418 (carray.i, cpointer.i, exception.i) had been implemented
14419 in the new typemaps library.
14420
14421
1442210/19/2005: wuzzeb
14423 Update the Runtime Typemap documentation in Typemaps.html
14424
1442510/18/2005: wuzzeb
14426 Chicken:
14427 - Correctly handle %ignored classes
14428 - Correctly convert long, long long, unsigned long, etc
14429 to chicken primitives. (Thanks to Felix Winkelmann)
14430 - Using argout parameters when the return value was a
14431 wrapped pointer caused a memory corruption. The chicken
14432 garbage collector moved a pointer out from under us.
14433 This is now fixed by running all the proxy creation
14434 functions as continuations after the wrapper function
14435 returns. As part of this, we no longer need the
14436 chickenfastproxy flag on output typemaps.
14437 - using -proxy and -nocollection together works now
14438 Before, it was not exporting the destructor in the proxy
14439 wrapper.
14440
1444110/18/2005: mmatus
14442
14443 Added the Unified Typemap Library (UTL). It unifies the typemaps for
14444
14445 python, ruby, tcl
14446
14447 and in the process, fixes several problems in each of the three
14448 languages to work in a "canonical" way now established in
14449 the typemap library
14450
14451 SWIG/Lib/typempas
14452
14453 The current status of the unification is that everything
14454 compiles and runs inside the test-suite and examples
14455 directories. And for the first time we have three
14456 languages than pass the primitive_types.i case.
14457
14458 Also, we have a uniform way to treat the errors, for example
14459 if you do something like
14460
14461 >>> from primitive_types import *
14462 >>> print val_uchar(10)
14463 10
14464 >>> print val_uchar(1000)
14465 Traceback (most recent call last):
14466 File "<stdin>", line 1, in ?
14467 OverflowError: in argument 1 of type 'unsigned char'
14468
14469 you get the same exception in all the three languages.
14470
14471 And well, many more good things will come from this
14472 unification, for example, proper support of the STL/STD classes
14473 for all the languages, and hopefully, we can keep
14474 adding other languages.
14475
14476 The hardest part, writing a common typemap library
14477 that suites the three different languages, is done,
14478 and adding another language should now be easy.
14479
14480 Still the global unification is not complete, the STL/STD
14481 part is next, and probably as well as adding one or two more
14482 languages.
14483
14484 If you are curious, look at the python, ruby and/or tcl
14485 directories to see what is needed to support the new
14486 common typemaps library. Still, the final way to
14487 integrate a new language could change as we move to
14488 integrate the STD/STL.
14489
14490 *** POTENTIAL INCOMPATIBILITY in Ruby/Tcl ***
14491
14492 Some missing/wrong typemaps could start working properly,
14493 and change the old behavior, specially in ruby and tcl.
14494
Matthias Köppeb2dd7882005-10-30 16:46:57 +000014495Version 1.3.27 (October 15, 2005)
14496=================================
14497
1449810/15/2005: wsfulton
14499 [Java] Fix for typesafe enum wrapping so that it is possible to
14500 overload a method with 2 different enum types.
14501
1450210/15/2005: wsfulton
14503 Fix for %feature("immutable","0") attempting to generate setters
14504 for constants.
14505
14506 Restored %immutable and %makedefault to clear the feature as it
14507 behaved in SWIG-1.3.25 and earlier.
14508
1450910/14/2005: mmatus
14510 Fix bug in anonymous typedef structures which was leading to
14511 strange behaviour.
14512
1451310/13/2005: mmatus
14514 Several minor changes:
14515
14516 - Improve the wchar_t type support
14517 - Add a warning for when you define the 'in' typemap but
14518 you don't define the 'typecheck' one. Very common mistake.
14519 - Add proper default rule for function pointers, now you
14520 can define a typemap such as:
14521
14522 %typemap(in) SWIGTYPE ((*)(ANY)) {...}
14523
14524 That will apply to all the pointer to functions. The
14525 rule in C++ also apply to the function 'reference', ie,
14526 in both cases
14527
14528 typedef int (*fptr)(int a);
14529 typedef int (func)(int a);
14530
14531 This was needed since it seems to be 'illegal' in C++ to
14532 do something like:
14533
14534 void *ptr = static_cast<void *>(fptr);
14535
14536 and probably, as for member functions, it is not
14537 warrantied that the pointer sizes will match.
14538
14539 - Add the #error/#warning directives to swig's cpp.
14540
14541 - Add the noblock option for typemaps, which is used as
14542 follows: supposed you a typemap, like this
14543
14544
14545 %typemap(in,noblock=1) Hello {
14546 ....
14547 }
14548
14549 then the typemap will be inserted without the block
14550 imposed by the brackets, similar to
14551
William S Fultonc10a84c2022-08-20 22:14:58 +010014552 %typemap(in) Hello "..."
Matthias Köppeb2dd7882005-10-30 16:46:57 +000014553
14554 So, why you don't just use the quote style?, because:
14555
14556 1.- The quote style doesn't get preprocessed, for example
14557
William S Fultonc10a84c2022-08-20 22:14:58 +010014558 %typemap(in) Hello "$1= SWIG_macro($1);"
Matthias Köppeb2dd7882005-10-30 16:46:57 +000014559
14560 here, SWIG_macro doesn't get expanded
14561
14562 2.- Inside a quote typemap, you have to use
14563 quotes carefully
14564
William S Fultonc10a84c2022-08-20 22:14:58 +010014565 %typemap(in) Hello "$1 = \"hello\" "
Matthias Köppeb2dd7882005-10-30 16:46:57 +000014566
14567 3.- You can't make emacs and/or other editors
14568 to indent inside a string!.
14569
14570
14571 So, why do you want to remove the block?, because an extra
14572 block when not needed (no local variables in it):
14573
14574 1.- makes the code harder to read
14575 2.- makes the code larger
14576 3.- or in short, for the same reason we have the quote style.
14577
William S Fulton60843032005-10-09 22:05:01 +000014578Version 1.3.26 (October 9, 2005)
14579================================
14580
1458110/08/2005: wsfulton
14582 [Php] Added 'throws' typemaps.
14583
1458410/08/2005: wsfulton
14585 Fixes for languages that don't support multiple inheritance. The
14586 first non-ignored class in the public base class list is used for inheritance.
14587 by the proxy class. Previously, if the first class in the list was ignored, then
14588 the proxy class wouldn't have any base classes.
14589
1459010/07/2005: mmatus
14591 Update more features to follow new convention, including:
14592
14593 callback
14594 ref/unref
14595 except
14596
14597 All of them use not only the feature as a flag, but also
14598 as code value. To deal with those features, we use now
14599 GetFlagAttr, which is similar to GetFlag, but instead or
14600 returning 1 or 0, it returns the attr value, if happens
14601 to be different of "0" of course.
14602
14603 Now there are also more uniform directive names for the
14604 ones based in features, for example, for the old
Olly Betts84156672023-12-03 10:59:25 +130014605 %newobject directive now we have three directives defined:
William S Fulton60843032005-10-09 22:05:01 +000014606
14607
14608 #define %newobject %feature("new")
14609 #define %nonewobject %feature("new","0")
14610 #define %clearnewobject %feature("new","")
14611
14612 and so on for all the other feature directives.
14613
14614 *** POTENTIAL INCOMPATIBILITY ***
14615
1461609/30/2005: wsfulton
14617 Subtle change to some features. Previously it was not possible to disable many
14618 features once they had been enabled. This was for most features that behave as
14619 flags. These features now work as follows:
14620
14621 %feature("name") // enables the feature
14622 %feature("name", "1") // enables the feature
14623 %feature("name", "0") // disables the feature
14624 %feature("name", "") // clears the feature
14625
14626 In fact any non-empty value other than "0" will enable the feature (like C boolean logic).
14627 Previously "1", "0" or any other non-empty value would enable the feature and it would
14628 only be possible to disable the feature by clearing it (assuming there was no global enable).
14629
14630 The following features are affected:
14631
14632 allowexcept
14633 compactdefaultargs
14634 classic (Python)
14635 cs:const (C#)
14636 director
14637 exceptionclass (Python)
14638 ignore
14639 immutable
14640 java:const (Java)
14641 java:downcast (Java)
14642 kwargs
14643 modern (Python)
14644 new
14645 noautodoc (Python)
14646 nodefault
14647 nodirector
14648 noref
14649 notabstract
14650 nounref
14651 novaluewrapper
14652 python:maybecall (Python)
14653 python:nondynamic (Python)
14654 modula3:multiretval (Modula3)
14655 predicate (Ruby)
14656 trackobjects (Ruby)
14657 valuewrapper
14658
14659 It is now possible, for example to ignore all methods/classes in a header file, except for a
14660 few targetted methods, for example:
14661
14662 %feature("ignore"); // ignore all methods/classes
14663 %feature("ignore","0") some_function(int, double); // do not ignore this function
14664 %feature("ignore","0") SomeClass; // do not ignore this Class
14665 %feature("ignore","0") SomeClass::method; // do not ignore this method
14666 %include "bigheader.h"
14667
14668 Removed %pythondynamic - it never worked properly. Use %pythonnondynamic instead.
14669 Removed %feature("nokwargs") - it wasn't fully implemented - use %feature("kwargs","0") instead.
14670
14671 *** POTENTIAL INCOMPATIBILITY ***
14672
1467309/25/2005: mkoeppe
14674 [Guile] Add "throws" typemaps.
14675
1467609/24/2005: cfisavage
14677 [Ruby] Adds new %trackobjects functionality that maps C++ objects to
14678 Ruby objects. This functionality makes it much easier to implement
14679 mark functions for the garbage collector. For more information
14680 refer to the update documentation and examples.
14681
1468209/20/2005: wsfulton
14683 [Perl] Patch 1116431 from Josh Cherry. Fixes non member functions inadvertently
14684 being called instead of member functions.
14685
1468609/20/2005: wsfulton
14687 [Lua] Patch from Mark Gossage to add support for Lua-5.1, std::string,
14688 std::vector, std::exception and documentation.
14689
1469009/14/2005: mmatus
14691 [Python] Add -nocppcast. Now the default behavior is to
14692 always use the cppcast operators. Before that was the case
14693 only when you used the -cppcast option.
14694
14695 If this seems to break your code... your welcome!, it
14696 means it was broken before, and you never notice.
14697
14698 If you thing the error is due to one of the SWIG typemaps,
14699 send us an example.
14700
14701 Use -nocppcast only with very old C++ compilers that
14702 do not support the cppcast operations.
14703
14704 So, here applies:
14705
14706 This change doesn't break compatibility, it was broken before.
14707
1470809/13/2005: wsfulton
14709 [Java] Fix for director methods when a class is passed by value as a
14710 parameter.
14711
1471209/11/2005: mmatus
14713 Adding the module option to the %import directive. Now you
14714 can use it as
14715
14716 %import(module="BigModule") foo.i
14717
14718 where subfile could (or not) define the module name via
14719 the %module directive. The module option take precedence
14720 and it has the same effects than having the directive
14721
14722 %module BigModule
14723
14724 inside the imported file foo.i.
14725
14726 You can use the option in mainly two cases:
14727
14728 1.- You used the -module option when you generated the
14729 module to be imported, and hence the module name in
14730 the imported %module directive is not really useful.
14731
14732 2.- The module you want to import is very large, and it
14733 has several .i/.h files. Then, if you just one to
14734 import a class or so from the module, says 'foo', and
14735 not the entire module via importing the main
14736 BigModule.i file, then you just do:
14737
14738 %import(module="BigModule") foo.h
14739
14740 or
14741
14742 %import(module="BigModule") foo.i
14743
14744 where foo.i contains the 'foo' declaration and maybe a
14745 couple of extra %include directives, as needed.
14746
14747
1474809/11/2005: mmatus
14749 Fix bug #1282637, about the -module option not having effect
14750 in places where it was needed.
14751
1475209/11/2005: wsfulton
14753 When wrapping variables, ensure that none of the typemaps used for the
14754 set wrappers are used when generating the get wrappers. I doubt this was a
14755 problem for any languages except for the recently introduced null attribute
14756 in the out typemap (C# only).
14757
1475809/08/2005: wsfulton
14759 More descriptive error messages when files fail to open.
14760
1476109/06/2005: mmatus
14762
14763 Allow a %define a macro inside another %define macro, for example
14764
14765 %define hello(name, Type)
14766 %define name ## a(Type)
William S Fultonc10a84c2022-08-20 22:14:58 +010014767 %typemap(in) Type "hello;"
William S Fulton60843032005-10-09 22:05:01 +000014768 %enddef
14769 %enddef
14770
14771 To learn how to use this new features in your own typemaps library, see
14772 python/cstring.i, python/cwstring.i and python/cwstrbase.i.
14773
14774 [Python] Normalize the cstring.i implementation to use fragments, and add
14775 cwstring.i, which implements the same typemaps but for wchar_t strings.
14776
14777 [Python] Bug fixed: 1247477, 1245591, 1249878 and others.
14778
1477908/18/2005: wsfulton
14780 [Ruby] Implement support for SWIGTYPE* DISOWN typemap (like in Python) for
14781 better control of memory management, eg when adding an object created in Ruby
14782 to a C++ container. Patch #1261692 from Charlie Savage.
14783
1478408/18/2005: wsfulton
14785 [Tcl] 64 bit platform fixes for the varargs handling in SWIG_GetArgs. This is an
14786 improved fix for bug #1011604 as suggested by Jeremy Lin.
14787
1478808/18/2005: wsfulton
14789 [Tcl] Bug #1240469 - %newobject support for Tcl. Patch from Bob Marinier.
14790
1479108/16/2005: wsfulton
14792 [Perl] Bug #1254494 - Fix for global namespace pollution by perl header files
14793 (bool define) prevented STL headers from being used on some systems, eg
14794 Windows with Visual Studio.
14795
1479608/16/2005: wsfulton
14797 [Java] Bug #1240937 - Redefinition of __int64 typedef for Intel compilers.
14798
1479908/15/2005: wsfulton
14800 [Xml] Bug #1251832 - C++ template may generate invalid XML file
14801
1480208/15/2005: wsfulton
14803 [Lua] Support added for Lua. Patch #1242772 from Mark Gossage.
14804 It supports most C/C++ features (functions, struct, classes, arrays, pointers,
14805 exceptions), as well as lots of documentation and a few test cases & examples.
14806
1480708/14/2005: wsfulton
14808 [Xml] Fix incorrect xml escaping in base class name when base class is a template.
14809
1481008/13/2005: efuzzyone
14811 [CLISP] Added support for handling enums. Does not adds the return type declaration
14812 to the function definition, if a function returns void.
14813
1481408/09/2005: mkoeppe
14815 New language module, Common Lisp with UFFI, from Utz-Uwe Haus.
14816
1481708/09/2005: mkoeppe
14818 Fix the Lisp s-expression output module; it no longer complains about "unknown targets".
14819
1482007/27/2005: wsfulton
14821 Modifications to STL wrappers so that it is possible for a user's %exception directive
14822 to be applied to the STL wrapper methods. Previously the following global %exception
14823 directive would not be used on the wrapper methods:
14824
14825 %exception {
14826 try {
14827 $action
14828 } catch (...) {
14829 // handle uncaught exceptions
14830 }
14831 }
14832
14833 This has been implemented by replacing %exception directives for specific STL wrapper
14834 methods with an exception specification declared on the wrapper methods. throws typemaps
14835 are now supplied for handling the STL exception specification. These can also be easily
14836 overridden, for example the std::out_of_range exception, which is used a lot in the STL
14837 wrappers, can be customised easily:
14838
14839 %include "std_vector.i"
14840 %typemap(throws) std::out_of_range {
14841 // custom exception handler
14842 }
14843 %template(VectInt) std::vector<int>;
14844
1484507/22/2005: efuzzyone
14846 [CLISP] The clisp module for SWIG:
14847 - It can only handle C, clisp currently does not supports ffi bindings to C++.
14848 - It has two options, (a) -extern-all this will generate wrappers for all functions
14849 and variablestions, (b) -generate-typedef this will generate wrappers "def-c-type"
14850 wrappers for typedefs
14851 - Can handle pointers to functions, complex types such as n-dimensional arrays of
14852 pointers of depth d
14853 - Generates wrappers for constants as well as variables
14854 - Correctly distinguishes between the declaration of variables in structures and functions
14855 - Creates a defpackage "declaration" with the module name as the package name, the created
14856 package exports both functions and variables
14857 - tries to guess when should a pointer variable be declared as c-ptr or c-pointer
14858
1485907/22/2005: wsfulton
14860 [C#] Changes to support C# structs returned by value. The changes required are:
14861 - Using an optional 'null' attribute in the out typemap. If this attribute is specified,
14862 then it is used for the $null special variable substitution.
14863 - The ctype used in the C/C++ wrappers is no longer initialised to 0 on declaration.
14864 Both of these changes fix the situations where an attempt was made to assign 0 to the
14865 returned struct. Marshalling structs as value types still requires user defined typemaps.
14866 See documentation for an example.
14867
1486807/22/2005: wsfulton
14869 [C#, Java] Fix SWIG_exception usage to work with compilers that don't support empty macro
14870 arguments. Unfortunately this fix will stop usage of SWIG_exception being used within typemaps
Olly Betts3777b682007-10-08 12:02:56 +000014871 that use "" or %{ %} delimiters, but continues to work with typemaps using {} delimiters.
William S Fulton60843032005-10-09 22:05:01 +000014872 Please use the SWIG_CSharpSetPendingExceptionArgument or SWIG_JavaThrowException methods instead
14873 as SWIG_exception is really intended as a platform independent macro for the SWIG library writers.
14874
1487507/16/2005: mkoeppe
14876 [Allegro CL] Use specific foreign types rather than (* :void).
14877 Use *swig-identifier-converter*.
14878
1487906/27/2005: wsfulton
14880 Functions declared as 'extern' no longer have an additional function declaration added to the
14881 wrapper files. There are some cases where SWIG does not get this right, eg bug #1205859 (extern
14882 functions with default arguments declared in a namespace). Also SWIG cannot get non-standard
14883 calling conventions correct, eg Windows calling conventions are usually handled like this:
14884
14885 %{
14886 #define DLLIMPORT __declspec(dllimport)
14887 #define STDCALL __stdcall
14888 %}
14889 #define DLLIMPORT
14890 #define STDCALL
14891 %inline %{
14892 DLLIMPORT extern STDCALL void function(int);
14893 %}
14894
14895 SWIG incorrectly generates:
14896
14897 extern void function(int);
14898
14899 To which there is no solution as SWIG doesn't handle non-standard calling conventions. The extra
14900 'extern' function that SWIG generates is superfluous unless a user has forgotten to add the function
14901 declaration into the wrappers.
14902
14903 The -noextern commandline argument is now redundant and a new commandline argument -addextern can
14904 be used to obtain the original behaviour. This shouldn't be necessary unless the header file
14905 containing the function declaration was inadvertently not added to the wrappers. To fix this
14906 add the function declaration into your wrappers, For example, replace:
14907
14908 extern void foo(int);
14909
14910 with:
14911
14912 %inline %{
14913 extern void foo(int);
14914 %}
14915
14916 *** POTENTIAL INCOMPATIBILITY ***
14917
1491806/22/2005: wsfulton
14919 [C#, Java, Modula3, Ocaml]
14920 The intermediary function names have been changed when wrapping variables to
14921 match the other language modules so that %extend for a member variable works
14922 uniformly across all language modules, eg:
14923
14924 %extend ExtendMe {
14925 Var;
14926 };
14927
14928 %{
14929 void ExtendMe_Var_set(ExtendMe *, double) {...}
14930 double ExtendMe_Var_get(ExtendMe *) {...}
14931 %}
14932
14933 The methods implementing the get/set used to be:
14934
14935 %{
14936 void set_ExtendMe_Var(ExtendMe *, double) {...}
14937 double get_ExtendMe_Var(ExtendMe *) {...}
14938 %}
14939
14940 This also changes the name of variable wrapper functions when using -noproxy.
14941 The original names can be generated with the -oldvarnames commandline option.
14942
14943 *** POTENTIAL INCOMPATIBILITY ***
14944
William S Fulton67364f12005-06-12 19:57:04 +000014945Version 1.3.25 (June 11, 2005)
14946==============================
14947
1494806/11/2006: mkoeppe
14949 [Guile] Fix handling of anonymous-enum variables.
14950
1495106/10/2005: mkoeppe
14952 [Guile] Fix for function arguments that are passed by
14953 copy-of-value. Fix for global "const char *" variables.
14954 Fix testcases arrays_dimensionless, arrays_global.
14955
1495606/08/2005: wsfulton
14957 Fix for when a base class defines a symbol as a member variable and a derived class defines
14958 the same symbol as a member method.
14959
1496006/08/2005: wsfulton
14961 [C#] More fixes for virtual/new/override modifiers - when a method has protected access
14962 in base and public access in derived class.
14963
1496406/02/2005: wsfulton
14965 Fix #1066363 - Follow convention of release tarball name matching directory name.
14966
1496706/02/2005: wsfulton
14968 [C#, Java] Fix #1211353 - typesafe enums (and Java proper enums) wrappers when enum value
14969 is negative.
14970
1497105/27/2005: wsfulton
14972 Modernised and tidied up Windows macros --> SWIGEXPORT, SWIGSTDCALL. They can be overridden
14973 by users via -D compiler directives if need be.
14974
1497505/26/2005: wsfulton
14976 %csmethodmodifiers can be applied to variables as well as methods now.
14977
14978 In addition to the default 'public' modifier that SWIG generates, %csmethodmodifiers will also
14979 replace the virtual/new/override modifiers that SWIG thinks is appropriate. This feature is
14980 useful for some obscure cases where SWIG might get the modifiers incorrect, for example
14981 with multiple inheritance and overriding a method in the base class.
14982
14983 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
14984
1498505/25/2005: wsfulton
14986 Added missing constructors to std::pair wrappers (std_pair.i) for all languages.
14987
1498805/25/2005: wsfulton
14989 [C#] Added std::pair wrappers in std_pair.i
14990
1499105/25/2005: wsfulton
14992 [C#] The C# 'new' and 'override' modifiers will be generated when a C++ class inherits methods
14993 via a C++ 'using' declaration.
14994
1499505/25/2005: wsfulton
14996 Fix for exception specifications previously being ignored in classes that inherited methods
14997 from 'using' declarations, eg calls to Derived::bar below will convert C++ exceptions into
14998 a target language exception/error, like it always has done for Base::Bar.
14999
15000 class Base {
15001 virtual bar() throw (std::string);
15002 };
15003 class Derived : public Base {
15004 using Base::bar;
15005 };
15006
1500705/23/2005: wsfulton
15008 Fixes for detecting virtual methods in %extend for the -fvirtual option and C# override and new
15009 method modifiers.
15010
1501105/23/2005: wsfulton
15012 [C#] The 'new' modifier is now generated on the proxy method when a method in a derived
15013 class is not polymorphic and the same method exists in the derived class (ie it hides
15014 the base class' non-virtual method).
15015
1501605/23/2005: wsfulton
15017 [Java, C#] Fixes to detection of covariant return types - when the class hierarchy is more
15018 than 2 classes deep.
15019
1502005/21/2005: wsfulton
15021 [Java] std::wstring typemaps moved from std_string.i to std_wstring.i
15022
1502305/21/2005: wsfulton
15024 Fix for crash in DohStrstr, bug #1190921
15025
1502605/21/2005: wsfulton
15027 [TCL] Fix for methods with similar names when showing list of names on error - bug #1191828.
15028 Patch from Jeroen Dobbelaere.
15029
1503005/21/2005: wsfulton
15031 [TCL] long long overloading fix - bug #1191835, patch from Jeroen Dobbelaere.
15032
1503305/21/2005: wsfulton
15034 Fix bug #1196755 to remove debug from swigtcl8.swg.
15035
1503605/19/2005: wsfulton
15037 [C# and -fvirtual option] Fix for the override key not being generated in the derived class when a
15038 virtual method's return type was a typedef in either the base or derived class. Also ensures the
15039 method is eliminated when using the -fvirtual option. For example, Derived.method now has the C#
15040 override keyword generated:
15041
15042 typedef int* IntegerPtr;
15043
15044 struct Base {
15045 virtual IntegerPtr method();
15046 };
15047
15048 struct Derived : Base {
15049 int * method() const;
15050 };
15051
15052 [C#] Fix for the override key being incorrectly generated for virtual methods when a base class
15053 is ignored with %ignore.
15054
1505505/13/2005: wsfulton
15056 [Java] Fixes to remove "dereferencing type-punned pointer will break strict-aliasing rules"
15057 warnings in C wrappers when compiling C code with 'gcc -Wall -fstrict-aliasing'. Patch from
15058 Michael Cahill. This modifies many of the casts slightly, for example
15059 arg1 = *(DB_ENV **)&jarg1;
15060 to
15061 arg1 = *(DB_ENV **)(void *)&jarg1;
15062
1506305/12/2005: wsfulton
15064 [C#] Support for C# attributes. C# attributes can be generated:
15065 1) On a C/C++ type basis by specifying an inattributes and/or outattributes typemap attribute
15066 in the imtype or cstype typemaps (for C# return type or C# parameter type attributes).
15067 2) On a wrapped method or variable by specifying a csattributes feature (%feature).
15068 3) On a wrapped proxy class or enum by specifying a csattributes typemap.
15069
15070 Examples are in the C# documentation (CSharp.html).
15071
1507204/29/2005: wsfulton
15073 New configure option to turn off the default maximum compiler warning as
15074 they couldn't be removed even when overriding CFLAGS and CXXFLAGS with configure
15075 (./configure CFLAGS= CXXFLAGS=). To turn the maximum warnings off, run:
15076
15077 ./configure --without-maximum-compile-warnings
15078
1507904/28/2005: wsfulton
15080 Patch from Scott Michel which reworks the Java constructor and finalize/destructor typemaps,
15081 for directors to reduce the number of overall Java typemaps. Added the director_take and
15082 director_release typemaps to emulate other modules' __disown__ functionality.
15083
15084 *** POTENTIAL INCOMPATIBILITY FOR JAVA DIRECTORS ***
15085
1508604/28/2005: wsfulton
15087 [C#] Fixed problems due to the over eager garbage collector. Occasionally the
15088 garbage collector would collect a C# proxy class instance while it was being used
15089 in unmanaged code if the object was passed as a parameter to a wrapped function.
15090 Needless to say this caused havoc as the C# proxy class calls the C++ destructor
15091 when it is collected. Proxy classes and type wrapper classes now use a HandleRef,
15092 which holds an IntPtr, instead of a plain IntPtr to marshal the C++ pointer to unmanaged
15093 code. There doesn't appear to be any performance degradation as a result of this
15094 modification.
15095
15096 The changes are in the proxy and type wrapper classes. The swigCPtr is now of type HandleRef
15097 instead of IntPtr and consequently the getCPtr method return type has also changed. The net
15098 effect is that any custom written typemaps might have to be modified to suite. Affected users
15099 should note that the implementation uses the new 'out' attribute in the imtype typemap as the
15100 input type is now a HandleRef and the output type is still an IntPtr.
15101
15102 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
15103
1510404/28/2005: wsfulton
15105 [C#] Support for asymmetric type marshalling added. Sometimes the output type needs to be
15106 different to the input type. Support for this comes in the form of a new optional 'out'
15107 attribute for the ctype, imtype and cstype typemaps. If this typemap attribute is not
15108 specified, then the type used for both input and output is the type specified in the
15109 typemap, as has always previously been the case. If this typemap attribute is specified,
15110 then the type specified in the attribute is used for output types and the type specified
15111 in the typemap itself is used for the input type. An output type is a return value from
15112 a wrapped method or wrapped constant and an input type is a parameter in a wrapped method.
15113
15114 An example shows that char * could be marshalled in different ways,
15115
15116 %typemap(imtype, out="IntPtr") char * "string"
15117 char * function(char *);
15118
15119 The output type is thus IntPtr and the input type is string. The resulting intermediary C# code is:
15120
15121 public static extern IntPtr function(string jarg1);
15122
1512304/22/2005: mkoeppe (Matthias Koeppe)
15124 [Guile] Fix generation of "define-method" for methods of
15125 classes with a constructor. Reported by Luigi Ballabio.
15126
1512704/15/2005: wuzzeb (John Lenz)
15128 [Chicken]
15129 For wrapped functions that return multiple values (using argout),
15130 SWIG CHICKEN now returns them as multiple values instead of as
15131 a list. They can then be accessed using (call-with-values).
15132
1513304/14/2005: wuzzeb (John Lenz)
15134 [Chicken]
15135 + Added a whole bunch of new _runme scripts into the chicken test
15136 suite. Also fix some bugs these new scripts turned up.
15137
15138 + Added optimization when returning a wrapped proxy class. Before,
15139 a minor garbage collection was invoked every time a function returned.
15140
15141 + All the chicken Examples should now run correctly
15142
1514304/14/2005: wsfulton
15144 [C#] More fixes for typemap matching when wrapping variables, in particular
15145 std::string, so that std::string variables can be easily marshalled with
15146 a C# string property using:
15147
15148 %include "std_string.i"
15149 %apply const std::string & { std::string *variable_name };
15150 std::string variable_name;
15151
15152 (Recall that all class variables are wrapped using pointers)
15153
1515404/05/2005: wuzzeb (John Lenz)
15155 [Chicken]
15156 + Added Examples/chicken/egg, an example on how to build a chicken
15157 extension library in the form of an egg. Also updated the
15158 documentation on the different linking options.
15159
15160 + chicken test-suite now has support to check SWIG with the -proxy
15161 argument if there exists a _proxy_runme.ss file.
15162
15163 + More fixes for overloaded functions and -proxy
15164
1516503/31/2005: wsfulton
15166 Turned on extra template features for all languages which were
15167 previously only available to Python.
15168
15169 This enables typemaps defined within a templated class to be used as
15170 expected. Requires %template on the templated class, %template() will
15171 also pick up the typemaps. Example:
15172
15173 template <typename T> struct Foo {
15174 ...
15175 %typemap(in) Foo "in typemap for Foo<T> "
15176 or
15177 %typemap(in) Foo<T> "in typemap for Foo<T> "
15178 };
15179
15180 %template(Foo_i) Foo<int>;
15181 %template() Foo<double>;
15182
15183 will generate the proper 'in' typemaps wherever Foo<int> and Foo<double>
15184 are used.
15185
1518603/30/2005: mkoeppe (Matthias Koeppe)
15187 [MzScheme] Patch from Hans Oesterholt for supporting MzScheme 30x.
15188
1518903/29/2005: wuzzeb (John Lenz)
15190 [Chicken]
15191 + Reallow older versions of chicken (1.40 to 1.89) by passing -nocollection
15192 argument to SWIG
15193 + %import now works correctly with tinyclos. (declare (uses ...)) will be
15194 exported correctly.
15195 + TinyCLOS proxy classes now work correctly with overloaded functions
15196 and constructors.
15197
1519803/29/2005: wsfulton
15199 [Java] Patch from Scott Michel for directorout typemaps. Java directors
15200 require the directorout typemaps like the other languages now. The new
15201 typemaps provide fixes for methods where the return type is returned
15202 by reference (this cannot automatically be made thread safe though).
15203
1520403/22/2005: wsfulton
15205 Enum casting fixes. Visual C++ didn't like the C type casting SWIG produced
15206 when wrapping C++ enum references, as reported by Admire Kandawasvika.
15207
1520803/21/2005: wsfulton
15209 [Perl] SF #1124490. Fix Perl macro clashes when using Visual Studio's STL string,
15210 so now projects can #include <string>.
15211
1521203/21/2005: wsfulton
15213 Fixed %varargs which got broken with the recent default argument changes.
15214 Also works for Java and C# for the first time now.
15215
1521603/17/2005: wuzzeb (John Lenz)
15217 [Chicken]
15218 + Fix a whole bunch of bugs in the chicken module. The entire
15219 test suite now compiles, with the exception of the tests that require
15220 std_vector.i, std_deque.i, and so on, which chicken does not have yet.
15221
15222 + Add support for %exception and %typemap(exceptions). Exceptions are
15223 thrown with a call to (abort) and can be handled by (handle-exceptions)
15224
1522503/15/2005: wsfulton
15226 [Java] Patch from Scott Michel for directors. Modifications to the typemaps
15227 giving users fine control over memory ownership and lifetime of director classes.
15228 Director classes no longer live forever by default as they are now collectable
15229 by the GC.
15230
1523103/15/2005: wuzzeb (John Lenz)
15232 [Chicken] Add support for adding finalizers garbage collected objects.
15233 Functions that return new objects should be marked with %newobject and
15234 input arguments which consume (or take ownership) of a pointer should
15235 be marked with the DISOWN typemap.
15236
15237 Also add support for correctly checking the number of arguments passed
15238 to a function, and raising an error if the wrong number are passed.
15239
1524003/14/2005: wuzzeb (John Lenz)
15241 Add --without-alllang option to configure.in, which is the same as
15242 passing all the --without-python --without-perl5 etc... that Matthias added.
15243
1524403/09/2005: wsfulton
15245 [Php] Memory leak fix for functions returning classes/structs by value.
15246
1524703/08/2005: wsfulton
15248 [Perl] Fix for Perl incorrectly taking memory ownership for return types that
15249 are typedefs to a struct/class pointer. Reported by Josh Cherry.
15250
1525103/07/2005: wsfulton
15252 [C#] Various exception changes for the std::vector wrappers. These now more
15253 accurately mirror the same exceptions that System.Collections.ArrayList throw.
15254
1525503/07/2005: wsfulton
15256 [C#] Fix undefined behaviour after any of the std::vector methods
15257 throw an exception.
15258
1525903/07/2005: wsfulton
15260 [C#] When null is passed for a C++ reference or value parameter, the
15261 exception thrown has been corrected to an ArgumentNullException instead
15262 of NullReferenceException as recommended in the .NET Framework documentation.
15263
15264 The default throws typemaps turn a C++ exception into an ApplicationException,
15265 not a SystemException now.
15266
1526703/07/2005: wsfulton
15268 [C#] Numerous changes in C# exception handling have been made over the past
15269 few weeks. A summary follows:
15270
15271 The way in which C++ exceptions are mapped to C# exceptions is quite different.
15272 The change is to fix C# exceptions so that the C++ exception stack is correctly
15273 unwound as previously C++ exceptions were being thrown across the C PInvoke layer
15274 into the managed world.
15275
15276 New typemap attributes (canthrow and excode) have been introduced to control the
15277 mapping of C++ to C# exceptions. Essentially a callback into the unmanaged world
15278 is made to set a pending exception. The exception to throw is stored in thread local
15279 storage (so the approach is thread-safe). The typemaps are expected to return
15280 from unmanaged code as soon as the pending exception is set. Any pending exceptions
15281 are checked for and thrown once managed code starts executing. There should
15282 be minimal impact on execution speed during normal behaviour. Full details will be
15283 documented in CSharp.html.
15284
15285 The SWIG_CSharpThrowException() function has been removed and replaced with the
15286 SWIG_CSharpSetPendingExceptionArgument() and SWIG_CSharpSetPendingException()
15287 functions. The original name has been deliberately changed to break old code as
15288 the old approach was somewhat flawed. Any user defined exceptions that follow the
15289 same pattern as the old approach should also be fixed.
15290
15291 Numerous new .NET framework exceptions are now available for easy throwing from
15292 unmanaged code. The complete list is:
15293
15294 ApplicationException, ArithmeticException, DivideByZeroException,
15295 IndexOutOfRangeException, InvalidOperationException, IOException,
15296 NullReferenceException, OutOfMemoryException, OverflowException,
15297 SystemException, ArgumentException, ArgumentNullException and
15298 ArgumentOutOfRangeException.
15299
15300 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
15301
1530205/05/2005: mmatus
15303
15304 Fix several memory leaks around. Even when we survive knowning
15305 swig is a memory leak factory, it was a little out of
15306 control. To run std_containers.i in the python test-suite,
15307 swig was using ~260MB, now it uses 'only' ~40MB, which is
15308 the same ammount that g++ uses, so, is not that bad.
15309 In the process, I found a couple of extra Deletes, which
15310 in some cases could trigger seg. faults and/or
15311 DOH/asserts.
15312
15313 [python] Better support for directors + exception. More
15314 verbose errors and added an unexpected exception handler.
15315
15316 [python] Fix memory leak for the
15317
15318 std::vector<std::vector<int> >
15319
15320 case,reported by Bo Peng.
15321
15322 [python] Fix SwigPyObject compare problem reporte by
15323 Cameron Patrick.
15324
15325 [python] Fix several warnings in the generated code
15326 for gnu-gcc, Intel and VC7.1 compilers.
15327
15328
1532902/25/2005: wuzzeb (John Lenz)
15330 Update documentation to use CSS and <div> instead of <blockquote>
15331 I used a script to convert the docs, and it set all the box classes
15332 to be "code". There are actually 4 different classes,
15333 "shell", "code", "targetlang", and "diagram". We need to go through
15334 and convert the divs depending on what they contain.
15335
1533602/23/2005: mmatus
15337
15338 [Python] Added option -nortti to disable the use of native
15339 C++ RTTI with directors (dynamic_cast<> is not used).
15340
15341 Add more code for directors to detect and report errors in
15342 the python side.
15343
15344 Extend the use of SWIGINTERN whenever is possible.
15345
15346 Remove template warnings reported by VC7.1.
15347
15348 Remove warnings reported by gcc/g++. Finally you can
15349 compile using
15350
15351 g++ -W -Wall -c mymodule_wrap.cxx
15352
15353 and no spurious errors will be generated in the wrapper
15354 code.
15355
1535602/23/2005: wuzzeb (John Lenz)
15357 Added -external-runtime argument. This argument is used to dump
15358 out all the code needed for external access to the runtime system,
15359 and it replaces including the files directly. This change adds
15360 two new virtual functions to the Language class, which are used
15361 to find the language specific runtime code. I also updated
15362 all languages that use the runtime to implement these two functions.
15363
1536402/22/2005: mmatus
15365 Fix %template + private error SF#1099976.
15366
1536702/21/2005: mmatus
15368
15369 Fix swigrun.swg warnings reported when using "gcc -W -Wall"
15370 (static/inline not used in front of a function
15371 declaration), and add SWIGUNUSED attribute to avoid
15372 unused warnings elsewhere.
15373
15374 Fix unused variable warnings.
15375
15376 [Python] Use new SWIGUNUSED attribute to avoid warnings in
15377 SWIGINTERN methods.
15378
15379 [Python] Fix PyOS_snprintf for python versions < 2.2 (SF #1104919).
15380
15381 [Python] Fix map/multimap to allow empty maps (reported by
15382 Philippe Hetroy).
15383
15384 [Docs] Add some documentation to Python.html and
15385 SWIGPlus.html, including for example the fact that
15386 'friends' are now supported.
15387
1538802/21/2005: wsfulton
15389 [PHP] Patch from Olly Betts, so that wrappers compile with Zend thread safety enabled.
15390
1539102/17/2005: wsfulton
15392 Memory leak fix in some of the scripting language modules when using default
15393 arguments in constructors. The scripting language was not taking ownership of the
15394 C++ object memory when any of the constructors that use default arguments was called.
15395
1539602/16/2005: wsfulton
15397 SF #1115055: Failed make install. Patch from Rob Stone.
15398
1539902/16/2005: wsfulton
15400 [Java] SF #1123416 from Paul Moore. Correct memory allocation for STRINGARRAY
15401 typemaps in various.i.
15402
1540302/15/2005: wsfulton
15404 Disabled typemap search changes for now (see entry 19/12/2004). It breaks
15405 old typemaps, lengthens the execution time by about 25% and introduces
15406 inconsistencies.
15407
1540802/15/2005: wsfulton
15409 swig -help follows other software by printing to stdout instead of stderr now.
15410 swig -version also displays to stdout instead of stderr now.
15411 Behaviour reported by Torsten Landschoff.
15412
1541302/15/2005: wsfulton
15414 [Ruby] Fix for the less commonly used ordering of %include and #include, so
15415 that the generated code compiles. Bug reported by reported by Max Bowsher.
15416 %include foo.h
15417 %{
15418 #include foo.h
15419 %}
15420
1542102/15/2005: wsfulton
15422 [C#, Java] SWIG_exception macro will now return from unmanaged code / native code
15423 as soon as it is called. Fixes possible JVM crashes and other code unexpectedly
15424 being executed. Note SWIG_exception is only occasionally used by SWIG library
15425 writers, and is best avoided by SWIG users.
15426
1542702/15/2005: wsfulton
15428 [C#, Java] Typemaps can now be targeted at global variable names
15429 and static member variable names. Previously the typemaps for
15430 the setters were ignored, for example:
15431
15432 %typemap(in) int globalint "..."
15433 int globalint;
15434
1543502/13/2005: mkoeppe (Matthias Koeppe)
15436 [Guile] Add %typecheck for SWIGTYPE, add %typecheck for ptrdiff_t, fix
15437 typemaps for size_t.
15438
15439 [Pike] Merge patch from Torsten Landschoff for improved Pike configuration.
15440
1544102/12/2005: mkoeppe (Matthias Koeppe)
15442 New configure switches --without-tcl, --without-python etc. allow to
15443 disable the search for installed languages.
15444
1544501/31/2005: wuzzeb (John Lenz)
15446 - Add DohSortList to DOH
15447
15448 - Improve the runtime type system:
15449 + Speed. Type loading is now O(n log n) instead of O(N^2), which
15450 for large modules is a huge improvement.
15451 + A whole bunch of functions in swigrun.swg no longer need the
15452 swig_type_list_handle passed to them. The only one left is
15453 TypeQuery. This also makes runtime.swg a lot smaller.
15454 + Split up swig_type_info structure into two structures
15455 (swig_type_info and swig_cast_info)
15456 + Store a pointer to a swig_type_info rather than just the type
15457 name string in the linked list of casts. First off, this makes
15458 the guile module a little faster, and second, the
15459 SWIG_TypeClientData() function is faster too.
15460 + Add the idea of a module into the type system. Before, all the
15461 types were stored in one huge linked list. Now, another level is
15462 added, and the type system stores a linked list of modules, each
15463 of which stores an array of types associated with it.
15464 + For more information of how the runtime type system now works,
15465 please see Doc/Manual/typemaps.html and Doc/Devel/runtime.txt
15466
15467 - Update all language modules to use the new type system. The changes
15468 to each language module are minor. All languages are now able to
15469 use runtime.swg for external access to the type system. Before
15470 only python and perl did.
15471
15472 - [guile, mzscheme, ocaml, and php4] These languages opened up the
15473 init function inside the .cxx code, and any code in the .swg files
15474 in the init section was inside this function. This was a problem
15475 for swiginit.swg, which needs to be inserted before the SWIG_init
15476 function is opened. Thus I changed these languages to be like
15477 python or perl, where the init function is declared in the .swg
15478 file.
15479
15480 - [Ruby] Instead of moving the init function to the .swg file, I
15481 added a new section initbeforefunc, and then added
15482 %insert(initbeforefunc) "swiginit.swg"
15483
15484 - [MzScheme] Fix enums and fix Examples/Makefile.in so that if
15485 multiple -I arguments are specified in the INCLUDES variable, each
15486 gets a ++ccf.
15487
15488 - [Guile GH] Update Guile GH to use the new type system. See
15489 Doc/Manual/Guile.html for how smobs are now used.
15490
1549101/11/2005: wsfulton
15492 [C#] New typemap called 'csconstruct'. The code in this typemaps was previously hard
15493 coded and could not be customised by a user. This typemap contains the code that is
15494 generated into a proxy class's constructor.
15495
15496 [Java] New typemap called 'javaconstruct'. The code in this typemaps was previously hard
15497 coded and could not be customised by a user. This typemap contains the code that is
15498 generated into a proxy class's constructor. Another typemap named 'javaconstruct_director'
15499 is used instead when the proxy class is a director class.
15500
15501 [C#, Java] If a C++ class did not have a default constructor, a protected default constructor
15502 was automatically generated by SWIG. This seems is unnecessary and has been removed
15503 and thereby giving the user almost complete control over the generated code along with the
15504 new typemaps above.
15505
1550619/12/2004: mmatus
15507 [Disabled, see entry 02/15/2004]
15508 - Fix typemap search, now the "out" typemap search is done as follows
15509
15510 int *Foo::foo(int bar) -> int *Foo::foo(int bar)
15511 -> int *Foo::foo
15512 -> int *foo(int bar)
15513 -> int *foo
15514 -> int *
15515
15516 then, now you can be more specific, and define
15517
15518 /* apply only for 'Foo::foo' method */
15519 %typemap(out) int * Foo::foo(int *bar) ...;
15520
15521 /* apply for all 'foo' functions/methods */
15522 %typemap(out) int * foo(int *bar) ...;
15523
15524 %inline {
15525 struct Foo {
15526 int *foo(int *bar);
15527 };
15528 }
15529
15530
1553115/12/2004: mmatus
15532 - More fixes for templates and template default args.
15533 See template_default.i for scary cases that now are
15534 supported, besides the already ugly STL/std cases.
15535
15536 - Cosmetics and more use of 'const' where it was implicit.
15537 - Other fixes for OSS, which is now working again with 1.3.25.
15538
William S Fulton212837f2004-12-15 00:13:07 +000015539Version 1.3.24 (December 14, 2004)
15540==================================
15541
1554212/12/2004: wuzzeb (John Lenz)
15543 [Chicken] Fix a bunch of bugs relating to -proxy support
15544 + non-class variables now export properly using -proxy
15545 + static member functions now export properly using -proxy
15546 + member class variables now export properly using -proxy
15547 + added a -nounit argument, which does not export the (declare (unit ...))
15548 + correctly install swigclosprefix.scm
15549 + constants (enums, defines) now correcly export when using -proxy
15550
1555112/11/2004: wsfulton
15552 configure fix for when more than one version of jni_md.h is found
15553 in the Java include directory (was generating lots of sed error
15554 messages).
15555
1555612/08/2004: wsfulton
15557 [Java] Fixes to arrays_java.i so that one can apply the array
15558 typemaps to functions taking pointers as input, eg
15559
15560 %include "arrays_java.i"
15561 %apply int[] {int*};
15562 void foo(int *a);
15563
1556412/05/2004: wsfulton
15565 [Java] Director mods contributed by Scott Michel. New typemaps
15566 directordisconnect and directordisconnect_derived for the
15567 swigDirectorDisconnect() method. Also fix to get the javapackage
15568 typemap working again.
15569
1557012/05/2004: mmatus
15571 - Finishing the fixes for templates + default template
15572 args + specializations.
15573
15574 - [Python] Now we use the new templates + default template
15575 args in the std/STL library. That means the internal
15576 swig files are getting uglier since we now support the
15577 original declarations:
15578
15579 template<class _Tp, class _Alloc = std::allocator< _Tp > >
15580 class vector {
15581 ....
15582 };
15583
15584 template<class _Key, class _Tp, class _Compare = std::less<_Key >,
15585 class _Alloc = std::allocator<std::pair<const _Key, _Tp > > >
15586 class map {
15587 ....
15588 };
15589
15590 and the user can use the %template directive as
15591
15592 %template() std::vector<int>;
15593 %template() std::vector<int, std::allocator<int> >;
15594 %template() std::vector<int, MyAllocator<int> >;
15595
15596 Now we are closer to the cleaning/rewriting of the
15597 python std/STL support, such that we recover support for
15598 MSVC++ 6.0, and we can add support for other languages
15599 too.
15600
15601
1560212/02/2004: wsfulton
15603 [Java] Fix for directors when wrapping methods using a member enum
15604 and typesafe/proper enums enabled.
15605
1560612/01/2004: mmatus
15607 - Fix typemaps to work with templates and default template
15608 args, ie
15609
15610 template <class A, class B = int>
15611 struct Foo {
15612 };
15613
15614 %typemap(in) Foo<int> *{...}
15615 %typemap(out) Foo<int,int> *{...}
15616
15617 Foo<int> * foo( Foo<int> *f1, Foo<int,int> *f2);
15618
15619 now 'f1', 'f2' and the return value resolve the provided
15620 typemaps properly.
15621
15622 This is highly needed for proper STL support, see new
15623 std_basic_string.i, std_sstream.i, etc.
15624
15625 - Added std_sstream.i, and fix std_basic_string.i to use
15626 the new typemaps + template def. arg mechanism. Also,
15627 added the needed std_alloc.i. Now, all the containers
15628 can be modified to support std::allocator, like in:
15629
15630 template<class T, class A = std::allocator<T > >
15631 class vector {
15632 public:
15633 ....
15634 };
15635
15636 This change is only completed by now for basic_string.
15637
15638 - Fix for smart pointers + members + extensions:
15639
15640 %extend Foo {
15641 int extension(int i, int j) { return i; }
15642 int extension() { return 1; }
15643 }
15644
15645 %inline %{
15646
15647 class Foo {
15648 public:
15649 int y;
15650 static const int z;
15651 };
15652
15653 class Bar {
15654 Foo *f;
15655 public:
15656 Bar(Foo *f) : f(f) { }
15657 Foo *operator->() {
15658 return f;
15659 }
15660 };
15661
15662 now you can
15663
15664 f = Foo()
15665 f.y = 3
15666 a = f.z
15667 f->extension()
15668
15669 b = Bar(f)
15670 b.y = 3
15671 a = b.z
15672 b->extension()
15673
15674 - Other small errors fixes, mostly python.
15675
1567611/25/2004: wsfulton
15677 [Java] Numerous director bug fixes so that the correct java types
15678 and canonicalized types in the JNI code are emitted. Use of the
15679 $javaclassname special variables in the director typemaps now
15680 consistent with the non-director typemaps. The types used for
15681 typemap lookups are also corrected in a few places. If you
15682 previously had your own director typemaps, ensure they are using the
15683 correct C++ type.
15684
15685 *** POTENTIAL INCOMPATIBILITY FOR JAVA DIRECTORS ***
15686
1568711/25/2004: wsfulton
15688 const enum SWIGTYPE & typemaps added. These wrap const enum references
15689 as if they were passed by value. Const enum references thus work the
15690 same as const reference primitive types such as const double &,
15691 const int & etc. Typemaps added for Java, C#, Ruby, Tcl, Perl and Pike.
15692
1569311/25/2004: wsfulton
15694 [Java, C#] New special variable: $*javaclassname, similar to $javaclassname
15695 and $&javaclassname. The new one removes a pointer from the C type before
15696 obtaining the Java class name. One or more of $javaclassname,
15697 $&javaclassname or $*javaclassname may now appear in a typemap. Likewise for
15698 C# using csclassname instead of javaclassname.
15699
1570011/25/2004: wsfulton
15701 The last vestiges of enums being handled as integers removed from the
15702 internals. The wrapper methods use the enum type rather than an int
15703 now. The net result is added type safety for enums when handled as
15704 pointers, references etc. Previously in situations such as a method
15705 taking a pointer to an enum, a pointer to an int or a pointer to an
15706 enum of some other type could inadvertantly be passed to the method.
15707 This is now fixed as the descriptor for an enum is no longer based on
15708 an int, but the enum type instead. Anonymous enums are still handled
15709 as integers.
15710
15711 The consequence for scripting language users in correct usage of enums
15712 should not be noticeable. There is no change for any of the languages
15713 where enums are passed by value - most of the scripting languages will
15714 still accept an integer for an enum value and the strongly typed
15715 languages still use either typesafe enums, integers or proper enums
15716 depending on what the user configures. For Java and C# users a change
15717 in the typewrapper class name has occurred (for enum pointers,
15718 references etc). For example:
15719
15720 enum Numbers { one=1, two };
15721 enum Numbers* number();
15722
15723 In Java and C# this must now be coded as
15724
15725 SWIGTYPE_p_Numbers n = modulename.number();
15726
15727 rather than
15728
15729 SWIGTYPE_p_int n = modulename.number();
15730
15731 *** POTENTIAL INCOMPATIBILITY ***
15732
1573311/21/2004: wsfulton/mmatus
15734 Added missing deprecated warning for %name and remove remaining %name
15735 usage in the SWIG libraries.
15736
1573711/21/04: mmatus
15738 - [Python] Adding the PySwigObject to be used for carrying
15739 the instance C/C++ pointers. This is used instead of
15740 string and PyCObjects.
15741
15742 The new PySwigObject is even safer than PyCObject, and
15743 more friendly than plain strings:
15744
15745 now you can do
15746
15747 print a.this
15748 <Swig Object at _00691608_p_A>
15749
15750 print str(a.this)
15751 _00691608_p_A
15752
15753 print long(a.this)
15754 135686400
15755
15756 print "%s 0x%x" % (a.this, a.this)
15757 _00691608_p_A 0x8166900
15758
15759 the last one is very useful when debugging the C/C++
15760 side, since is the pointer value you will usually get
15761 from the debugger.
15762
15763 Also, if you have some old code that uses the string
15764 representation "_00691608_p_A", you can use it now again
15765 using 'str(ptr)', or by calling 'str = PyObject_Str(obj)'
15766 in the C/C++ side.
15767
15768 This change is mainly for nostalgic swig users that miss
15769 the string representation, but also allows to say again
15770
15771 if a.this == b.this:
15772 return "a is b"
15773
15774 and well, since the change were really simple, maybe in
15775 the future we will be able to do
15776
15777 next = a.this + 1
15778
15779 or add native python iteration over native C/C++ arrays,
15780 ie, no need to create/copy new tuples when returning and
15781 array or vector.
15782
15783 Also, a PySwigPacked object was adding to carry a member
Olly Betts2860e282023-04-27 10:35:22 +120015784 method pointer, but this is probably a temporary solution
William S Fulton212837f2004-12-15 00:13:07 +000015785 until a more general object for methods is added.
15786
15787 Be aware that to simplify maintaining and compatibility
15788 with other tools, the old string and PyCObjects
15789 representation could disappear very soon, and the
15790 SWIG_COBJECTS_TYPES or SWIG_NO_OBJECT_TYPES macros will
15791 have no effect at compilation time. Still, the three
15792 mechanisms are present in the code just for testing,
15793 debugging and comparison purposes.
15794
1579511/21/04: mmatus
15796
15797 - [Python] Adding back support for using the swig runtime code
15798 inside the user code. We just allow the user to include
15799 the minimal code needed to implement the runtime
15800 mechanism statically, just as in done in the swig
15801 modules.
15802
15803 To use the swig runtime code, for example with python,
15804 the user needs include the following:
15805
15806 #include <Python.h> // or using your favorite language
15807 #include <swigrun.swg>
15808 #include <python/pyrun.swg> // or using your favorite language
15809 #include <runtime.swg>
15810
15811 the files swigrun.swg, pyrun.swg and runtime.swg can
15812 be checked out by using swig -co, or they can simply
15813 be found by adding the swig lib directory to the
15814 compiler include directory list, for example
15815
15816 SWIGLIB=`swig -swiglib`
15817 c++ -I${SWIGLIB} ..
15818
15819 of better, using the CPPFLAGS, but that depends on your
15820 environment.
15821
15822 This change can be ported to the other languages too,
15823 you just need to isolate the needed runtime code in
15824 a single file like 'pyrun.swg', and provide the
15825 SWIG_Runtime_GetTypeList() method. Look at the
15826 Lib/python/pyrun.swg file and the Examples/python/swigrun
15827 example.
15828
1582911/15/04: mmatus
15830 - Fix mixed_types.i + gcc-3.4, ie, arrays + references +
15831 typedefs
15832
15833 - Fix multidim arrays + typedefs,ie
15834
15835 typedef char character[1];
15836 typedef character word[64];
15837
15838 - Process protected/private bases in the same way before
15839 we process protected/private members, ie, we check
15840 for constructors, operator new, virtual members, etc.
15841
15842 - Fix Ruby/Java to work (or ignore) multi-inheritance +
15843 directors. Allow other languages to define if it is
15844 supported or not.
15845
15846 - Now you can run
15847
15848 SWIG_FEATURES="-directors -dirprot"
15849 make check-ruby-test-suite
15850 make check-python-test-suite
15851 make check-java-test-suite
15852 make check-ocaml-test-suite
15853
15854 and you will get only 'real' errors. ruby and python
15855 compile with no errors, java shows some problems.
15856
Marcelo Matus04b8c592004-11-15 23:00:40 +000015857Version 1.3.23 (November 11, 2004)
Olly Bettsfdcea432009-02-26 05:53:37 +000015858==================================
Marcelo Matus04b8c592004-11-15 23:00:40 +000015859
Marcelo Matus79e259b2004-11-15 23:19:12 +00001586011/05/2004: wsfulton
Marcelo Matus04b8c592004-11-15 23:00:40 +000015861 Patch #982753 from Fabrice Salvaire: Adds dependencies generation for
15862 constructing makefiles. New command line options -MF -MD -MMD to work
15863 with the current options -M and -MM. These options are named the same
15864 and work the same as in gcc.
15865
Marcelo Matus79e259b2004-11-15 23:19:12 +00001586611/05/2004: wsfulton
Marcelo Matus04b8c592004-11-15 23:00:40 +000015867 %ignore/%rename changes for methods with default arguments to mirror
15868 %feature behaviour. See previous entry.
15869
15870 *** POTENTIAL INCOMPATIBILITY ***
15871
1587211/04/2004: wsfulton
15873 %feature improvements for fine tuning when wrapping methods with
15874 default arguments. Any %feature targeting a method with default arguments
15875 will apply to all the extra overloaded methods that SWIG generates if the
15876 default arguments are specified in the feature. If the default arguments are
15877 not specified in the feature, then the feature will match that exact
15878 wrapper method only and not the extra overloaded methods that SWIG generates.
15879 For example:
15880
William S Fulton2862a0a2014-10-16 07:48:05 +010015881 %feature("except") hello(int i=0, double d=0.0);
Marcelo Matus04b8c592004-11-15 23:00:40 +000015882 void hello(int i=0, double d=0.0);
15883
15884 will apply the feature to all three wrapper methods, that is:
15885
15886 void hello(int i, double d);
15887 void hello(int i);
15888 void hello();
15889
15890 If the default arguments are not specified in the feature:
15891
William S Fulton2862a0a2014-10-16 07:48:05 +010015892 %feature("except") hello(int i, double d);
Marcelo Matus04b8c592004-11-15 23:00:40 +000015893 void hello(int i=0, double d=0.0);
15894
15895 then the feature will only apply to this wrapper method:
15896
15897 void hello(int i, double d);
15898
15899 and not these wrapper methods:
15900
15901 void hello(int i);
15902 void hello();
15903
15904 This has been introduced to make %feature more powerful to ease the migration
15905 to new default arguments wrapping approach.
15906
15907 *** POTENTIAL INCOMPATIBILITY ***
15908
15909 If you previously had a %feature and didn't specify the default arguments,
15910 you will have to add them in now or you can obtain the original behaviour
15911 by using %feature("compactdefaultargs").
15912
1591311/04/2004: wsfulton
15914 [C#] Typemaps for std::vector added into std_vector.i. The proxy classes
15915 generated are modelled on the .NET ArrayList class. This isn't quite
15916 ready for general consumption yet, but will work with vectors of primitive
15917 types and some classes.
15918
1591910/3/2004: wuzzeb (John Lenz)
15920 [GUILE] The -scm interface is now the default. The old GH interface can
15921 still be enabled by passing -gh to SWIG.
15922
1592310/2/2004: mmatus
15924
15925 - More fixes for namespace + class declarations.
15926 As an extra bonus, we get %template support for static/members class
15927 methods, ie, now you can say:
15928
15929 namespace space {
15930 struct A
15931 {
15932 template <class Y>
15933 static void fooT(Y y) { }
15934 };
15935 }
15936
15937 struct B
15938 {
15939 template <class Y>
15940 void barT(Y y) {}
15941 };
15942
15943 %template(foo) space::A::fooT<double>;
15944 %template(foo) space::A::fooT<int>;
15945 %template(foo) space::A::fooT<char>;
15946
15947 %template(bar) B::barT<double>;
15948 %template(bar) B::barT<int>;
15949 %template(bar) B::barT<char>;
15950
15951 and call
15952
15953 A.foo(1)
15954 b = B()
15955 b.bar(1)
15956
Sylvestre Ledru7dac1bc2012-08-08 09:19:26 +000015957 note the methods are emitted inside the classes,
Marcelo Matus04b8c592004-11-15 23:00:40 +000015958 and hence, the %template name refers to the 'member'
15959 method name, not a global namespace name.
15960
1596110/31/2004: mmatus
15962 - Solve namespace + class declarations, as in
15963
15964 namespace foo {
15965 struct Bar;
15966 struct Foo {
15967 };
15968 }
15969
15970 struct foo::Bar : Foo {
15971 };
15972
15973 see namespace_class.i for more examples.
15974
15975 - Fix %template directive to properly use namespaces,
15976 including the case:
15977
15978 namespace one
15979 {
15980 template <typename T>
15981 struct Ptr {};
15982 }
15983
15984 namespace one
15985 {
15986 struct Obj1 {};
15987 typedef Ptr<Obj1> Obj1_ptr;
15988 %template(Obj1_ptr) Ptr<Obj1>;
15989 }
15990
15991 namespace two
15992 {
15993 struct Obj2 {};
15994 typedef one::Ptr<Obj2> Obj2_ptr;
15995 %template(Obj2_ptr) one::Ptr<Obj2>;
15996 }
15997
15998 this is done by using the namespace name 'one' to create
15999 a namespace node to emit the template instantiation,
16000 just as before, but the template parameters are resolved
16001 and qualified in the current namespace ('one' or 'two').
16002 This is same way that typedef works.
16003
16004 This resolve the smart_pointer_namespace2.i case, and at
16005 the same time, several other ones where before swig was
16006 generating the
16007
16008 "Can't instantiate template 'xx' inside namespace 'yy'"
16009
16010 error message. In fact, that error doesn't exist
16011 anymore. You can only get an error if you use a bad
16012 namespace name or so.
16013
1601410/30/2004: mmatus
16015 - [ruby] Directors fixes:
16016 - enums and std::strings are working now (several
16017 reports in bug track system)
16018 - added patch 1025861 for director + exceptions
16019
16020 *** Attention ***: ruby with directors + protected
16021 members work with version 1.7+. Older versions seems to
16022 have a broken signature for'rb_protect'.
16023
16024 If you need to use an old version, look at
16025
16026 http://excruby.sourceforge.net/docs/html/ruby__hacks_8hpp-source.html
16027 for workarounds.
16028
16029 - [ruby] Fix memory allocation problem in typemap (bug 1037259)
16030
16031 - [tcl] Fix (enums|constants) + namespace option
16032 (reported by [email protected]).
16033
16034 - [perl] Add patch 962168 for multiple inheretance
16035
16036 - Fix 'defined' as variable name.
16037
1603810/29/2004: wsfulton
16039 Seg fault fix for global scope operator used for friend methods:
16040
16041 class B {
16042 friend void ::globalscope();
16043 ...
16044 };
16045
1604610/28/2004:mmatus
16047 - Added module and swig option "templatereduce" to force swig
16048 to reduce any type needed with templates, ie, in these cases
16049
16050 %module("templatereduce") test
16051
16052 template <class T> struct A { };
16053
16054 typedef int Int;
16055 %template(A_Int) A<Int> ==> %template(A_Int) A<int>
16056
16057 typedef B* Bp;
16058 %template(A_Bp) A<Bp> ==> %template(A_Bp) A<B*>
16059
16060 swig reduces the types Int and Bp to their primitives
16061 int and B*. This is closer to the usual compiler
16062 resolution mechanism, and it is really needed sometimes
16063 when you mix templates + typedefs + specializations.
16064
16065 Don't use it if you don't have any problem already,
16066 since the type reduction can interfere with some
16067 user typemaps, specially if you defined something like
16068
16069 typedef int Int;
16070 %typemap(in) Int ...;
16071
16072 in this case, when you use the "templatereduce" option,
16073 swig will ignore the user typemap, since the "typedef int Int"
16074 will take precedence, and the usual "int" typemap will be
16075 applied.
16076
16077 Note that the previous case is not common, and should be
16078 avoided, ie, is not recommended to use a typedef and a
16079 typemap at the same time, specially if you are going to
16080 use templates + specializations.
16081
16082 - Directors:
16083
16084 virtual destructor is always emitted now, this doesn't
16085 cause any harm, and could solve some nasty and
16086 mysterious errors, like the one mentioned by Scott.
16087
16088 also the destructor is not in-lined, so, that can solve
16089 some other mysterious errors when mixing directors +
16090 imports + embedded applications + some specific compilers.
16091
1609210/27/2004: wsfulton
16093 [C#] typemaps.i library file with INPUT, OUTPUT and INOUT typemaps added.
16094
1609510/27/2004: wsfulton
16096 [Java] std::wstring typemap fixes in std_string.i from Russell Keith-Magee.
16097
1609810/25/2004: mmatus
16099
16100 - Using + namespace is working now (using_namespace.i).
16101
16102 - Derived + nested classes is working now
16103 (deriver_nested.i), but of course, we are still waiting
16104 for the nested class support.
16105
16106 - Directors:
16107 - unnamed parameters support,
16108
16109 - protected constructor support (automatic and with
16110 dirprot mode),
16111
16112 - detection of really needed protected declarations
16113 (members and constructors) now is done automatically.
16114 Even if you don't use the 'dirprot' mode, swig will
16115 wrap what is minimally needed (and protected) for the
16116 code to compile.
16117
16118 what is public, as usual, is always wrapped, and if
16119 you use the 'dirport'
16120
16121
16122 - Final fixes for the OSS to compile with SWIG 1.3.23 (my
16123 very very ugly C++ + templates + everything mounters wrap).
16124
1612510/25/2004: wsfulton
16126 [C#] New commandline option -dllimport. This enables one to specify
16127 the name of the DLL for the DllImport attribute. Normally this name
16128 comes from the module name, so now it is possible to override this:
16129
16130 swig -csharp -dllimport xyz example.i
16131
16132 will generate for all the wrapped PInvoke methods:
16133
16134 [DllImport("xyz", EntryPoint="...")]
16135 public static extern ...
16136
16137 The wrappers from many different SWIG invocations can thus be compiled
16138 into one DLL.
16139
16140 A new special variable $dllimport can also be used in typemaps, pragmas,
16141 features etc. This will get translated into the value specified by -dllimport
16142 if specified, otherwise the module name.
16143
1614410/22/2004: wsfulton
16145 [Java] Patch #1049496 from Scott Michel fixes directors methods with
16146 enums when wrapped with typesafe or proper Java enums.
16147
1614810/21/2004: wsfulton
16149 Fixes for default arguments in director constructors (Python, Ruby, Ocaml).
16150
1615110/21/2004: mmatus
16152 - [Python] Add the '-cpluscast' option to enable the 'new'
16153 C++ casting operators, such as 'static_cast', inside the
16154 typemaps. By default swig use the old C cast style, even
16155 when parsing C++.
16156
16157 - [Python] Add the '-new_vwm' option to enable the new
16158 SwigValueWrapper mode. Now this is mainly for testing
16159 that the typemaps are really safe for any future
16160 solution, but you can use it if you have a very strange
16161 error with default cosntructors missing + %apply +
16162 %typemap, and if everything else fails (see
16163 valuwrapper_opaque.i for alternative and current
16164 solutions). If you are a user that don't know what is
16165 SwigValueWrapper, don't even try it.
16166
16167 - [Python] Add the '-noh' option to be used with directors
16168 and when you prefer to disable the generation of the
16169 director header file. If not used, swig will work as
16170 usual generating both the wrap.cxx and wrap.h files. If
16171 you use it, swig will only generate wrap.cxx.
16172
1617310/21/2004: wuzzeb (John Lenz)
16174 - If you define SWIG_TYPE_TABLE when compiling a wrapper file,
16175 the runtime types will be stored in the given type table name.
16176 Using this, you can seperate different modules to share their
16177 own type systems. -DSWIG_TYPE_TABLE=Mytable
16178
16179 - [Python] If you define SWIG_STATIC_RUNTIME then the type information
16180 will be static to this wrapper. Nothing will be shared with any
16181 other modules
16182
16183 - [Python] If you define SWIG_LINK_RUNTIME, then instead of using
16184 the new way of sharing type information, the wrapper will expect
16185 to be linked against the Lib/linkruntime.c file. Any modules compiled
16186 with SWIG_LINK_RUNTIME and linked against linkruntime.c will all
16187 share type information.
16188
1618910/20/2004: mmatus
16190 - [Python] Initial fix for python/import example. Please
16191 update the Makefile (autoconf, configure, etc, expert),
16192 since now probably is only working with g++, icc and a
16193 few other compilers that have the -shared option.
16194
16195 We need to create additional shared libraries for the
16196 virtual destructors. Old and usually forgotten C++
16197 requirement.
16198
16199 Same fix need to be used in perl, I think.
16200
16201 - [Python] Fix generation of header file for directors,
16202 now directors.swg is also included, so, it can be really
16203 used from C++, and it solves some problem with compiler
16204 that require that, even with the simple swig inclusion.
16205
16206 - [Python] Reordering the methods and moving some bodies
16207 outside the class declaration. This is needed due to
16208 some gcc-2.96 internal compiler errors. It seems the
16209 PYTHON class is getting too large to been declared and
16210 defined at the same time.
16211
16212 - Add the -oh option to change the output header file name
16213 if needed:
16214
16215 swig -c++ -python test.i -o test.CC -oh test.HH
16216
16217 this is mainly needed when using directors, and if the
16218 current default header file name is not good for you,
16219 which is generated as follow:
16220
16221 swig -c++ -python test.i => test_wrap.h
16222 swig -c++ -python test.i -o test.CC => test.h
16223
16224
1622510/20/2004: wsfulton
16226 1) Compact default arguments feature added. This feature allows one
16227 to use the default argument code generation that was used in
16228 SWIG-1.3.22 and earlier versions. It produces more compact wrappers
16229 as only one wrapper method is generated for any method with default
16230 arguments. So the advantage is it generates less code but has the
16231 original limitations, like it it does not work with all default arguments
16232 and default arguments cannot be taken advantage of in the strongly typed
16233 languages (C# and Java). It is implemented via the usual %feature mechanism:
16234
16235 %feature("compactdefaultargs");
16236
16237 2) Keyword arguments (kwargs) are working again for default arguments
16238 in the languages that support it, ie, Python and Ruby. The new default
16239 argument wrapping approach using overloaded methods cannot support kwargs
16240 so the compact default argument feature is automatically turned on when
16241 kwargs are specified, by %feature("kwargs").
16242
16243 3) Compact default arguments are also automatically turned on when wrapping
16244 C (not C++) code. This is to support the bizarre notion of default arguments
16245 for C code.
16246
1624710/20/2004: wsfulton
16248 Overloaded templated functions in namespaces also working now.
16249 Templated functions with default arguments in namespaces too.
16250
1625110/19/2004: mmatus
16252
16253 - Allow to disable the new SwigValueWrapper mechanism,
16254 if you add the following line in your language main.
16255
16256 /* Turn on safe value wrapper use mode */
16257 Swig_value_wrapper_mode(1);
16258
16259
16260 Now is only active in python. All the other languages
16261 are using the old resolution, but they can also use the
16262 "valuewrapper"/"novaluewrapper" features to fix some
16263 of the old broken cases. Note, however, that not all
16264 the broken cases can be solved in that way.
16265
16266 The new mechanism seems to be working fine in perl, ruby
16267 and tcl, but failing in some typemaps in java.
16268
16269 Hence, is upto the language maintainer to test it, and
16270 decide to enable it or not.
16271
16272 Look at the valuewrapper_opaque.i for examples.
16273
16274 - Fix more SwigValueWrapper cases when the new mechanism
16275 is active. Now it also check for local typemap
16276 variables, see valuewrapper_opaque.i for an example when
16277 this is needed. But again, this extra checking will only
16278 be activated when using the new value wrapper mode.
16279
16280 - [Python] Fix variable wrapping of classes with private
16281 assign operators. It should be easy to fix in all the
16282 other modules, instead of checking
16283
16284 if (!Getattr(n,"immutable")) ...
16285
16286 you need to verify
16287
16288 if (is_assignable(n)) ...
16289
16290 Look at the private_assign.i for an example.
16291
1629210/18/2004: mmatus
16293 - %features "director"/"nodirector" now work as expected.
16294 - General fixes in %feature to resolve function decl
16295 properly,
16296
16297 %feature("hello") foo();
16298 char foo() -> f() // was working
16299 char *foo() -> f().p // it wasn't
16300
16301
16302 - Template + specialization + default template args now is
16303 working, (don't confuse with template + default arg
16304 values, that was solved before), now this ugly case is
16305 working:
16306
16307 template <class T, class A = Alloc<T> >
16308 struct Vector
16309 {
16310 Vector(T a){}
16311 };
16312
16313 template <>
16314 struct Vector<double>
16315 {
16316 Vector(){}
16317 int foo() { return 0; }
16318 };
16319
16320 %template(V_c) Vector<char, Alloc<char> >;
16321 %template(V_i) Vector<int>; // picks Vector<int,Alloc<int> >
16322 %template(V_d) Vector<double>; // picks the specialization
16323
16324 this is needed for automatic STL support (later will
16325 be).
16326
16327 - Fix the template + typedef errors in test-suite, which
16328 probably will fix another group of strange template +
16329 namespaces + typedefs errors.
16330
16331 - %warnfilter is working better now, parser.y tries to use
16332 them when needed.
16333
16334 - **** New default type resolution method (stype.c) *****
16335
16336 It preserves the original mixed types, then it goes
16337 'backward' first deleting the qualifier, then the inner
16338 types, for example:
16339
16340 typedef A *Aptr;
16341 const Aptr&;
16342 r.q(const).Aptr -> r.q(const).p.SWIGTYPE
16343 r.q(const).p.SWIGTYPE -> r.p.SWIGTYPE
16344 r.p.SWIGTYPE -> r.SWIGTYPE
16345 r.SWIGTYPE -> SWIGTYPE
16346
16347 enum Hello {};
16348 const Hello& hi;
16349 r.q(const).Hello -> r.q(const).enum SWIGTYPE
16350 r.q(const).enum SWIGTYPE -> r.enum SWIGTYPE
16351 r.enum SWIGTYPE -> r.SWIGTYPE
16352 r.SWIGTYPE -> SWIGTYPE
16353
16354 int a[2][4];
16355 a(2).a(4).int -> a(ANY).a(ANY).SWIGTYPE
16356 a(ANY).a(ANY).SWIGTYPE -> a(ANY).a().SWIGTYPE
16357 a(ANY).a().SWIGTYPE -> a(ANY).p.SWIGTYPE
16358 a(ANY).p.SWIGTYPE -> a(ANY).SWIGTYPE
16359 a(ANY).SWIGTYPE -> a().SWIGTYPE
16360 a().SWIGTYPE -> p.SWIGTYPE
16361 p.SWIGTYPE -> SWIGTYPE
16362
16363 before it always stops after finding ref/pointer/enum/array/etc.
16364
16365 Now, then, you can define (use and apply) 'higher' typemaps such as:
16366
16367 %typemap(in) SWIGTYPE* const&
16368 %typemap(out) char FIXSIZE[ANY]
16369 %typemap(in) SWIGTYPE* const&
16370 %typemap(in) const enum SWIGTYPE&
16371 %typemap(in) SWIGTYPE[ANY][ANY]
16372 %typemap(in) const char (&)[ANY]
16373
16374 It is possible with this change that previous typemaps
16375 that were defined (but ignored), now will start to work.
16376
16377 Also, it is necessary check for the '%typemap(varin) SWIGTYPE[]',
16378 before it was usually not defined (but char[] was),
16379 and that can produce some inconsistencies.
16380
16381 *** POTENTIAL INCOMPATIBILITY ***
16382
16383 This change was needed for STL, since std::vector<enum Hello>
16384 std::vector<A*>, etc, will always generate methods that
16385 mix const references with the vector type.
16386
16387 Now that is working, all the std::container<T*>
16388 specialization will not be needed anymore, well, in
16389 theory.
16390
16391 In the practice, everythin is working as before until
16392 the proper mixed types are defined and the libraries
16393 simplified to use them.
16394
16395 - Change the behavior of extern "java"/"fortran"/"etc",
16396 now swig produces a warning, and use extern "C" instead.
16397 The warning can also be disable with the "-w 313" flag.
16398 (WARN_PARSE_UNDEFINED_EXTERN).
16399
16400 - SwigValueWrapper is now more selective (lang.cxx).
16401
16402 [Perl/Tcl]
16403 - Fix some typemaps (perl/tcl) to work properly with
16404 SwigValueWrapper. This was not a problem with
16405 SwigValueWrapper, but with the typemaps that now are
16406 safe to use with %apply.
16407
16408 [Python]
16409
16410 - Fix %callback/%pythoncallback work now as before after
16411 the def args changes. Also, %callback now is an alias
16412 for %pythoncallback, so, they do the same.
16413
16414 [Python/Ruby]
16415 - %callback is more usable and uniform:
16416
16417 %callback("%s_cb") foo(); // for both, python/ruby
16418 %callback("%s_cb"); // for both, python/ruby
16419 %callback(1) foo(); // only in python.
16420
1642110/17/2004: arty
16422 [OCAML]
16423 - Tweak to enum typing for soundness in the presence of multiple
16424 modules.
16425 - global functions are now unambiguous in multiple loaded modules.
16426 - Fixed test case code to build multimodule test cases correctly.
16427 - There is no way to share overload resolution across modules
16428 because of soundness issues. If the user wants to call some
16429 function foo from an arbitrary module bar, they will have to
16430 use Bar._foo to call it correctly. Later I will fix the
16431 camlp4 module to do something clever in this case.
16432 - Promided performance overhaul of class mechanism.
16433 - Removed symbol hack for ocaml-3.07 and below which is not needed
16434 for ocaml-3.08 and above.
16435
1643610/16/2004: wuzzeb (John Lenz)
16437 [CHICKEN]
16438 - Completly change how chicken.cxx handles CLOS and generic code.
16439 chicken no longer exports -clos.scm and -generic.scm. The clos
16440 code is exported directly into the module.scm file if -proxy is passed.
16441 - The code now always exports a unit. Running the test-suite is now
16442 majorly broken, and needs to be fixed.
16443 - CLOS now generates virtual slots for member variables similar to how
16444 GOOPS support works in the guile module.
16445 - chicken no longer prefixes symbols by the module name, and no longer
16446 forces all names to lower case. It now has -useclassprefix and -closprefix
16447 similar to how guile handles GOOPS names.
16448
1644910/16/2004: wsfulton
16450 Templated functions with default arguments working with new default argument
16451 wrapping approach. The new approach no longer fails with the following default
16452 argument pattern (previously failed with some primitive types, like
16453 unsigned primitive types):
16454
16455 template<typename T> int foo(const T& u = T());
16456 %template(foo) foo<unsigned int>;
16457
16458 This relies on the templated function overloading support just added, so all
16459 the combinations of overloading by template parameters and normal parameters
16460 as well as overloading with default parameters works.
16461
1646210/16/2004: wsfulton
16463 Added support for the large range of templated function overloading that C++
16464 supports.
16465
16466 - Overloaded templated functions, eg
16467
16468 template<typename T> int overload(T t);
16469 template<typename T> int overload(T t, const T &r);
16470
16471 - Fixes where the templated type is not used in the parameter list, eg
16472
16473 template<typename T> void xyz();
16474 template<> void xyz<double>();
16475
16476 - Fixes for overloading of plain functions by a templated function:
16477
16478 void abc(double d);
16479 template<typename T> void abc(T t);
16480
16481 - Overloading by templated parameters fixed:
16482
16483 template<typename T> void foo(T t) {}
16484 template<typename T, typename U> void foo(T t, U u) {}
16485
16486 %template(foo) foo<double, double>;
16487
16488 - All combinations of the above also working including specializations, eg:
16489
16490 void abc(double d);
16491 template<typename T> void abc(T t);
16492 template<> void abc<double>(double t);
16493 template<> void abc(int t);
16494
1649510/16/2004: wuzzeb (John Lenz)
16496 - Remove the ability to share type information by using c linking.
16497 All type sharing happens through a global variable in the target language.
16498 + Remove SWIG_NOIMPORT, SWIG_RUNTIME, and related defines.
Olly Betts618868c2014-04-29 11:24:04 +120016499 + Deprecate -runtime, -noruntime command line options
Marcelo Matus04b8c592004-11-15 23:00:40 +000016500 + Update test-suite common.mk to correctly build multicpptest
16501 + Remove reference to precommon.swg
16502 + Update the guile_gh interface to share data by a global var instead
16503 of c linkage.
16504
16505 - Remove Advanced.html, since everything in it is now obsolete
16506
1650710/09/2004: mmatus
16508 - Split the python std/STL C++ library files, now
16509 all the language independent definitions are under
16510 the directory
16511
16512 Lib/std
16513
16514 and hence, can be used from other languages.
16515
16516 - Add more documentation to the Python STL, and
16517 clean unnecessary code.
16518
16519 - Add initial C99 complex support, and some fixes
16520 for long double.
16521
1652210/08/2004: mmatus
16523 - Fix the SwigValueWrapper for opaque types, now it is
16524 applied for opaque templates and classes, for which we
16525 don't know if there is or not a default constructor, ie
16526
16527 struct A {
16528 A(int);
16529 };
16530
16531 Still, if you know that you class has a default
16532 constructor, and for some very very particular reason
16533 you want to avoid the SwigValueWrapper, and you don't
16534 want or can't expose the class to swig, now you can
16535 say
16536
16537 %feature("novaluewrapper") A;
16538 class A;
16539
16540 or the other way around, if the class has a default
16541 constructor, but you want to use the value wrapper, you
16542 can say
16543
16544 %feature("valuewrapper") A;
16545 struct A {
16546 A();
16547 ....
16548 };
16549
16550 - Fix for char > 128, ie
16551
16552 const char tilde_a = '\341';
16553
16554 - Add patch 1041858 for $lextype, which carries the
16555 literal type of a symbol. See lextype.i in the
16556 test-suite for more details.
16557
16558
16559
16560
1656110/07/2004: wsfulton
16562 {Ruby, Java] Fix director + 'empty' throws
16563
16564 struct A {
16565 A() throw();
16566 virtual ~A() throw();
16567 int foo() throw();
16568 };
16569
16570
1657110/06/2004: wuzzeb (John Lenz)
16572 [TCL]
16573 - Fix bug reported by William A. Hoffman propagating clientdata
16574 between modules. Added clientdata_prop.multicpptest to check for
16575 this bug. The fix involved the following changes:
16576 + SwigType_clientdata_collect does not need to check
16577 types in r_resolved because we only want to propagate clientdata
16578 to typedefed classes, and r_mangled already takes care of typedefs.
16579
16580 + SWIG_TypeRegister now copies the clientdata field correctly
16581
16582 + Move SWIG_Guile_PropagateClientData function from guile module
16583 into common.swg, because we need to call it from both guile and tcl.
16584
16585 + Add base_names to swig_class to delay the lookup of bases. SWIG
16586 now exports the base names and only when the base swig_class is
16587 needed is SWIG_TypeQuery(name)->clientdata looked up.
16588
16589 - conversion_ns_template testsuite test was failing because
16590 the name of the wrapped constructor function was not calculated
16591 correctly for structs. Fixed.
16592
1659310/06/2004: wsfulton
16594 Fixes for default arguments used in directors - in virtual
16595 methods and director constructors.
16596
1659710/06/2004: mmatus
16598 Fix the __cplusplus macro, and bug 1041170.
16599 Now it is working as supposed, ie, you can safely use
16600
16601 #ifdef __cplusplus
16602 ...
16603
16604 all over swig, including inside %defines and %{ %} bodies.
16605
16606
16607 *** POTENTIAL INCOMPATIBILITY ***
16608
16609 The old trick of using
16610
16611 #if __cplusplus
16612
16613 doesn't work any more. So, if you have your own typemaps
16614 using that syntax, you will need to migrate them to use
16615 "#ifdef __cplusplus".
16616
1661710/05/2004: wuzzeb (John Lenz)
16618 - Reorganize how runtime type information is stored and shared
16619 between modules. For chicken and mzscheme, I removed
16620 the ability to use runtime libraries, while perl, tcl, python, and
16621 ruby default to using the new method but can go back to the old
16622 method by declaring SWIG_ALLOW_RUNTIME.
16623
16624 - line 582 in mzscheme.cxx was generating a segfault on
16625 imports.multicpptest, so I fixed it.
16626
1662710/05/2004: wsfulton
16628 Fixes for %extend and overloaded static methods with default
16629 arguments.
16630
1663110/05/2004: mmatus
16632 - [python] Fix director + method with 'empty' throw, ie
16633
16634 struct A {
16635 virtual int foo() throw();
16636 };
16637
16638 other languages should also easy to fix, look for
16639 Getattr(n,"throw") in python.cxx.
16640
16641 - Fix director + destructor with 'empty' throw
16642
16643 struct A {
16644 virtual ~A() throw();
16645 };
16646
16647 - Now SWIG_FEATURES parse all and the same options you
16648 can pass to swig in the command line.
16649
16650 - New command line flag: -features <list>, as in
16651
16652 swig -features autodoc=3,director
16653
16654 ie, any global feature can be initialized from the
16655 command line. This is mainly for testing, but users
16656 can also take advantage of it.
16657
1665810/04/2004: mmatus
16659 - Properly qualify type in syntax as 'long(2)' or 'Foo()',
16660 this solve old problem with default args, and probably
16661 other problems around. However, the default arg problem
luz.paz60dfa312018-05-14 11:00:52 -040016662 was also already solved by William (see below).
Marcelo Matus04b8c592004-11-15 23:00:40 +000016663
16664 - Fix feature_set and feature_get methods. Before
16665 they look from particular to general and keep the first
16666 feature found. This didn't work well with templates.
16667 Now the methods look from general to particular, and
16668 override any found feature.
16669
16670 - Previously a feature could not be applied to constructors
16671 or destructors that weren't explicitly declared in the class.
16672 This is now fixed, for example:
16673
16674 %feature("featurename") Foo() "..."
16675 %feature("featurename") ~Foo() "..."
16676 class Foo {
16677 // implicit Foo() and ~Foo()
16678 };
16679
16680 - Fix missing features for default const/dest, by really
16681 'creating' the methods and applying the features.
16682
16683 - Fix return_const_value.i case by adding SwigValueWrapper<const T>
16684 specialization.
16685
16686 - Fix %extend + overload, including overloading actual
16687 class methods.
16688
16689 - Adding more cases in related files in the test-suite.
16690
1669110/04/2004: wsfulton
16692 Changes to the way default arguments are wrapped. Previously a single
16693 method was generated for each method that had default arguments. If
16694 a method had 5 arguments, say, of which 1 had a default argument
16695 then the call to the wrapped method would pass 5 arguments. The default
16696 value was copied into the wrapper method and used if the scripting
16697 language passed just 4 arguments. However, this was flawed as the
16698 default argument sometimes does not have global access, for example
16699 SWIG would generate code that couldn't compile when wrapping:
16700
16701 class Tricky {
16702 public:
16703 void foo(int val = privatevalue);
16704 void bar(int val = Tricky::getDefault());
16705 private:
16706 static int getDefault();
16707 enum { privatevalue = 200 };
16708 };
16709
16710 Also bugs in resolving symbols generated code that wouldn't compile, for example
16711 (probably fixable though):
16712
16713 namespace Space {
16714 class Klass {
16715 };
16716 Klass constructorcall(const Klass& k = Klass());
16717 }
16718
16719 The approach also does not work for statically typed languages (C# and Java)
16720 as these languages do not allow methods to have variable number of arguments.
16721 Although C# has a mechanism to pass a variable number of arguments they
16722 must be of the same type and are more like varargs.
16723
16724 The new approach solves the above problems and wraps methods with default
16725 arguments as if the method was overloaded. So SWIG will now treat
16726
16727 void foo(int val=0);
16728
16729 as if it had parsed:
16730
16731 void foo(int);
16732 void foo();
16733
16734 The code generated is then exactly the same as if SWIG had parsed the two
16735 overloaded methods. The scripting languages count the arguments passed and call
16736 the appropriate method, just like overloaded methods. C# and Java are now able
16737 to properly wrap methods with default arguments by generating extra methods,
16738 again as if the method was overloaded, so for:
16739
16740 void bar(string s="hello", double d=10.0, int i=0);
16741
16742 the following proxy methods are generated:
16743
16744 void bar(string s, double d, int i);
16745 void bar(string s, double d);
16746 void bar(string s);
16747 void bar();
16748
16749 The new approach comes with a couple of minor knock on effects.
16750
16751 1) SWIG support for default arguments for C (not C++) code no longer works.
16752 Previously you could have this interface:
16753
16754 %{
16755 void foo(int val);
16756 %}
16757 void foo(int val=0);
16758
16759 and call the wrapped method from a scripting language and pass no arguments
16760 whereupon the default of 0 was used. You can get the same behaviour for C
16761 code by using the "default" typemap:
16762
William S Fultonc10a84c2022-08-20 22:14:58 +010016763 %typemap(default) int val "$1 = 0;"
Marcelo Matus04b8c592004-11-15 23:00:40 +000016764 %{
16765 void foo(int val);
16766 %}
16767 void foo(int val);
16768
16769 or you could of course compile your code as C++ if you want C++ features :) :
16770
16771 %{
16772 void foo(int val=0);
16773 %}
16774 void foo(int val=0);
16775
16776 A couple of SWIG's libraries used this C extension and these have been modified
16777 to use the "default" typemap. The "default" typemap is thus unchanged (and still
16778 is not and is not fully supported by C# and Java, and is likely to remain so).
16779
16780
16781 2) All features (%feature, %rename, %ignore etc) no longer work as if the method
16782 with default arguments is just one method. For example, previously
16783
16784 %ignore foo(int);
16785
16786 would have ignored the method completely. Now it will only ignore foo(int) but
16787 not the extra foo() method. Instead use:
16788
16789 %ignore foo;
16790
16791 to ignore them all. or
16792
16793 %ignore foo(int);
16794 %ignore foo();
16795
16796 This of course allows one to fine tune the wrapping, for example one could use:
16797
16798 %rename(fooint) foo(int);
16799 %rename(foodefaults) foo();
16800 void foo(int val=0);
16801
16802 and call them from any language like so:
16803
16804 fooint(200)
16805 foodefaults()
16806
16807 or for example ignore the extra overloaded method, so the defaults cannot be used:
16808
16809 %ignore foo();
16810 void foo(int val=0);
16811
16812 *** POTENTIAL INCOMPATIBILITY ***
16813
1681410/2/2004: mmatus
16815 [Python]
16816 - More cleaning up and uniformation on the Python Lib
16817
16818 - Added Robin's docstring patch, plus some fixes, plus
16819 some extensions, see autodoc.i example in the test-suite,
16820 and try using %feature("autodoc","extended").
16821
16822 This patch is not a complete solution for the
16823 documentation problem, just enough to inform python about
16824 the parameter list.
16825
16826 The expected swig documentation support is far far away yet.
16827
16828
1682910/1/2004: mmatus
16830 - Fix the %callback feature (only used in ruby and python examples,
16831 by now, but it should be generic), now member callbacks
16832 are working again
16833
16834 - Fix wrapping of functions pointers like
16835
16836 std::ostream& std::endl(std::ostream&);
16837
16838 ie, the ones that return references or enums.
16839
16840 [Python] Add the %pythoncallback directive, which is
16841 an improved version of %callback, ie,
16842
16843 %pythoncallback(1) foo;
16844 %pythoncallback(1) A::bar;
16845 %pythoncallback(1) A::barm;
16846
16847 int foo(int a) {
16848 return a;
16849 }
16850
16851 struct A
16852 {
16853 static int bar(int a);
16854 int barm(int a);
16855
16856 };
16857
16858 int foobar(int a, int (*pf)(int a));
16859
16860 in python you can use
16861
16862 foo(2)
16863 foobar(2,foo)
16864 A.bar(2)
16865 foobar(2,A.bar)
16866
16867 ie, no additional pointer elements are created, and
16868 the original 'foo' and 'A.bar' can be used as parameters.
16869
William S Fulton99bbc652017-10-17 19:19:37 +010016870 In the case of member function however, still you need
Marcelo Matus04b8c592004-11-15 23:00:40 +000016871 to use the special variable Class::<fnc_name>_cb_ptr, ie:
16872
16873 foobarm(3, a, A.barm_cb_ptr)
16874
16875 we will try to fix this situation also, but later.
16876
16877 [Python] Add more elements from the STL library, now
16878 you can use
16879
16880 import std
16881 std.cout << "hello " << 123 << std.endl
16882
16883 [Python] Fix in/out return mechanism, now swig will behave
16884 as 1.3.21 but using a python list when needed. The problem
16885 is that the types std::pair,std::vector,etc, use tuples,
16886 and they interfer with the previous inout tuple type.
16887
16888 By using lists we solve the conflicts, swig acts as before,
16889 but returns a list when more than one parameter are using
16890 the OUT typemap. See the new inout.i example in the
16891 test-suite.
16892
16893 *** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***
16894
16895 [Python] Much better error messages for bad arguments, now
16896 you always get the argument number where the error occurred.
16897
1689809/27/2004: wsfulton
16899 Patch from Bill Clarke -
16900 1) Warning emitted when -importall and -includeall is used together,
16901 with -includeall taking precedence.
16902 2) Ensure SWIGIMPORTED is always defined when a file is being
16903 imported with %import. Note that this is not the same as SWIGIMPORT,
16904 which gets defined in all generated wrapper files.
16905
1690609/26/2004: mmatus
16907
16908 - add %feature("exceptionclass") to identify a class used
16909 as exception. Before swig identified and marked a class
16910 using the "cplus:exceptionclass" attribute. However, the
16911 class needed to appear on an throw() statement. Now
16912 swig keeps trying to identify the exception classes, as
16913 before, but it also allows the user to mark a class by
16914 using the %feature explicitly. (mostly relevant for
16915 python and chicken)
16916
16917 [Python]
16918
16919 - fix -modern option + exceptions, which mix old class
16920 style with the new one. So, we always need to emit
16921 the "nonmodern" python code.
16922
16923 - add the "python:nondynamic" feature and its handler
16924
16925 now if you have
16926
William S Fulton3f549a22015-04-10 20:34:01 +010016927 %pythonnondynamic A;
Marcelo Matus04b8c592004-11-15 23:00:40 +000016928
16929 struct A {
16930 int a;
16931 int b;
16932 };
16933
16934 then, in the python side
16935
16936 aa = A()
16937
16938 aa.a = 1 # ok
16939 aa.b = 2 # ok
16940 aa.c = 3 # error, the class can not be extended dynamically.
16941
16942
16943 Since this is a feature, you can use
16944
William S Fulton3f549a22015-04-10 20:34:01 +010016945 %pythonnondynamic;
Marcelo Matus04b8c592004-11-15 23:00:40 +000016946
16947 or
16948
William S Fulton3f549a22015-04-10 20:34:01 +010016949 %pythondynamic; [ Note: %pythondynamic since deprecated ]
Marcelo Matus04b8c592004-11-15 23:00:40 +000016950
16951 to force all the wrapped classes to be "nondynamic" ones.
16952
16953 The default, as in regular python, is that all the wrapped
16954 classes are dynamics. So, careful with your spelling.
16955
1695609/14/2004: mmatus
16957 - Support the -I- option.
16958
16959 - Differentiate between %include <file> and %include "file".
16960 This fix several corner cases.
16961
16962
16963 [Python] Several patches:
16964
16965 - Normalize the Lib file names:
16966 *.swg internal files,
16967 *.i user files.
16968
16969 - Fix Char[ANY] typemaps, so they also delete any extra '\0' chars,
16970 now they behave as before (1.3.21). Still, you can use
16971 the SWIG_PRESERVE_CARRAY_SIZE macro if you need to
16972 preserve the original size (see pystrbase.swg).
16973
16974 - Add the Char FIXSIZE[ANY] typemaps, to preserve the
16975 original C array sizes (see above). Though, you can't
16976 use them yet since %apply and arrays are not working
16977 together.
16978
16979 - Add pyfragments.swg, now the user can add fragments
16980 to override the default ones.
16981
1698209/10/2004: wsfulton
16983 Patch from Bill Clarke which fixes spurious preprocessor bug which
16984 shows on Solaris and gcc, eg:
16985 Warning(202): Could not evaluate '!defined(SWIGJAVA) &&
16986 !(defined(SWIGCSHARP)'
16987 Also fixes a bug where '#if "a" == "b" == 1' wouldn't have worked
16988
1698909/10/2004: wsfulton
16990 Restored multiple build directories for the test-suite. Patch from
16991 Bill Clarke.
16992
1699309/06/2004: wsfulton
16994 Added the missing runtime.dsp Visual Studio project files for the
16995 import examples to work.
16996
16997
William S Fulton17472f12004-09-04 18:54:23 +000016998Version 1.3.22 (September 4, 2004)
16999==================================
17000
1700109/03/2004: wsfulton
17002 The swig.m4 macro for use with the Autoconf/Automake/Libtool has
17003 been removed and is no longer installed. Please use the new and better
17004 maintained version derived from swig.m4 in the Autoconf macro archive.
17005 See http://www.gnu.org/software/ac-archive/htmldoc/ac_pkg_swig.html and
17006 http://www.gnu.org/software/ac-archive/htmldoc/ac_python_devel.html.
17007
1700809/01/2004: wsfulton
17009 [Perl] Applied patch #1019669 from Christoph Flamm. Adds support
17010 for %feature("shadow") in the same way as it works in Python. This
17011 enables one to override the generated shadow/proxy methods, including
17012 constructors and destructors. For example:
17013
17014 /* Let's make the constructor of the class Square more verbose */
17015
17016 %feature("shadow") Square(double w)
17017 %{
17018 sub new {
17019 my $pkg = shift;
17020 my $self = examplec::new_Square(@_);
17021 print STDERR "Constructed an @{[ref($self)]}\n";
17022 bless $self, $pkg if defined($self);
17023 }
17024 %}
17025
17026 class Square {
17027 public:
17028 Square(double w);
17029 ...
17030 };
17031
1703208/31/2004: mmatus
17033 [Python] Incompatibility reported by Bill Clarke ([email protected]):
17034
17035 If you are using Sun Studio 8 (and possibly earlier
17036 versions) to compile the output produced by swig
17037 1.3.22rc1, and you are using C++ and STL templates then
17038 you need to use either "-runtime" or "-noruntime". If you
17039 use neither of these options then you will probably get
17040 compiler errors when trying to compile the wrapper file;
17041 the error message will be like this: The name
17042 SWIG_Python_ConvertPtr[...] is unusable in static
17043 swigpy::traits_asptr[...] If you get this error message,
17044 you need to regenerate your wrapper file using 'swig
17045 -runtime' or 'swig -noruntime'.
17046
17047 You shouldn't get this problem with Sun Studio 9.
17048
17049 *** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***
17050
1705108/26/2004: wsfulton
17052 [Perl] Applied #932333 from Ikegami Tsutomu. Fixes long long *OUTPUT
17053 and unsigned long long *OUTPUT typemaps in typemaps.i.
17054
1705508/26/2004: wsfulton
17056 Applied patch #857344 from Art Yerkes. Workaround for autoconf bug when
17057 running 'make install'.
17058
1705908/26/2004: wsfulton
17060 [Perl] Part of patch #982753 applied. This implements a %perlcode directive.
17061 It allows one to add Perl code to the generated .pm file. Works the same
17062 as %pythoncode.
17063
1706408/26/2004: wsfulton
17065 [Java] Fix for directors when wrapping virtual methods with exception
17066 specifications that were not simple types. Previously code was generated that
17067 didn't compile, for example when the exception specification was a pointer.
17068
1706908/25/2004: wsfulton
17070 [C#] Typemap fix for methods that return char *. The CLR would incorrectly
17071 delete the memory pointed to by char *. Also applied the same correction to
17072 the char array typemaps.
17073
1707408/24/2004: wsfulton
17075 Fixes for -fmicrosoft error/warning message display:
17076 - End of file (EOF) warning messages not displaying in correct format
17077 - Some messages containing a file path were displaying a double backslash
17078 instead of a single backslash
17079
1708008/23/2004: wsfulton
17081 Applied patch #1011604 submitted by Charles Schwieters. Fix for 64 bit tcl
17082 interpreters.
17083
1708408/23/2004: wsfulton
17085 Fix for bug #875583 - enum forward declarations previously gave a syntax error.
17086
1708708/23/2004: mkoeppe
17088 [Allegro CL] Use typemaps "ffitype" and "lisptype" to determine the FFI type
17089 specifiers from the C type. This makes it possible, for instance, to control
17090 whether a C "char" argument takes a Lisp character or a Lisp integer value.
17091 The default (taking Lisp characters) is done by these built-in typemaps:
William S Fultonc10a84c2022-08-20 22:14:58 +010017092 %typemap(ffitype) char ":char"
17093 %typemap(lisptype) char "character"
William S Fulton17472f12004-09-04 18:54:23 +000017094 If char means an integer instead, use these typemaps:
William S Fultonc10a84c2022-08-20 22:14:58 +010017095 %typemap(ffitype) char ":char"
17096 %typemap(lisptype) char "integer"
William S Fulton17472f12004-09-04 18:54:23 +000017097
1709808/22/2004: wsfulton
17099 As discussed in bug #772453, the SWIG library directory is now installed
17100 into a different default directory. The library used to be installed to
17101 /usr/local/lib/swig1.3. It is now in the more usual architecture independent
17102 directory and I have additionally used a version specific subdirectory as
17103 the library will rarely work with older versions of SWIG. This release
17104 will thus use /usr/local/share/swig/1.3.22 by default, which can be
17105 tailored as before using './configure --swiglibdir'.
17106
1710708/17/2004: mkoeppe
17108 [MzScheme] Add support to create native MzScheme structures from C structures.
17109 To convert a C structure to an MzScheme structure, use the new runtime macro
17110 SWIG_NewStructFromPtr in a typemap. Patch from Dmitriy Zavin.
17111
1711208/12/2004: wsfulton
17113 Patch #837715 from Ben Reser to correctly detect Python lib directory
17114 on 64 bit systems.
17115
1711608/12/2004: wsfulton
17117 [C# and Java] Prevent memory leaks in the case of early return
17118 from wrapper methods using const std::string & parameters. Modified
17119 Mark Traudt patch #951565.
17120
1712108/12/2004: wsfulton
17122 Bug #943783 with patch fixes php char * out typemap NULL values.
17123
1712408/03/2004: Ahmon Dancy <dancy@dancy>
17125
17126 [allegrocl] Additional case mode fixes. Also, make sure
17127 foreign types are exported.
17128
1712907/24/2004: mkoeppe
17130 [Guile] In -scm mode, SWIG modules now exchange their pointer type
17131 information via the Guile interpreter. It is no longer necessary to build a
17132 runtime library or to use -noruntime and -runtime etc.
17133
17134 The module (Swig swigrun) which was introduced in the change of 05/17/2004 is
17135 no longer automatically built. If you need it, run SWIG on the interface file
17136 swigrun.i.
17137
1713807/23/2004: wsfulton
17139 [C#] Bug #917601 Mapping C++ bool fix from Mark Traudt
17140
1714107/23/2004: wsfulton
17142 RPM fixes for latest CVS version including removal of runtime
17143 library.
17144
1714507/23/2004: wsfulton
17146 Patch #908955 from Robert H De Vries.
17147 RPM file generation fix for Fedore Core 1 and Redhat AS2.1.
17148
1714907/12/2004: wsfulton
17150 Patch #864689 from Robin Dunn:
17151
17152 This patch corrects two problems in the XML output of SWIG:
17153
17154 1. There were often extra '/>\n' in the output.
17155
17156 2. value attributes were output with '\n' in them but
17157 since that is not technically legal most (all?) XML
17158 parsers will strip them out. Replacing the '\n' with
17159 the '&#10;' entity reference solves this as that is
17160 legal and XML parsers will convert it to a '\n' when
17161 reading the values back in.
17162
17163 This patch also adds a new global command line option
17164 that will allow the parse tree to be written out in XML
17165 *after* some other language module has been run, in
17166 order to be able to get extra info that the language
17167 module puts in the tree. In this way the XML is a
17168 post-processed version of the tree rather than a
17169 pre-processed version.
17170
17171 Command line option is -dump_xml or -xmlout <file>
17172
1717307/12/2004: wsfulton
17174 [Java] Patch from Scott Michel to fix typesafe enums and proper enums
17175 with directors.
17176
1717707/12/2004: wsfulton
17178 HTML documentation (makechap.py) file generator missing end of line
17179 patch #908951 from Robert de Vries.
17180
1718107/08/2004: wsfulton
17182 The deprecated runtime library build has been removed. This also removes
17183 the dependency on Libtool. Libtool is no longer required to build SWIG.
17184 The associated -ldflags SWIG commandline option has also been removed.
17185
17186 The examples and test-suite testcases that used the runtime library have
17187 been updated to use the replacement approach to using SWIG across
17188 multiple modules, that is they use the -noruntime and -runtime commandline
17189 options, see Modules.html. Effectively they build their own runtime
17190 libraries using -runtime. The examples are import and import_template.
17191 The test cases are in the imports and template_typedef_import directories.
17192
17193 Anyone who wants the original runtime libraries can either run the test-suite
17194 or build the examples and use the appropriate shared object/DLL that is
17195 generated with the -runtime commandline option. For example libimports_runtime.so
17196 (Python calls it lib_imports_runtime.so) is generated after running the
17197 'make imports.multicpptest' testcase in the Examples/test-suite/<lang>
17198 directory. Or use libruntime.so / runtime.dll after building the import
17199 examples in Examples/<lang>/import.
17200
1720107/07/2004: mkoeppe
17202 [Allegro CL] Convert character and string literals in constants to
17203 CL syntax. Fix FF:DEF-FOREIGN-CALL for mixed-case C functions.
17204
1720506/27/2004: wsfulton
17206 [Java] New feature for Java exceptions with format %javaexception(exceptionclasses).
17207 This feature is a slight enhancement to %exception and the only difference is the
17208 addition of the exception classes which are generated into a throws clause.
17209 The 'exceptionclasses' is a comma separated list of classes which will be
17210 added to the associated proxy method's throws clause. The 'exceptionclasses'
17211 are specified like the exception classes in the 'throws' attribute in the
17212 typemaps. This feature should be used for correctly handling checked exceptions
17213 thrown from JNI code. For example:
17214
17215 %javaexception("java.lang.Exception") throwException %{
17216 ... convert a std::logic_error into a java.lang.Exception using JNI code ...
17217 %}
17218
17219 #include <stdexcept>
17220 void throwException() {
17221 throw std::logic_error("Logic error!");
17222 }
17223
17224 will generate a method with a throws clause in the module class:
17225
17226 public static void throwException() throws java.lang.Exception { ... }
17227
1722806/27/2004: wsfulton
17229 [C#] New %csconstvalue(value) feature directive for use with constants and
17230 enums. This works the same way as %javaconstvalue. For C#, this directive
17231 is the only way that one can fix wrapping of C/C++ enums with proper C#
17232 enums if the enum item's initialiser cannot compile as C# code. This is
17233 because Java enums can use a call into C code to initialise the enum item,
17234 whereas in C#, the enum value must be a compile time constant. That is,
17235 using %csconst(0) cannot be used in C# to initialise the C# enum item via
17236 a PINVOKE call.
17237
1723806/27/2004: wsfulton
17239 [Java] New %javaconstvalue(value) feature directive for use with constants and
17240 enums. Sometimes the use of %javaconst(1) will produce code that won't compile
17241 under Java. If a compile time constant is required, %javaconst(0) is not an
17242 option. The %javaconstvalue directive achieves this goal and the value specified
17243 is generated as Java code to initialise the constant. For example:
17244
17245 %javaconst(1);
17246 %javaconstvalue(1000) BIG;
17247 %javaconstvalue("new java.math.BigInteger(\"2000\")") LARGE;
17248 %javaconstvalue(10) bar;
17249 %{
17250 const int bar = 10;
17251 %}
17252 %inline %{
17253 #define BIG 1000LL
17254 #define LARGE 2000ULL
17255 enum Foo { BAR = ::bar };
17256 %}
17257
17258 Generates:
17259
17260 public interface exampleConstants {
17261 public final static long BIG = 1000;
17262 public final static java.math.BigInteger LARGE = new java.math.BigInteger("2000");
17263 }
17264 public final class Foo {
17265 public final static Foo BAR = new Foo("BAR", 10);
17266 ...
17267 }
17268
William S Fulton3dcc5012014-10-21 07:55:07 +010017269 Previously, none of BIG, LARGE or BAR would have produced compilable code
William S Fulton17472f12004-09-04 18:54:23 +000017270 when using %javaconst(1).
17271
1727206/27/2004: wsfulton
17273 %feature enhancements. Features can now take an unlimited number of attributes
17274 in addition to the feature name and feature value. The attributes are optional
17275 and are much the same as the typemap attributes. For example, the following
17276 specifies two optional attributes, attrib1 and attrib2:
17277
17278 %feature(featurename, attrib1="attribval1", attrib2="attribval2") name "val";
17279 %feature(featurename, val, attrib1="attribval1", attrib2="attribval2") name;
17280
1728106/27/2004: wsfulton
17282 %feature improvements for the syntax that takes the feature value within the
17283 %feature() brackets. The value specified is no longer restricted to being just
17284 a string. It can be a string or a number. For example, this is now acceptable
17285 syntax:
17286 %feature("featurename",20.0);
17287 whereas previously it would have to have been:
17288 %feature("featurename","20.0");
17289 Useful for features that are implemented as a macro, for example:
17290 #define %somefeature(value) %feature("somefeature",value)
17291 These will now work accepting either a string or a number:
17292 %somefeature("Fred");
17293 %somefeature(4);
17294
1729506/06/2004: wuzzeb (John Lenz)
17296 [Chicken, Guile]
17297 - Created the Examples/test-suite/schemerunme directory, which holds all the
17298 runme scripts for guile and chicken (and possibly mzscheme...). The guile
17299 and chicken _runme files then (load "../schemerunme/foo.scm").
17300 - In chicken module, fix a few bugs invlolving dynamic casts.
17301
1730206/03/2004: wsfulton
17303 Patch to fix wrapping of templated methods. ISO compliant compilers, like
17304 Comeau and GCC-3.4.0, don't like the template specifier that SWIG was generating
17305 when calling the method. This fix may break some non standard compliant compilers,
17306 for example, Sun workshop compilers prior to version 6.2.p2. Patch submitted
17307 by Bill Clarke.
17308
1730906/03/2004: wsfulton
17310 [Java, C#] Undocumented special variable $imclassname removed.
17311 New special variable $module is replaced by the module name, as specified
17312 by %module or -module commandline option. $imclassname can be created from $module.
17313
1731406/03/2004: wsfulton
17315 [C#] Same as for Java below. The new typemaps are named differently, namely,
17316 csbody and csbody_derived. The deprecated typemaps are csgetcptr and
17317 csptrconstructormodifiers.
17318
17319 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
17320
1732106/03/2004: wsfulton
17322 [Java] Typemap changes for the Java proxy / typewrapper and enum classes. A new
17323 typemap called javabody contains the essential support code for generation into the body
17324 of these classes. There is also a new javabody_derived typemap which is used instead for
17325 wrapped classes that have a wrapped base class. The code is basically, the getCPtr()
17326 method and swigCPtr and swigCMemOwn member variables. These used to be hard coded
17327 with no way to modify the code. The introduction of this typemap makes it possible for
17328 the user to tailor nearly every aspect of the code generation.
17329 The exception now is the code for director classes.
17330
17331 The javagetcptr and javaptrconstructormodifiers typemaps are deprecated and are
17332 no longer used as the code that these generated can be put in the more flexible
17333 javabody and javabody_derived typemaps.
17334
17335 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
17336
17337 The following macros contributed by Scott Michel may help you upgrade if you have used
17338 the javagetcptr typemap:
17339
17340 /* Utility macro for manipulating the Java body code method attributes */
17341 %define SWIGJAVA_ATTRIBS(TYPENAME, CTOR_ATTRIB, GETCPTR_ATTRIB)
17342 %typemap(javabody) TYPENAME %{
17343 private long swigCPtr;
17344 protected boolean swigCMemOwn;
17345
17346 CTOR_ATTRIB $javaclassname(long cPtr, boolean cMemoryOwn) {
17347 swigCMemOwn = cMemoryOwn;
17348 swigCPtr = cPtr;
17349 }
17350
17351 GETCPTR_ATTRIB static long getCPtr($javaclassname obj) {
17352 return (obj == null) ? 0 : obj.swigCPtr;
17353 }
17354 %}
17355
17356 %typemap(javabody_derived) TYPENAME %{
17357 private long swigCPtr;
17358
17359 CTOR_ATTRIB $javaclassname(long cPtr, boolean cMemoryOwn) {
17360 super($moduleJNI.SWIG$javaclassnameUpcast(cPtr), cMemoryOwn);
17361 swigCPtr = cPtr;
17362 }
17363
17364 GETCPTR_ATTRIB static long getCPtr($javaclassname obj) {
17365 return (obj == null) ? 0 : obj.swigCPtr;
17366 }
17367 %}
17368 %enddef
17369
17370 /* The default is protected getCPtr, protected constructor */
17371 SWIGJAVA_ATTRIBS(SWIGTYPE, protected, protected)
17372
17373 /* Public getCPtr method, protected constructor */
17374 %define PUBLIC_GETCPTR(TYPENAME)
17375 SWIGJAVA_ATTRIBS(TYPENAME, protected, public)
17376 %enddef
17377
17378 /* Public getCPtr method, public constructor */
17379 %define PUBLIC_BODYMETHODS(TYPENAME)
17380 SWIGJAVA_ATTRIBS(TYPENAME, public, public)
17381 %enddef
17382
1738306/03/2004: wsfulton
17384 [Java, C#] The contents of the class modifier typemaps and pragmas have changed.
17385 They must now include the class type. Previously 'class' was hard coded.
17386 This change enables flexibility into what type of class is generated,
17387 for example the proxy class could be an interface instead of a class.
17388
17389 For Java this affects the javaclassmodifiers typemap and the jniclassclassmodifiers
17390 and moduleclassmodifiers pragmas.
17391
17392 For C# this affects the csclassmodifiers typemap and the imclassclassmodifiers
17393 and moduleclassmodifiers pragmas.
17394
17395 Unless you have overridden the default versions of these typemaps or pragmas, you
17396 shouldn't be affected. However, if you have, upgrading is easy, for example
17397
17398 class Foo {};
17399 %typemap(javaclassmodifiers) Foo "public final"
17400
17401 must now be:
17402
17403 class Foo {};
17404 %typemap(javaclassmodifiers) Foo "public final class"
17405
17406
17407 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
17408 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
17409
1741005/31/2004: wsfulton
17411 Fix for C++ exception specifications that are references. Problem reported by
17412 Oren Miller. Also improves the generated exception declarations in the
17413 catch handler for pointers - a pointer is used instead of a reference to
17414 a pointer. Added default throws typemaps for SWIGTYPE &, SWIGTYPE * and
17415 SWIGTYPE[ANY] (Java and C#).
17416
1741705/31/2004: wsfulton
17418 [Java, C#] Some minor typesafe enum improvements, including storing the name of
17419 the enum item. The toSring() / ToString() methods are overridden to return this name.
17420
1742105/30/2004: wuzzeb (John Lenz)
17422 [Chicken]
17423 - Update how examples and the test suite are built.
17424 - Symbol names are no longer converted to lower case
17425 - Added union_runme.ss, which was copied and modified from the guile module
17426
1742705/26/2004: lballabio (Luigi Ballabio)
17428 Committed on behalf of Marcelo (who still has problems with
17429 the SourceForge CVS.)
17430
17431 Added Python typemaps for FILE* with (Python-only) test.
17432
174335/24/2004: dancy
17434
17435 * Allegro CL module: Now using some macros (defined in
17436 Lib/allegrocl/allegrocl.swg), swig-defconstant and swig-defun, for
17437 defining constants and foreign functions. This makes the
17438 generated file a bit neater.
17439
17440 Now strips a layer of parenthesis from constants.
17441
17442 Uses (* :void) instead of :foreign-address now.
17443
1744405/20/2004: wsfulton
17445 Unnamed enum global variables are now supported in addition
17446 to the recently added support for unnamed enum member variables.
17447 For example:
17448
17449 struct Foo {
17450 enum { enum1, enum2 } MemberInstance;
17451 };
17452 enum { enum3, enum4 } GlobalInstance;
17453
17454 The int typemaps are used for wrapping the get/set accessor methods.
17455 If the sizeof an enum is not the same size as an int then setting the
17456 variable will silently do nothing as the casts cannot be easily and portably
17457 generated. If you need to solve this highly obscure situation, write
17458 the assignment using the %exception feature.
17459
1746005/20/2004: wsfulton
17461 [C#] C# enum wrapping mods. Similar to the Java module, enums can be wrapped using
17462 one of 3 approaches:
17463
17464 1) Proper C# enums - use %include "enums.swg"
17465 2) Typesafe enums - use %include "enumtypesafe.swg"
17466 3) Simple constant integers (original approach) - use %include "enumsimple.swg"
17467
17468 See each of these files for further details. Each of these files use typemaps
17469 and a new feature to control the generated code. The feature is:
17470
17471 %csenum(wrapapproach);
17472
17473 where wrapapproach should be one of: "proper", "typesafe", "typeunsafe" or "simple".
17474 [No implementation deemed necessary for type unsafe enums].
17475
17476 The default approach is proper C# enums. Anonymous enums are always wrapped by
17477 constant integers.
17478
17479 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
17480
1748105/20/2004: wsfulton
17482 [Java] Java enum support added. There are now 4 ways in which enums can be wrapped:
17483
17484 1) Proper Java enums - use %include "enums.swg"
17485 2) Typesafe enums - use %include "enumtypesafe.swg"
17486 3) Type unsafe enums (constant integers) - use %include "enumtypeunsafe.swg"
17487 4) Simple constant integers (original approach) - use %include "enumsimple.swg"
17488
17489 See each of these files for further details. Each of these files use typemaps
17490 and a new feature to control the generated code. The feature is:
17491
17492 %javaenum(wrapapproach);
17493
17494 where wrapapproach should be one of: "proper", "typesafe", "typeunsafe" or "simple".
17495 The default typemaps will handle enums that may or may not have specified initial
17496 values, for example ten is specified:
17497
17498 enum Numbers { zero, ten(10) };
17499
17500 However, the amount of generated Java code can be cut down, by modifying these typemaps
17501 if none of the enums have initial values (proper Java enums and typesafe enums approach).
17502
17503 The default approach is typesafe enums. Anonymous enums are always wrapped by
17504 constant integers.
17505
17506 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
17507
1750805/11/2004: wsfulton
17509 [Java, C#] Fix bug using %rename on enum items and when using
17510 %javaconst(1) / %csconst(1)
17511 For example, the following used to generate code that wouldn't compile:
17512
17513 %rename(Obj) Object;
17514 enum Grammar { Subject, Object };
17515
1751604/28/2004: wsfulton
17517 [Java, C#] Minor fixes when using combinations of the
17518 javainterfaces, javabase, csinterfaces and csbase typemaps.
17519
1752005/18/2004: wsfulton
17521 [Java] JVM link failure on some systems fixed when using std_vector.i.
17522 Also adds default vector constructor for use from Java.
17523
1752405/17/2004: mkoeppe (Matthias Koeppe)
17525
17526 [Guile] New runtime functions SWIG_PointerAddress,
17527 SWIG_PointerType, SWIG_IsPointerOfType, SWIG_IsPointer.
17528
17529 [Guile] In -scm mode, wrap several SWIG runtime functions
17530 and export them into the module (Swig swigrun). The
17531 runtime module is now built with "module" linkage.
17532
17533 [Guile] GOOPS proxy objects now also print the pointer
17534 address of the C object.
17535
1753605/14/2004: lyle
17537 Added Kou's patch for the Ruby %import directive so that modules
17538 with "nested" names are handled properly. Consider an interface
17539 file foo.i that has this %module declaration at its top:
17540
17541 %module "misc::text::foo"
17542
17543 Now consider another interface file spam.i that imports foo.i:
17544
17545 %import foo.i
17546
17547 Before this patch, this would result in the following code being
17548 generated for spam_wrap.c:
17549
17550 rb_require("misc::text::foo");
17551
17552 With this patch, however, you'll get the correct path name
17553 for the call to rb_require(), e.g.
17554
17555 rb_require("misc/text/foo");
17556
17557 See SourceForge Bug #928299.
17558
1755905/12/2004: wsfulton
17560 Patch for emitting directors when %feature("director") specified
17561 for a class with no virtual methods, but does have a virtual destructor.
17562 Submitted by Kevin Smith.
17563
1756405/06/2004: mkoeppe (Matthias Koeppe)
17565 New SWIG runtime function SWIG_TypePrettyName, which
17566 returns an unmangled type name for a swig_type_info
17567 object.
17568
17569 [Guile]: Use it for printing pointer objects.
17570
1757105/03/2004: dancy (Ahmon Dancy)
17572
17573 * Lib/allegrocl/allegrocl.swg: Updated comments about identifer
17574 conversion.
17575
17576 * Sources/Modules/allegrocl.cxx: Register /dev/null for "header"
17577 target. Also, disregard "const" qualifiers during type
17578 conversion.
17579
17580
1758105/02/2004: wuzzeb (John Lenz)
17582 [Chicken] Fix bug 782468.
17583 To fix this bug, the runtime code has been rewritten, and
17584 pointers are now represented as a C_SWIG_POINTER_TYPE.
17585
17586 Chicken version > 1.40 is now required!
17587
17588 * Typemap incompatibility: typemaps no longer use chicken_words.
17589 If a typemap needs some space, it should just call C_alloc
17590
17591 * argout typemaps no longer use the /* if ONE */ construct to
17592 build an output list. A SWIG_APPEND_VALUE macro, exactly like
17593 guile and mzscheme is now used.
17594
1759504/25/2004: mkoeppe (Matthias Koeppe)
17596 [Guile] In the generated GOOPS code, don't create methods
17597 that would not specialize any arguments; simply re-export
17598 the primitive functions. (This is a performance
17599 optimization which reduces load time and execution time.)
17600
17601 [Guile] In -gh mode, fix the "too many initializers" error
17602 which was caused by an incompatible swig_type_info layout.
17603
17604 [Guile] The typemap for FILE * in ports.i now also accepts
17605 a regular FILE * pointer object. Also a bug with Scheme
17606 file ports that are open for input and output has been
17607 fixed.
17608
1760904/25/2004: wsfulton
17610 Change entry 03/21/2004 revoked. The change introduced another
17611 inconsistency (reference typemaps beings used instead of
17612 pointer typemaps for member variables as well as static
17613 member variables and global variables for some languages,
17614 but only for C++ and not C). This would break user's current
17615 typemaps and introduce further inconsistencies. Alternative
17616 solution required and being discussed.
17617
1761804/10/2004: mmatus (Marcelo Matus)
17619
17620 Added the -directors flag. This enables the director
17621 mode for the interface and all the classes that
17622 don't set the "feature:nodirector" explicitly.
17623
17624 You can use this in your module if you want to use the
17625 director feature in all your classes, but it is most
17626 intended for testing purposes, like:
17627
17628 make check-python-test-suite SWIG="../../../swig -directors"
17629 make check-ruby-test-suite SWIG="../../../swig -directors"
17630 make check-java-test-suite SWIG="../../../../swig -directors"
17631
17632 These commands will run the entire test-suite using
17633 directors, and not only the specific 'directors_*'
17634 cases. This should be done from time to time.
17635
1763604/10/2004: mmatus (Marcelo Matus)
17637
17638 [python] Added support for std::wstring and wchar_t,
17639 for compiler and python versions that support them.
17640
17641 When needed, use
17642
17643 %inlcude std_string.i // 'char' strings
Olly Betts00d07a72010-05-27 07:14:20 +000017644 %inlcude std_wstring.i // 'wchar_t' strings
William S Fulton17472f12004-09-04 18:54:23 +000017645
17646
1764704/10/2004: mmatus (Marcelo Matus)
17648
17649 [python] Fix the default behaviour (seg. fault) when an
17650 inplace operator (+=,-=,...) was wrapped, as reported by
17651 Lucriz ([email protected]), when the most common
17652 form was used:
17653
17654 A& A::operator+=(int i) { ...; return *this; }
17655 ^^^^ ^^^^^^
17656
17657
17658 ie, an object is returned and its contains the same 'this'
17659 value than the input object, which is deleted after the
17660 operation "a += b", leaving the result with no real
17661 object, but a seg. fault.
17662
17663 To fix it, we needed to introduce a new feature and use an
17664 old one:
17665
17666 %feature("self:disown") A::operator+=;
17667 %feature("new") A::operator+=;
17668
17669 here, "self:disown" disable the ownership of the 'self'
17670 or input object, and the "new" feature transfers the
17671 ownership to the result object.
17672
17673 The feature/solution could also be used in other languages
17674 that use gc and implement the inplace operators, or other
17675 operators, in a similar way.
17676
17677 *** POTENTIAL INCOMPATIBILITY FOR Python MODULE ***
17678
17679 If you already are using the inplace operators in python,
17680 and you implemented some kind of workaround to the problem
17681 fixed here, it is possible you could end with 'free'
17682 objects that never get deleted. If that is the case, and
17683 you want to disable the current fix, use:
17684
17685 %feature("self:disown","") A::operator+=;
17686 %feature("new","") A::operator+=;
17687
17688
1768904/07/2004: cheetah (William Fulton)
17690 [C#] C++ enums are no longer wrapped by integers, they are now wrapped by
17691 C# enums. For Example, given C++:
17692
17693 enum AnEnum { foo, bar };
17694 typedef AnEnum AnEnumeration;
17695 void something(AnEnum e, AnEnumeration f);
17696
17697 The following is generated:
17698
17699 public enum AnEnum {
17700 foo,
17701 bar
17702 }
17703 public static void something(AnEnum e, AnEnum f) {...}
17704
17705 Note that a global enum like AnEnum above is generated into its own
17706 file called AnEnum.cs. Enums defined within a C++ class are defined
17707 within the C# proxy class. Some of the typemaps for modifying C# proxy
17708 classes also work for enums. For example global enums can use
17709
17710 %typemap(csimports) to add in extra using statements.
17711
17712 Global enums and class enums can use
17713
17714 %typemap(csclassmodifiers) to make the enum private, public etc.
17715 %typemap(csbase) to change the underlying enum type (enum base)
17716
17717 If we add this for the above example:
17718
17719 %typemap(csclassmodifiers) AnEnum "protected"
17720 %typemap(csbase) AnEnum "long"
17721
17722 the following is generated:
17723
17724 protected enum AnEnum : long {
17725 foo,
17726 bar
17727 }
17728
17729 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
17730
1773104/07/2004: cheetah (William Fulton)
17732 Seg fault fix for empty enums, like
17733 enum Foo {};
17734
1773503/21/2004: mmatus
17736 [Note: this change revoked on 04/25/2004]
17737 [Python] Makes the following 'var' cases more uniform:
17738
17739 std::string ga;
17740
17741 struct A {
17742 static std::string sa;
17743 std::string ma;
17744 };
17745
17746
17747 now the three variables (ga, sa, ma) can be assigned as:
17748
17749
17750 cvar.ga = "hello";
17751 A.sa = "hello";
17752 a.ma = "hello";
17753
17754 ie, now 'ma' will also use a std::string typemap 'in' if
17755 defined, before it was only accepting a 'p_std_string'
17756 pointer. Note, however, that 'ma' will not use the
17757 'varin/varout' typemaps (that probably could be more
17758 natural), but it will pick up the 'in' typemap for const
17759 std::string& (which is easier).
17760
17761 The changes in cwrap.c and lang.cxx will probably fix the
17762 behaviour in other languages that do not overload the
17763 membervarHandler method "too much".
17764
17765
1776603/21/2004: mmatus
17767 [Python] Disabling the default instantiations like:
17768
17769 %template() std::pair<int,int>;
17770
17771 for all the primitive types and STL containers/classes.
17772 They are expensive, specially for pair and map, and the
17773 previous behaviour also requires the user to perform
17774 manual instantiations. Still, if the speed difference is
17775 not important, it can be re-enabled by defining the macro
17776 SWIG_STD_DEFAULT_INSTANTIATION (see std_common.i).
17777
17778 Also, normalizing the INPUT/OUTPUT/INOUT typemaps. Now
17779 they use the same conversors than the rest of the
17780 typemaps, and you can use them for std::pair, std::string
17781 and all the other STL types, like in:
17782
17783 void p_inoutd(std::pair<double, double> *INOUT);
17784
17785 Added the attribute.i and implicit.i files with macros to
17786 transform functions pairs like 'set_x'/'get_x'
17787 (or 'T& x()'/'const T& x() const') into an attribute,
17788 and allowing the use of implicit constructors in typemaps
17789 (see the files for more details).
17790
1779103/21/2004: mkoeppe
17792 [Guile] Fix the documentation strings of functions with
17793 anonymous arguments.
17794
1779503/18/2004: mmatus
17796 [Python] More general std_string.i interface.
17797 Now you can wrap it using
17798
17799 %template(string) std::basic_string<char>;
17800
17801 and use the std::string as a base class:
17802
17803 struct A : std::string {
17804 };
17805
17806 But more important, swig will recognize
17807 both std::basic_string<char> and std::string as
17808 the same type.
17809
1781003/16/2004: mmatus
17811 Previously added, but not mentioned before:
17812
17813 - friend declaration support, swig now emits a global
17814 function in the same class scope.
17815
17816 - ref/unref features: to mix ref counting C++ classes
17817 and native script ref counting mechanisms (like in python).
17818
17819 Use it like:
17820
17821 %feature("ref") RCObj "$this->ref();"
17822 %feature("unref") RCObj "$this->unref();"
17823
17824 And the class RCObj, and all the derived ones, will
17825 perform the right ref/unref calls when a new pointer
17826 is returned to the target language, or when the target
17827 language attempts to delete the object.
17828
17829 See the refcount.i file in the test-suite for more
17830 details.
17831
17832
1783303/16/2004: mmatus
17834 [Python] Using the new %fragment support, major rewrote
17835 of the python swig library, including:
17836
17837 - Almost automatic template/typemap instantiation for
17838 the STL components. For example, now you can write:
17839
17840 %template(vector_i) std::vector<int>;
17841
17842 and a specialized vector_i class is emitted with all
17843 the needed typemaps. No need to use the old
17844 'specialize_vector' macros.
17845
17846 Note you can also define
17847
17848 %template(matrix_i) std::vector<std::vector<int> >;
17849 %template(vector_pii) std::vector<std::pair<int,int> >;
17850
17851 - The empty template instantiation
17852
17853 %template() std::vector<int>;
17854
17855 defines the vector typemaps, but no proxy class. For all the
17856 fundamental types, the empty template instantiation are
17857 defined, so, you can say
17858
17859 %include std_vector
17860
17861 int func(const std::vector<int>& a);
17862
17863 where the proper typemap is applied to 'a', but no
17864 std::vector<int> proxy is generated.
17865
17866
17867 - All the STL containers present a more uniform behavior and
17868 more complete interface declaration. The following are
17869 now supported:
17870
17871 std::vector<T>
17872 std::list<T>
17873 std::deque<T>
17874 std::set<T>
17875 std::multiset<T>
17876 std::map<T>
17877 std::multimap<T>
17878
17879 not a container, but also supported:
17880
17881 std::pair<T,U>
17882
17883 also, more typemaps are defined for all of them,
17884 including varin, varout, typecheck, etc.
17885
17886 - Initial attempt to implement the STL containers
17887 considering allocators, ie:
17888
17889 std::vector<T,A>
17890
17891 it is partially working, but it is just a workaround
17892 while swig improves its template type support.
17893
17894
17895 Please test with your particular setup. It seems to be
17896 working with g++ 3.2.2, g++ 2.96, Intel icc and SGI CC
17897 compilers, plus python 1.5.2, 2.0 and 2.3, but since
17898 we are using templates, there is a chance you can find
17899 some problems when using with an old C++ compiler.
17900
1790103/16/2004: mmatus
17902
17903 - Allowing the empty %template directive, such as
17904
17905 %template() std::vector<int>;
17906
17907 to process the class "typedef"s and "typemap"s. Before
17908 only the internal "typedef"s were processed.
17909
17910 This makes possible to emit the default in/out
17911 typemaps without the need of wrapping an specialized
17912 vector instance.
17913
17914 - Adding the preprocessor extension #@ which mangles the
17915 following macro argument, like in:
17916
17917 #define macro(X) #@X
17918 macro(int) -> int
17919 macro(std::string) -> std_s_s_string
17920
17921 - Fragments can now be "type specialized", as the typemaps. The
17922 syntax is as follows
17923
17924 %fragment("name","header")
17925 { /* a type independent fragment (old syntax) */ }
17926 %fragment("name" {Type}, "header")
17927 { /* the fragment is type dependent */}
17928
17929 Now fragments can also be used inside templates:
17930
17931 template <class T>
17932 struct A {
17933 %fragment("incode"{A<T>},"header") {
17934 /* 'incode' specialized fragment */
17935 }
17936
17937 %typemap(in,fragment="incode"{A<T>}) {
17938 /*
17939 here we use the 'type specialized'
17940 fragment "incode"{A<T>}
17941 */
17942 }
17943 };
17944
17945
1794603/11/2004: cheetah (William Fulton)
17947 [Java] Director bug which meant that some virtual functions overridden in
17948 Java were not being called on some operating systems. Bug reported and fixed
17949 by Robert de Vries and Scott Michel.
17950
1795103/02/2004: mkoeppe (Matthias Koeppe)
17952 [Guile] In -scm mode, don't forget to check the type of string arguments.
17953
1795402/24/2004: cheetah (William Fulton)
17955 [C#] New commandline option -namespace <name>. This allows one to specify
17956 a C# namespace into which all C# classes are generated.
17957
1795802/23/2004: mkoeppe (Matthias Koeppe)
17959 [MzScheme] Use FUNC_NAME rather than a bogus typemap variable for signalling
17960 errors. Call scheme_wrong_type with a zero-based argument number.
17961 Reported by Ondrej Pacovsky, SF #902621.
17962
17963 [Guile] Define FUNC_NAME also in the dispatch wrapper for overloaded
17964 functions. Patch by John Lenz, SF #896255.
17965
1796602/22/2004: mkoeppe (Matthias Koeppe)
17967 [Guile] In -scm mode, don't try to invoke a null destructor function.
17968
1796902/20/2004: cheetah (William Fulton)
17970 Fixes so that the SWIG source will compile using the Digital Mars Compiler
17971 (formerly Symantic compiler) on Windows. Submitted by Scott Michel.
17972
1797302/13/2004: mkoeppe (Matthias Koeppe)
17974 [MzScheme] New command-line argument -noinit. Use it for building
17975 the runtime library, where we don't want to define the functions
17976 scheme_initialize etc. Reported by Tim Brown, SF #891754.
17977
17978 [MzScheme] Don't produce invalid C code when invoked with the
17979 -declaremodule option. Reported by Tim Brown, SF #891108.
17980
17981 [Guile] Build the runtime library with passive linkage, to rename
17982 the SWIG_init function uniquely.
17983
1798402/12/2004: cheetah (William Fulton)
17985 [Java, C#] Patch submitted by Bill Hoffman which prevents SWIG from crashing
17986 when a file for the typewrapper class cannot be opened.
17987
1798802/11/2004: cheetah (William Fulton)
17989 [Java, C#] Overloading changes:
17990 - Methods which are overloaded in const only no longer generate Java
17991 code that won't compile - the first method parsed is used and a
17992 warning is displayed. Note that this behaviour is slightly different
17993 to the scripting languages which always uses the non-const method.
17994 - Warning messages 509 and 512 replaced by new warning number 516, which
17995 is more relevant to these statically typed languages as the overloaded
17996 methods aren't 'shadowed', they are ignored.
17997
1799801/23/2004: mkoeppe (Matthias Koeppe)
17999 [Guile] Replace the "known_classes" hash table by a node
18000 attribute. Methods of classes in C++ namespaces now get
18001 the proper specializer in the GOOPS declaration.
18002 Reported by [email protected].
18003
1800401/23/2004: mkoeppe (Matthias Koeppe)
18005 [Guile] Uniquify the argument names in GOOPS shadow method
18006 declarations. Reported by [email protected].
18007
1800801/21/2004: sunshine (Eric Sunshine)
18009 Revived the NextStep port of SWIG.
18010
18011 Fixed fatal problem in DohStrstr() caused by difference in strstr()
18012 implementation which made %apply become entirely dysfunctional. On
18013 NextStep, strstr("foo","") evaluates to NULL; whereas, on modern
18014 platforms, it evaluates to "foo". %apply relies extensively upon
18015 strstr("foo","") evaluating to non-NULL, therefore it failed
18016 catastrophically when faced with NextStep's strstr().
18017
18018 Added `bool' check to configure.in since NextStep's C++ compiler
18019 does not supply this type. swig.h now fakes up `bool' if needed.
18020
18021 Worked around NextStep C++ compiler bug in which C++ code is
18022 disallowed inside extern "C" functions. This problem affected all
18023 language modules, since they publish hook functions of the form:
18024 extern "C" Language *swig_foo(void) { return new FOO(); }
18025 Fixed by creating a C++ wrapper:
18026 static Language *new_swig_foo() { return new FOO(); }
18027 extern "C" Language *swig_foo(void) { return new_swig_foo(); }
18028
18029 Ensured that Swig_copy_string() is used in place of strdup() since
18030 NextStep does not supply strdup().
18031
18032 Fixed detection of Ruby library name and location in configure.in.
18033 Problem 1: Assumed that library always resided in Ruby's "archdir",
18034 which was correct for Ruby 1.6.x, but which is incorrect for Ruby
18035 1.8.x, in which case the library normally resides in Ruby's
18036 "libdir". Problem 2: Assumed that the library could always be
18037 linked via "-l"+RUBY_INSTALL_NAME (where RUBY_INSTALL_NAME
18038 typically is "ruby"), however this failed for platforms, such as
18039 NextStep, which do not support shared libraries. In this case, the
18040 static library name in 1.8.x is libruby-static.a, thus
18041 -lruby-static is required. The new logic works correctly for
18042 static and shared libraries for 1.6.x and 1.8.x.
18043
18044 Fixed detection of Perl CFLAGS in configure.in for NextStep.
18045 Detection code extracted CFLAGS from Perl's %Config hash but
18046 neglected to add a newline to the value before passing it through
18047 `sed'. NextStep's ancient `sed' discards input which is not
18048 terminated with a newline, thus Perl CFLAGS always evaluated to the
18049 empty string.
18050
1805101/16/2004: cheetah (William Fulton)
18052 Tidy up in the exception handling code that is generated when
18053 C++ exception specifications are wrapped with the throws typemap.
18054 This redundant code is no longer generated:
18055
18056 catch(...) {
18057 throw;
18058 }
18059
1806001/12/2004: wsfulton on behalf of mmatus (marcelo matus)
18061 if a method uses %exception and the method requires the use
18062 of the throws typemap, the code in a throws typemap will be
18063 generated inside the try body. For example:
18064
18065 %exception method {
18066 try {
18067 // method action
18068 $action
18069 } catch (int i) {
18070 // method int catch handler
18071 } catch (...) {
18072 // method generic catch handler
18073 }
18074 }
18075 %typemap(throws) Except %{
18076 // throws typemap Except catch handler
18077 %}
18078
18079 %inline %{
18080 class Except {};
18081 void method(int i) throw (Except);
18082
18083 Will generate:
18084
18085 {
18086 try {
18087 // method action
18088 try {
18089 method(arg1);
18090 }
18091 catch(Except &_e) {
18092 // throws typemap Except catch handler
18093
18094 }
18095
18096 } catch (int i) {
18097 // method int catch handler
18098 } catch (...) {
18099 // method generic catch handler
18100 }
18101 }
18102
18103
18104 As can be seen, the inner try catch block is for the throws typemaps.
18105 Previously, this was reversed so that the inner try catch block
18106 was the %exception code. In the example above, it would have been
18107 impossible to catch Except as the catch all (...) would catch the
18108 exception instead.
18109
William S Fulton15bf63c2004-01-19 21:26:31 +000018110Version 1.3.21 (January 11, 2004)
Olly Bettsfdcea432009-02-26 05:53:37 +000018111=================================
18112
William S Fulton15bf63c2004-01-19 21:26:31 +00001811301/10/2004: cheetah (William Fulton)
18114 The output format for both warnings and errors can be selected for
18115 integration with your favourite IDE/editor. Editors and IDEs can usually
18116 parse error messages and if in the appropriate format will easily take you
18117 directly to the source of the error. The standard format is used by
18118 default except on Windows where the Microsoft format is used by default.
18119 These can be overridden using command line options, for example:
18120
18121 $ swig -python -Fstandard example.i
18122 example.i:4: Syntax error in input.
18123 $ swig -python -Fmicrosoft example.i
18124 example.i(4): Syntax error in input.
18125
1812601/09/2004: beazley
18127 Fixed [ 871909 ] simple namespace problem.
18128 This was a problem using anonymous structures in a namespace.
18129 For example:
18130
18131 namespace ns {
18132 typedef struct {
18133 int n;
18134 } S;
18135 };
18136
18137 Reported by Josh Cherry.
18138
1813901/09/2004: beazley
18140 Fixed some broken Perl examples.
18141
1814212/28/2003: cheetah (William Fulton)
18143 [Java and C#] Fixes for wrapping covariant (polymorphic) return types.
18144 For example:
18145
18146 struct Base {
18147 virtual ~Base();
18148 virtual Base* copy() const = 0;
18149 };
18150 struct Derived : Base {
18151 virtual Derived* copy() const;
18152 };
18153
18154 The Derived::copy proxy method returns Base not Derived. A warning is issued
18155 about this. Previously the pointer used by the proxy class was incorrectly
18156 treated as a Base* instead of a Derived*.
18157
1815812/18/2003: cheetah (William Fulton)
18159 Fix so that Windows paths are displayed correctly when reporting errors.
18160 An error previously would have been shown something like:
18161
18162 .?xample.i:14: Syntax error in input.
18163
18164 instead of:
18165
18166 .\example.i:14: Syntax error in input.
18167
Dave Beazley10427702003-03-28 16:12:03 +000018168
William S Fultoncf768a22003-12-17 21:46:32 +000018169Version 1.3.20 (December 17, 2003)
18170==================================
William S Fultona3255742002-10-23 19:08:17 +000018171
William S Fultoncf768a22003-12-17 21:46:32 +00001817212/17/2003: beazley
18173 Last minute modifications. Perl5 module now generates shadow classes
18174 by default like all of the other modules. PHP4 wrappers no longer
18175 include "config.h".
18176
1817712/14/2003: beazley
18178 Weakened warning message related to constructor names so that an
18179 unusual nested-class wrapping technique would work again (apparently
18180 it worked in some older SWIG releases). For example:
18181
18182 class Scope {
18183 class ClassA;
18184 class ClassB;
18185 };
18186 class Scope::ClassA {
18187 ...
18188 };
18189 class Scope::ClassB {
18190 ...
18191 }
18192
18193 Note: There is still some odd interaction with the SWIG symbol
18194 table/type system that will need to be looked at in a future release.
18195 Reported by Gustavo Niemeyer.
18196
18197
1819812/11/2003: cheetah (William Fulton)
18199 [Java] Protected class methods are wrapped as protected Java methods
18200 when using the dirprot director feature. This can be changed using
18201 %javamethodmodifiers to something else should the need arise, for
18202 example, private or package access.
18203
1820412/11/2003: cheetah (William Fulton)
18205 [Java, C#]
18206 %javamethodmodifiers (Java) and %csmethodmodifiers (C#) operate slightly
18207 differently. Previously this feature had to be present to set the method
18208 modifiers. Now it is only used if it exists for the method being wrapped.
18209 The default is "public" as previous however, when wrapping protected
18210 director methods it is "protected". This change will not affect existing
18211 use of the %javamethodmodifiers or %csmethodmodifiers.
18212
1821312/11/2003: mmatus (Marcelo Matus)
18214
18215 This fix some recurring reports about keywords not been
18216 properly identified and warned, and it solves the problem
18217 of how to add a test file to the test-suite such that it
18218 doesn't use any keyword of all the supported languages
18219 (and doing it without compiling the test for all the
18220 supported languages, thing that is not always possible,
18221 and without requiring you to know all the supported
18222 language keywords, thing that is always impossible).
18223
18224 So these are the changes globally speaking:
18225
18226 - Uniform the definition of the keyword warnings through
18227 the supported languages: all the languages has now a
18228 separate file that defines the keywords or bad names:
18229
18230 python/pythonkw.swg
18231 chicken/chickenkw.swg
18232 ....
18233
18234 - Added keyword list for most of the languages that didn't
18235 have one (using the new separated file).
18236
18237 - Added the "All keywords" warning support: -Wallkw option.
18238
18239 This option allows you to include all the known keywords
18240 for all the supported languages, and can be used as:
18241
18242 swig -Wallkw ....
18243
18244 This will help to the process of adding a test-suite
18245 file that can be compiled in all the swig supported
18246 languages, and it will be also helpful for users who
18247 want to create multi-language libraries.
18248
18249 And these are the detailed changes (mostly file addition):
18250
18251 - For the languages that already have some sort of keyword
18252 warning list, move it to an external languagekw.swg
18253 file, ie:
18254
18255 move keywords from python.swg -> pythonkw.swg
18256 move keywords from chicken.swg -> chickenkw.swg
18257 move keywords from tcl8.swg -> tclkw.swg
18258
18259 and re-include languagekw.swg from language.swg.
18260
18261 - For the language that didn't have a keyword list, and
18262 for the ones that I could find a list, add the
18263 languagekw.swg file, ie:
18264
18265 csharp/csharpkw.swg
18266 java/javakw.swg
18267 php4/phpkw.swg
18268 pike/pikekw.swg
18269 ruby/rubykw.swg
18270
18271
18272 also add a line in language.swg to include
18273 languagekw.swg, but now it is commented!!!, like in
18274 java.swg:
18275
18276 /* java keywords */
18277 /* please test and activate */
18278 //%include "javakw.swg"
18279
18280 ie, there will be no change in how swig runs normally
18281 until the language maintainer test and uncomment that
18282 line.
18283
18284 So, please check each languagekw.swg file (I left the
18285 link to the keyword list source for checking), and after
18286 testing, uncomment the %include line.
18287
18288 - Added the file allkw.swg, which includes all the
18289 languagekw.swg files.
18290
18291 For the languages that has no languagekw.swg file right
18292 now, and if they need one, add the file into the
18293 language directory, and add the corresponding include
18294 line into the allkw.swg file.
18295
18296 - Added the -Wallkw that includes the allkw.swg file.
18297 Note that the old -lallkw.swg option couldn't be used
18298 since it include the file after it would be needed.
18299
18300
18301 Hopefully, the -Wallkw option will be added to the default
18302 rules in the related test-suite Makefiles, so, when
18303 creating a new test, or adding a new swig library file
18304 (like _std_deque.i), swig will warn you if you are using a
18305 bad name, considering all the language where it needs to
18306 run.
18307
18308 Right now you can test it by using:
18309
18310 make check-python-test-suite SWIG="swig -Wallkw"
18311
18312 or using your favorite target language, it doesn't matter.
18313
18314 And yes, there are several examples that are using
18315 reserved keywords, specially from csharp.
18316
18317 *** Remember ****: the new keyword warning lists are not
18318 included by default in any of language that before didn't
18319 have one. To enable the keyword warnings as the default
18320 behavior, the inclusion of the languagekw.swg file has to
18321 be uncommented at each language.swg file.
18322
18323 So, all the language maintainers, please check the
18324 keywords list.
18325
18326 Also, you can add buit-in names, and not only keywords, like
18327 'True/False' in python. Remember that you can be more
18328 specific and refer only to member names, like *::configure
18329 or *::cget (see an example in the tcl8/tcl8kw.swg file),
18330 or only global names, like ::range (see an example in the
18331 python/pythonkw.swg file.
18332
18333 Just to be consistent, use the following codes:
18334
18335 - Use code 314 for keyword and/or fatal bad names.
18336 - Use code 321 for buit-in and/or not fatal bad names.
18337
18338 so, they can't be disabled/enabled independently (see
18339 python/pyhtonkw.swg for examples).
18340
18341 **** And don't add any new test file without checking it
18342 with the -Wallkw option!! (that includes me) *****.
18343
18344
1834512/11/2003: cheetah (William Fulton)
18346 SF bug #854634
18347 Added support for accepting the Unix directory separator '/' on
18348 Windows and the Mac in addition to the native one ( '\' on
18349 Windows). This can be used in %import, %include and commandline
18350 options taking a path, for example -I. On Cygwin, both the Windows
18351 and Unix directory separator can now be used (was '/' only).
18352
1835312/10/2003: mmatus (Marcelo Matus)
18354
18355 [python] Implementing the runtime "reprotected" director
18356 members, if you have:
18357
18358 %feature("director") B;
18359
18360 class Bar {
18361 public:
18362 virtual ~Bar();
18363 virtual int hello() { return do_hello();)
18364
18365 protected:
18366 virtual int do_hi() {return 0;}
18367 virtual int do_hello() {return 0;}
18368 };
18369
18370 then, at the python side
18371
18372 import my_module
18373
18374 class Foo(my_module.Bar):
18375 def do_hello(self):
18376 return 1
18377 pass
18378
18379 b = Bar() # Pure C++ Director class
18380 f = Foo() # C++ Director + python methods
18381
18382 b.hello() # Ok, and it calls C++ Bar::do_hello()
18383 f.hello() # Ok, and it calls Python Foo::do_hello()
18384
18385 b.do_hi() # RuntimeError, do_hi() is protected!!
18386 f.do_hi() # RuntimeError, do_hi() is protected!!
18387
18388 b.do_hello() # RuntimeError, do_hello() is protected!!
18389 f.do_hello() # Ok, since it its redefined in python.
18390
18391 Here Bar.do_hello is always protected, but Foo.do_hello
18392 is "public", because it is redefined in python. Before,
18393 all the 'do_hello' methods were public.
18394
18395 This seems to be a good compromise between C++ and python
18396 philosophies, ie, all the director protected methods keep
18397 protected at the user side (C++ way) until they are
18398 redefined (python way, were all defined methods are always
18399 public). And this is not only a good compromise, it also
18400 seems to be the only way to do it :).
18401
18402 Now ruby has native director protected members, and python
18403 pure runtime support. I guess these are the two possible
18404 extreme cases. And hopefully, they could be used as
18405 templates to modify the other languages that support
18406 directors, so they can "reprotect" the protected director
18407 members at the target language side.
18408
18409 This finished the director protected support for the
18410 python language. Ocalm will need to add the
18411 "reprotection" later.
18412
1841312/10/2003: mmatus (Marcelo Matus)
18414
18415 The following case (reported by Lyle Johnson) was fixed:
18416
18417 %rename(x) Foo::y();
18418
18419 class Foo {
18420 public:
18421 void y();
18422
18423 protected:
18424 int x;
18425 };
18426
18427 swig warned that the symbol 'x' was already defined, and
18428 the renaming fails. 'x' was not emitted, since it is
18429 protected, but it was kept in the symbol table with too
18430 much information.
18431
18432 Now swig works for all the cases (plain, director and
18433 dirprot) again. This was fixed by allowing the parser.y to
18434 decide much closer what to do with 'x'. Before all the
18435 discarding or generation was resolved at the lang.cxx
18436 stage. Also the changes in parser.y to implement the
18437 director protected mode are now much more encapsulated, and
18438 they get disabled if the mode is not enabled. Before the
18439 deactivation was done at the generation stage (lang.cxx).
18440
18441 By the other hand, if the director mode is enabled, and
18442 %rename is done, reusing a protected member name, there is
18443 a pathological case:
18444
18445 %rename(x) Foo::y();
18446
18447 class Foo : public A {
18448 public:
18449 void y();
18450
18451 protected:
18452 int x; /* works */
18453 static int x; /* works */
18454 static void x(); /* works */
18455 typedef void x(); /* works */
18456
18457 virtual void x(); /* always fails, as it should, since
18458 Foo::x() will be emitted in the
18459 director */
18460
18461 void x(); /* always fails, but sometimes it shouldn't,
18462 since the Foo::x() will not be emitted if
18463 it is not virtual */
18464
18465 };
18466
18467 The last case is not always right because at the parser.py
18468 stage it is not possible to decide if the protected member
18469 Foo::x() could or not conflict with the renamed Foo::y(),
18470 since Foo::x() could be virtual by inheritance.
18471
18472 I guess this just an intrinsic limitation, and no much can
18473 be done about it without resorting into larger changes to
18474 postpone, under certain conditions, the multiply symbol
18475 detection (lang.cxx stage).
18476
18477 So, by now, it is just considered a well known "feature" in
18478 the director protected mode. The good news is that it seems
18479 to be a rare case, and it can be avoided by the user by
18480 hiding 'x' before renaming 'y':
18481
18482 %rename(_x) Foo::x();
18483 %rename(x) Foo::y();
18484
18485
1848612/08/2003: mmatus (Marcelo Matus)
18487 The virtual method detections now properly
18488 treats the following cases:
18489
18490 namespace foo { typedef int Int; }
18491 struct A {};
18492 typedef A B;
18493
18494 struct Foo {
18495 virtual ~Foo() {}
18496
18497 virtual Foo* cloner() = 0;
18498 virtual int get_value() = 0;
18499 virtual A* get_class() = 0;
18500 virtual void just_do_it() = 0;
18501 };
18502
18503 struct Bar : Foo
18504 {
18505 Bar* cloner();
18506 foo::Int get_value();
18507 B* get_class();
18508 void just_do_it();
18509 };
18510
18511 All the Foo and Bar methods are virtual. A new attribute
18512 "virtual:type" record the base polymorphic type. In the
18513 previous cases we have:
18514
18515 type : Bar virtual:type : Foo
18516 type : foo::Int virtual:type : int
18517 type : B virtual:type : A
18518 type : void virtual:type : void
18519
18520 This attribute is useful in languages (java+directors)
18521 that could have problems redefining Bar* Bar::cloner().
18522
18523 If you never had code like the above, you will see no
18524 effects. But if you have some code like that, you
18525 will see some effects since some methods that
18526 before were not properly treated as virtual,
18527 will start to act like that. This could enlarge
18528 your director classes.
18529
18530
1853112/08/2003: mmatus (Marcelo Matus)
18532 The director protected member support (dirprot)
18533 is disabled by default.
18534
18535 It can be enable by using '-dirprot' or by adding
18536 the option to the module declaration, like:
18537
18538 %module(directors="1",dirprot="1") my_module
18539
18540 This module option was added to properly compile the
18541 director_protected.i and director_nested.i examples.
18542
18543 The feature has been tested with python[2.2,2.3]
18544 and ruby[1.6.7], both at compilation and runtime, and
18545 java[j2sdk1.4.1_01], but only at compilation (my java
18546 installation doesn't run any of the director examples,
18547 olds nor news).
18548
18549 Please test for ocaml and java.
18550
18551 The errors reported by William and Scott were fixed,
18552 except for a warning about SWIG_JavaThrowExecption()
18553 multiply defined. I can't reproduce this error with my
18554 examples. We will wait for Scott to send us a minimal
18555 case.
18556
18557
1855812/07/2003: mmatus (Marcelo Matus)
18559 The director protected member support has been
18560 completly moved out from python.cxx, and now
18561 resides in the common lang.cxx, emit.cxx and
18562 allocate.cxx files.
18563
18564 This means it should work for all the other languages
18565 that currently support directors, ie, python, java, ocalm
18566 and ruby.
18567
18568 The change has been tested with python (compilation+runtime)
18569 and java (just compilation).
18570
18571 Please add runtime tests for the missing languages
18572 and test it.
18573
18574 The '-nodirprot' option was moved to the principal main,
18575 and can be used from all the languages.
18576
1857712/07/2003: cheetah (William Fulton)
18578 [Java] Fixed and improved error checking of STRING_OUT typemaps in
18579 various.i.
18580
1858112/04/2003: mmatus (Marcelo Matus)
18582
18583 - Now the virtual members with no explicit declarator
18584 are properly identified:
18585
18586 struct A {
18587 virtual int f() = 0;
18588 };
18589
18590 struct B : A {
18591 int f();
18592 };
18593
18594 Here, B::f() is virtual, and the director and the
18595 virtual elimination mechanism now recognize that.
18596
18597 - [C#] This fix also fixes the problem where 'override' was not being
18598 used on any overridden virtual method, so for struct B above,
18599 this C# code is generated:
18600
18601 public class B : A {
18602 ...
18603 public override int f() {
18604 ...
18605 }
18606 ...
18607 }
18608
18609 - Initial support for protected virtual methods. They are now
18610 properly emitted when using with director (python only by
18611 now).
18612
18613 %feature("director") A;
18614 struct A {
18615 protected:
18616 virtual int f1() = 0;
18617 };
18618
18619 %feature("director") B;
18620 struct B : A{
18621 protected:
18622 int f1();
18623 virtual f2();
18624 };
18625
Olly Bettsa8091572023-10-25 09:35:33 +130018626 This can be disabled by using the '-nodirprot' option.
William S Fultoncf768a22003-12-17 21:46:32 +000018627
18628 - The feature 'nodirector' is working now at the top level,
18629 so, it must work for all the languages:
18630
18631 %feature("director") A;
18632 %feature("nodirector") A::f2;
18633
18634 struct A {
18635 virtual int f1();
18636 virtual int f2();
18637 };
18638
18639 in this case, only 'f1' is exported to the director class.
18640
18641 - Added director support for const TYPE& arguments (python).
18642
1864312/02/2003: cheetah (William Fulton)
18644 [Java] Fix for INOUT and OUTPUT typemaps in typemaps.i for when the JNI type
18645 is bigger than the C type. For example, unsigned long (32bits on most systems)
18646 is mapped to jlong (64bits). Returned value was incorrect. Bug reported by
18647 Brian Hawley.
18648
1864912/02/2003: cheetah (William Fulton)
18650 [C# and Java] Better fix for entry dated 05/11/2003. Fixes the following
18651 typemaps:
18652
18653 Java: javabase, javainterfaces, javaimports, javaclassmodifiers,
18654 javaptrconstructormodifiers, javafinalize, javagetcptr & javacode.
18655 C#: csbase, csinterfaces, csimports, csclassmodifiers,
18656 csptrconstructormodifiers, csfinalize, csgetcptr & cscode.
18657
18658 It also fixes bug in using arrays of C structs with arrays_java.i
18659 as reported Scott Michel.
18660
1866112/02/2003: beazley
18662 [Perl] Fixed [ 852119 ] recursive inheritance in output .pm, perl5.
18663 Reported by William Dowling.
18664
1866512/02/2003: beazley
18666 [Tcl] Fixed [ 755382 ] calling func(const vector<T>& p) evaluates p[0] in interp.
18667 The Tcl type checker was improperly handling the interpreter result when
18668 type violations were supposed to be ignored.
18669 Reported by Flaviu Popp-Nowak.
18670
1867111/30/2003: cheetah (William Fulton)
18672 Fixed [ 545058 ] configure's --with-tclincl has no effect
18673
1867411/30/2003: cheetah (William Fulton)
18675 [Java] Fixed [ 766409 ] missing symbol SWIG_JavaThrowException during module load
Olly Betts2f3bf142014-02-23 16:52:08 +130018676 SWIG's internal functions are all static as there is no need for different SWIG
William S Fultoncf768a22003-12-17 21:46:32 +000018677 generated modules to share any code at runtime.
18678
1867911/30/2003: beazley
18680 [Tcl] Added support for C++ pointers to members.
18681
1868211/28/2003: cheetah (William Fulton)
18683 Fixed [ 848335 ] Directors: #include wrapper .h file - was incorrectly
18684 adding a directory to the generated #include "foo_wrap.h" statement
18685 in some situations.
18686
1868711/28/2003: cheetah (William Fulton)
18688 [Java] Fixed [ 849064 ] JAVA : Access modifier for derived class wrong.
18689 The delete() method is always public now. It used to be protected whenever a
18690 destructor was non public. An UnsupportedOperationException runtime
18691 exception is thrown instead of making delete() protected now.
18692
1869311/28/2003: beazley
18694 [Perl5] Added support for C++ pointers to members.
18695
1869611/28/2003: beazley
18697 Fixed [ 850151 ] PYVERSION with python2.3 in configure of SWIG 1.3.19 (Maybe).
18698
1869911/28/2003: beazley
18700 Fixed [ 850666 ] #include extra line added.
18701 This should fix some problems with getting correct line numbers on
18702 error messages.
18703
1870411/26/2003: beazley
18705 Fixed another one of Marcelo's evil template bugs (infinite
18706 recursion). [ 849504 ] template and typedef -> inf. recursion.
18707
1870811/26/2003: beazley
18709 Fixed parsing problem with declarations like this:
18710
18711 int *x = &somearray[0];
18712
1871311/25/2003: beazley
18714 Fixed [ 756552 ] missing default argument class scope with "|".
18715 This is really only a band-aid fix for use of class-enums in
18716 expressions. For example:
18717
18718 class A {
18719 public:
18720 enum Flag { flag1 = 0x1, flag2 = 0x2 };
18721 void foo(int x = flag1 | flag2);
18722 };
18723
18724 Note: there are still some (more subtle) cases that are broken,
18725 but hard to fix due to an issue with template expansion. Will
18726 address later.
18727 Reported by Dmitry Mironov.
18728
1872911/25/2003: beazley
18730 Incorporated [ 840878 ] support for %inline { ... } (PATCH).
18731 This adds support for the following:
18732
18733 %inline {
18734 ... some code ...
18735 }
18736
18737 The difference between this and %inline %{ ... %} is that the
18738 enclosed text is processed by the SWIG preprocessor. This
18739 allows special macros and other processing to be used in
18740 conjunction with %inline.
18741 Contributed by Salvador Fandino Garcia.
18742
1874311/25/2003: beazley
18744 Fixed [ 836903 ] C++ inconsistency (with void arguments).
18745 SWIG was having difficulty with f() vs f(void) in C++ programs.
18746 For instance:
18747
18748 class A {
18749 public:
18750 virtual void f(void) = 0;
18751 };
18752
18753 class B {
18754 public:
18755 virtual void f(); // Not matched to f(void) correctly
18756 };
18757
18758 The parser now normalizes all declarations of the form f(void)
18759 in C++ classes to f(). This should fix a variety of subtle
18760 problems with inheritance, optimizations, overloading, etc.
18761 Problem reported by Partho Bhowmick.
18762
1876311/25/2003: beazley
18764 [Perl5] Incorporated [ 841074 ] better croaking (PATCH). This fixes some problems
18765 with strings and provides some new error functions.
18766 Contributed by Salvador Fandino Garcia.
18767
1876811/25/2003: beazley
18769 Fixed [ 791835 ] Default argument with cast: txt = (char *)"txt" syntax Error.
18770 The parser should now accept things like this:
18771
18772 void foo(char *s = (char *) "Hello");
18773
18774 Problem reported by Claudius Schnorr.
18775
1877611/24/2003: beazley
18777 [Tcl] Fixed problem with cross module linking. Previously modules referred
18778 to base classes through a global variable. Now, the module looks up base
18779 classes through the type system itself---avoiding the need to link to a global
18780 like before. Caveat: modules with base classes must be loaded before
18781 modules with derived classes.
18782
1878311/24/2003: mkoeppe (Matthias Koeppe)
18784 [Guile] In -scm mode, use () to represent null pointers,
18785 as it is done in -gh mode.
18786
1878711/23/2003: mkoeppe (Matthias Koeppe)
18788 Add a generated script "preinst-swig", which can be used
18789 to invoke SWIG before it has been installed. It arranges
18790 that the runtime libraries from the source directory are
18791 used.
18792
1879311/23/2003: mkoeppe (Matthias Koeppe)
18794 [Guile] In -gh mode, don't forget to call SWIG_Guile_Init.
18795 Add a SWIG_contract_assert macro.
18796
1879711/23/2003: mkoeppe (Matthias Koeppe)
18798 [MzScheme] Update the configure check for the dynext object to work
18799 with MzScheme 205.
18800
1880111/20/2003: mmatus
18802 Fixed the include/import error reported by Kerim Borchaev,
18803 where two files with names like
18804
18805 'dir1/hello.i'
18806 'dir2/hello.i'
18807
18808 can not be include at the same time. Swig was including
18809 just the first one, assuming the second one was not a
18810 different one, since it was checking/keeping just the
18811 basename 'hello.i'.
18812
1881311/19/2003: beazley
18814 Changes to the SWIG runtime library support.
18815 - The -c command line option has been renamed to -noruntime
18816 - New command line option: -runtime. When supplied, this
18817 inserts the symbol SWIG_GLOBAL into the wrapper code. This,
18818 in turn, makes all of the runtime support functions globally
18819 visible.
18820 - New library file: swigrun.i. Used to create modules
18821 for runtime library (if needed).
18822
1882311/18/2003: cheetah (William Fulton)
18824 'make srcrpm' rpmbuild fix - patch from Joe Cooper
18825
1882611/18/2003: mkoeppe (Matthias Koeppe)
18827 [Guile] Change meaning of configure option --with-guile to
18828 the name of the Guile executable. The new option --with-guile-prefix
18829 can be used to specify the tree where Guile is
18830 installed. (However, usually it suffices to use the
18831 single option --with-guile-config.)
18832 When running the run tests test-suite, make sure to use the
18833 version of Guile that SWIG was configured for.
18834
1883511/17/2003: mkoeppe (Matthias Koeppe)
18836 [Guile] Improvements to object-ownership management in
18837 "-scm" mode. (They do not apply to the default "-gh" mode.)
18838 * Renamed the smob type that indicates that the object can
18839 be garbage collected from "collected swig" to "collectable
18840 swig", which is more precise.
18841 * Export the destructor functions again. It is now
18842 allowed to explicitly call destructors, even for
18843 garbage-collected pointer objects. A pointer object
18844 that has been passed to a destructor is marked in a
18845 special way using a new smob type, "destroyed swig".
18846 (This helps avoid nasty memory bugs, where references to
18847 dead C objects are still held in Scheme. Moreover, the
18848 garbage collector will not try to free a destroyed
18849 object once more.)
18850 * Destructor-like functions can also mark their arguments
18851 as destroyed by applying the typemap SWIGTYPE *DESTROYED.
18852 (It calls the function SWIG_Guile_MarkPointerDestroyed.)
18853 * Functions that "consume" their objects (or that "own"
18854 them after the call) can mark their arguments as
18855 not garbage collectable. This can be done by applying
18856 the typemap SWIGTYPE *CONSUMED. (It calls the function
18857 SWIG_Guile_MarkPointerNoncollectable.)
18858 * The macro TYPEMAP_POINTER_INPUT_OUTPUT from library
18859 pointer-in-out.i creates additional typemaps
18860 PTRTYPE *INPUT_CONSUMED, PTRTYPE *INPUT_DESTROYED.
18861 They mark the passed pointer object likewise.
18862 The typemap PTRTYPE *OUTPUT creates a garbage-collectable
18863 pointer object, like %newobject does for a returned
18864 pointer. Use the new typemap PTRTYPE *OUTPUT_NONCOLLECTABLE
18865 to create a pointer object that will not be garbage collected.
18866
1886711/17/2003: mkoeppe (Matthias Koeppe)
18868 [Guile] Handle $input in "freearg" typemaps.
18869 Never qualify GOOPS slot names with the class name.
18870 Handle optional arguments properly in the GOOPS methods.
18871
1887211/16/2003: cheetah (William Fulton)
18873 Fixes for installation to work with the upcoming Automake-1.8.
18874 mkinstalldirs was being used by a non-Automake makefile.
18875 mkinstalldirs is being phased out and so was not being
18876 created by Automake. install-sh used instead.
18877
1887811/16/2003: cheetah (William Fulton)
18879 [Java] Numerous director improvements, tweaks and bug fixes since
18880 the initial implementation have been contributed by Scott Michel.
18881
1888211/12/2003: beazley
18883 [Python] When %feature("shadow") is used to add code to shadow
18884 classes, the special variable $action expands to the name of the
18885 underlying wrapper function that would have been called normally.
18886
1888711/12/2003: beazley
18888 [Python] When generating proxy class code, SWIG emits a few
18889 default methods for __repr__() and other Python special
18890 methods. Some of these methods are emitted after all of the
18891 contents of a class. However, this makes it hard to override
18892 the methods using %pythoncode and some other directives that
18893 allow code to be inserted into a class. These special methods
18894 are now emitted into the code *before* all of the other methods.
18895 Suggested by Eric Jones.
18896
1889711/11/2003: beazley
18898 Preprocessor enhancement. For include statements like this:
18899
18900 %include "foo/bar.i"
18901
18902 the directory "foo" is now added to the search path while
18903 processing the contents of bar.i. Thus, if bar.i includes other
18904 files in the same directory, they will be found. Previously,
18905 you would have to add additional directories using -I to make this
18906 work correctly. Note: the C preprocessor seems to behave in
18907 an identical manner on many (most? all?) systems.
18908 Suggested by Kerim Borchaev.
18909
1891011/11/2003: beazley
William S Fultonc6f8aad2015-08-02 20:13:40 +010018911 Configuration changes to make SWIG work on Mac OS X 10.3.x (Panther).
William S Fultoncf768a22003-12-17 21:46:32 +000018912 Tested with Python, Tcl, Perl, and Ruby---all of which seem to work.
18913
1891411/08/2003: cheetah (William Fulton)
18915 [Java] Fixed the typemaps in various.i which were mostly broken.
18916 char **STRING_IN and char **STRING_RET typemaps replaced with
18917 STRING_ARRAY. float *FLOAT_ARRAY_RETURN typemap removed.
18918
1891911/08/2003: beazley
18920 [Tcl] Tcl module now emits a safe module initialization function by
18921 default. It can be removed by running 'swig -nosafe'.
18922
1892311/04/2003: mkoeppe (Matthias Koeppe)
18924 [Guile] Only use the SCM_ API when the function
18925 `scm_slot_exists_p' exists (needed for GOOPS support).
18926 This function was renamed during the Guile 1.5 series
18927 from `scm_slots_exists_p'.
18928 Report the right runtime library when invoked with
18929 -scm -ldflags.
18930
1893111/03/2003: mkoeppe (Matthias Koeppe)
18932 [Chicken] Fix #782052. The --with-chickencfg configure
18933 option (and others) were not accepted.
18934
1893511/02/2003: mkoeppe (Matthias Koeppe)
18936 [Guile] Merge new set of GOOPS changes by John Lenz.
18937 GOOPS objects are now manipulated directly by the C code.
18938 Some fixes to typemap-GOOPS interaction.
18939
1894011/02/2003: mkoeppe (Matthias Koeppe)
18941 [Guile] Remove the file argument to -scmstub and -goops.
18942 The Scheme files are now always called MODULE.scm or
18943 MODULE-primitive.scm, where MODULE is the module name and
18944 "primitive" can be changed by the -primsuffix option.
18945 The Scheme files are now placed in the directory given by
18946 the -outdir option, or the current directory.
18947 (Patch by John Lenz, slightly modified.)
18948
18949 *** INCOMPATIBILITY [Guile] ***
18950
1895111/02/2003: mkoeppe (Matthias Koeppe)
18952 Unify the pointer-conversion runtime API. The standard
18953 functions are:
18954 * SWIG_NewPointerObj (POINTER, TYPE, FLAGS)
18955 -- Create an scripting object that represents a typed
18956 pointer. FLAGS are language specific.
18957 * SWIG_ConvertPtr (INPUT, RESULT, TYPE, FLAGS)
18958 -- Get a pointer from the scripting object INPUT and
18959 store it in the place RESULT. When a type mismatch
18960 occurs, return nonzero.
18961 * SWIG_MustGetPtr (INPUT, TYPE, ARGNUM, FLAGS)
18962 -- Get a pointer from the scripting object INPUT and
18963 return it. When a type mismatch occurs, throw an
18964 exception. If ARGNUM > 0, report it as the
18965 argument number that has the type mismatch.
18966 [Guile]: No changes.
18967 [MzScheme]: No changes.
18968 [Perl]: Add the function SWIG_NewPointerObj.
18969 The function SWIG_MakePtr is kept.
18970 The function SWIG_MustGetPtr is currently not
18971 supported.
18972 [Python]: Add the function SWIG_MustGetPtr.
18973 [Ruby]: Add the function SWIG_MustGetPtr.
18974 [Tcl]: Remove the "interp" argument of
18975 SWIG_NewInstanceObj, SWIG_ConvertPtr,
18976 SWIG_ConvertPacked, and SWIG_ConvertPtrFromString.
18977 The function SWIG_MustGetPtr is currently
18978 not supported.
18979 No changes to Pike because its pointer conversion code did
18980 not look complete. No changes to PHP4, because I did not
18981 understand its runtime code. No changes to Chicken
18982 because major changes are expected soon anyway. No
18983 changes to Java, OCaml, C# because they do not seem to
18984 have a pointer-conversion runtime API.
18985
18986 *** INCOMPATIBILITY [Tcl] ***
18987
1898811/02/2003: mkoeppe (Matthias Koeppe)
18989 [Perl5, PHP4, Pike, Python, Ruby, Tcl]: Use the
18990 preprocessor to rename external functions of the SWIG
18991 runtime API to follow the naming convention
18992 SWIG_<language>_<function>. This should allow linking
18993 more than one interpreter into a program.
18994
1899510/31/2003: cheetah (William Fulton)
18996 [C#] Fix since introducing the exception and std::string delegates.
18997 The fix overcomes linker errors when using more than one SWIG module.
18998 Problem reported by Andreas Schörk.
18999
1900010/31/2003: beazley
19001 Incorporated patch: [ 823302 ] Incr Tcl support.
19002 Contributed by Alexey Dyachenko.
19003 Note: needs documentation.
19004
1900510/31/2003: beazley
19006 Incorporated patch: [ 829325 ] new Python Module options and features.
19007 Robin Dunn writes:
19008
19009 This patch makes a number of changes to the SWIG python module.
19010
19011 1. Add -apply option, and change the default code
19012 output to use the foo(*args, **kw) calling syntax
19013 instead of using apply(). If the -apply option is
19014 given then code is generated as before. This is very
19015 similar to Patch #737281 but the new -modern option
19016 makes the second half of that patch unnecessary so it
19017 is not included here.
19018
19019 2. Add -new_repr option. This is the same as my Patch
19020 #797002 which I will mark as closed since it is no
19021 longer needed. When this new option is used then the
19022 __repr__ methods that are generated for proxy classes
19023 will be more informative and give details about the
19024 python class and the C++ class.
19025
19026 3. Add %feature("addtofunc"). It allows you to insert
19027 one or more lines of code inside the shadow method or
19028 function that is already generated, instead of
19029 replacing the whole thing like %feature("shadow") does.
19030 For __init__ it goes at the end, for __del__ it goes
19031 at the begining and for all others the code generated
19032 is expanded out to be like
19033
19034 def Bar(*args, **kwargs):
19035 val = _module.Foo_Bar(*args, **kwargs)
19036 return val
19037
19038 and the "addtofunc" code is inserted just before the
19039 return statement. If the feature is not used for a
19040 particular method or function then the shorter code is
19041 generated just like before.
19042
19043 4. A little bit of refactoring to make implementing
19044 addtofunc a little easier.
19045
19046 5. Added a -modern command-line flag that will cause
19047 SWIG to omit the cruft in the proxy modules that allows
19048 it to work with versions of Python prior to 2.2. The
19049 result is a simpler, cleaner and faster python proxy
19050 module, but one that requires Python 2.2 or greater.
19051
1905210/31/2003: beazley
19053 Incorporated patch: [ 829319 ] XML module tweaks.
19054 This adds a new command line option -xmllite that
19055 greatly reduces the amount of emitted XML code by
19056 eliminating some fields mostly used in SWIG's
19057 internal processing. Contributed by Robin Dunn.
19058
1905910/31/2003: beazley
19060 Incorporated patch: [ 829317 ] Adds DohSplitLines function.
19061 Contributed by Robin Dunn.
19062
1906310/29/2003: beazley
19064 Fixed [ 827907 ] argout objects not being wrapped properly (PATH).
19065 Patch contributed by Salvador Fandiño García.
19066
1906710/29/2003: beazley
19068 Fixed [ 826996 ] perl type checking ignores perl subclasses.
19069 This enhancement makes it so wrapped classes and structs can
19070 be subclassed in Perl and used normally.
19071 Patch contributed by Salvador Fandiño García.
19072
1907310/16/2003: cheetah (William Fulton)
19074 [C#] IntPtr marshalled with a void* instead of int in C function
19075 declarations. The casts thus look more conventional, for example:
19076
19077 // old
19078 DllExport double SWIGSTDCALL CSharp_get_Shape_x(int jarg1) {
19079 ...
19080 Shape *arg1 = (Shape *) 0 ;
19081 arg1 = *(Shape **)&jarg1;
19082 ...
19083 }
19084 // new
19085 DllExport double SWIGSTDCALL CSharp_get_Shape_x(void * jarg1) {
19086 ...
19087 Shape *arg1 = (Shape *) 0 ;
19088 arg1 = (Shape *)jarg1;
19089 ...
19090 }
19091
19092
1909310/14/2003: beazley
19094 Fixed a subtle problem with overloaded methods and smart pointers.
19095 If a class has overloaded methods like this:
19096
19097 class Foo {
19098 public:
19099 int bar(int x);
19100 static int bar(int x, int y);
19101 };
19102
19103 and the class is used as a smart pointer:
19104
19105 class FooPtr {
19106 public:
19107 Foo *operator->();
19108 };
19109
19110 The SWIG would try to expose the static member Foo::bar
19111 through FooPtr---resulting bogus wrapper code and a compiler
19112 error.
19113
19114 Due to the way in which overloading is handled, it is
19115 extremely difficult to eliminate the static method in
19116 this case. Therefore, it is still exposed. However,
19117 the generated code now compiles and works.
19118
1911910/05/2003: mkoeppe (Matthias Koeppe)
19120 [Guile, MzScheme, Chicken]: Remove symbol clashes between
19121 the runtime libraries by renaming all extern common.swg
19122 functions with the preprocessor.
19123
1912410/05/2003: mkoeppe (Matthias Koeppe)
19125 [Guile] Added basic GOOPS support, contributed by John Lenz.
19126 See the documentation for details.
19127
19128 *** NEW FEATURE ***
19129
1913010/04/2003: mkoeppe (Matthias Koeppe)
19131 [Guile] New option, -only-setters, which disables
19132 traditional getter and setter procedures for structure slots.
19133
1913410/03/2003: mkoeppe (Matthias Koeppe)
19135 [Guile] Added run test for reference_global_vars by John Lenz.
19136
1913709/30/2003: beazley
19138 Partial solution to [ 792180 ] C++ smart-pointer/namespace mixup revisited.
19139 The problem is not easy to fix (at least it doesn't seem so), but is
19140 related to the instantiation of qualified templates inside of other
19141 namespaces. SWIG now generates an error message in this case rather
19142 than generating broken wrappers.
19143
1914409/30/2003: beazley
19145 Fixed [ 800012 ] ENTER macro from CORE/scope.h clashes with libc search.h.
19146 Reported by Britton Leo Kerin.
19147
1914809/30/2003: beazley
19149 Fixed [ 811518 ] Casting ints to doubles (w/ solution?)
19150 Addresses a problem with overloading in the Perl module.
19151 Reported by Gerald Dalley.
19152
1915309/28/2003: mkoeppe
19154 [Guile with -scm option] Fix typo in generated code for
19155 procedures-with-setters. Reported by John Lenz.
19156
1915709/26/2003: beazley
19158 Fixed [ 812528 ] externs not correct when throw is in signature.
19159 Reported by Joseph Winston.
19160
1916109/23/2003: cheetah (William Fulton)
19162 SWIG was generating a number of symbols that didn't comply with
19163 the ISO C/C++ standard, in particular ISO/IEC 14882:1998(E) 17.4.3.1.2
19164 where double underscores are forbidden as well as symbols starting with
19165 an underscore followed by an upper case letter. Most of these have
19166 been rooted out. See new section added to internals.html development
19167 manual 'Symbol Naming Guidelines for Generated C/C++ Code'.
19168
1916909/23/2003: cheetah (William Fulton)
19170 Director typemap name changes:
19171 inv => directorin
19172 outv => directorout
19173 argoutv => directorargout
19174
19175 *** POTENTIAL INCOMPATIBILITY ***
19176
1917709/19/2003: mrose (Mark Rose)
19178 [Python] Director constructors now default to __disown = 0,
19179 which is the intended behavior and fixes the director_finalizer
19180 test case under python.
19181
1918209/12/2003: cheetah (William Fulton)
19183 [C#] - Typemaps added for std::string and const std::string &.
19184 - New delegate for creating a C# string given a char *. It
19185 can be used by calling SWIG_csharp_string_callback as shown
19186 in the std::string 'out' typemap. Useful if the return type is
19187 mapped to a C# string and the calling function is responsible
19188 for cleaning up memory as the C# garbage collector doesn't
19189 free the memory created in C/C++ and then returned as a C# string.
19190 - The exception delegates have moved into an inner class in the
19191 intermediate class, thereby freeing up the static constructor.
19192
1919309/11/2003: beazley
19194 (Internals)
19195 Major refactoring of iteration over lists and hashes. The
19196 DOH library now uses iterators. They work like this:
19197
19198 List *l = (some list);
19199
19200 Iterator i;
19201 for (i = First(l); i.item; i = Next(i)) {
19202 // i.item contains the actual list item.
19203 // i.item is NULL at end of list
19204 ...
19205 }
19206
19207 Hash *h = (some hash);
19208 Iterator j;
19209 for (j = First(h); j.item; j = Next(j)) {
19210 // j.item contains hash table item
19211 // j.key contains hash table key
19212 // Both j.item and j.key are NULL at end
19213 ...
19214 }
19215
19216 The old iteration functions Firstitem(), Nextitem(), Firstkey(),
19217 and Nextkey() are gone.
19218
19219 The new iterators are simpler, result in better memory use,
19220 and may be faster. Also, there are no longer any problems
19221 iterating over the same list/hash in multiple places at
19222 the same time. For example, this is fine:
19223
19224 Iterator i,j;
19225 for (i = First(l); i.item; i = Next(i)) {
19226 for (j = First(l); j.item; j = Next(j)) {
19227 ...
19228 }
19229 }
19230
19231 (This never worked in previous versions).
19232 *** POTENTIAL INCOMPATIBILITY ***. This will probably break
19233 third party extensions to SWIG (or give them further encouragement
19234 to join the SWIG CVS-tree :-).
19235
1923609/10/2003: mkoeppe (Matthias Koeppe)
19237 [Guile] Fix memory leaks in the "list-vector.i" typemaps.
19238
1923909/09/2003: mkoeppe (Matthias Koeppe)
19240 [Chicken] Use C_mk_bool rather than C_mkbool. This fixes
19241 the wrapping of boolean values for Chicken 1.10 and newer.
19242 Reported by Dave <[email protected]> / Felix Winkelmann
19243 <[email protected]>.
19244
1924509/05/2003: cheetah (William Fulton)
19246 [Java] Directors implemented for Java. In summary this is a big new feature
19247 which supports upcalls from C++ to Java. Code is generated to support C++
19248 callbacks to call into Java and true polymorphic behaviour for Java classes
19249 derived from C++ classes. See java.html for details. Contributed by
19250 Scott Michel.
19251
1925209/05/2003: Tiger
19253 Created contract example directory at /SWIG/Examples/contract
19254 Added simple contract examples (simple_c & simple_cxx)
19255 Modified contract module's output format
19256
19257 *** NEW FEATURE ***
19258
1925909/01/2003: cheetah (William Fulton)
19260 Test-suite build improvements:
19261 - Multiple build directories working for the test suite, so it is now
19262 possible to run configure in multiple subdirectories and run the test
19263 suite in each of these sub directories.
19264 - 'make distclean' fixed so it doesn't bomb out on the Examples directory
19265 when using multiple subdiretory builds. Required the following directories
19266 to be moved:
19267 Examples/GIFPlot/Perl -> Examples/GIFPlot/Perl5
19268 Examples/GIFPlot/Php -> Examples/GIFPlot/Php4
19269 These new directories used to be symbolic links to the old directory.
19270 Also the Examples/test-suite/Perl symbolic link has been removed.
19271 - Running the test-suite, other than from the root directory, say
19272 in Examples/test-suite/python will now display all the code being
19273 executed.
19274 - The following 3 C# compilers are detected during configure and work with
19275 the test-suite: Mono, Portable.NET and Microsoft.
19276
1927709/01/2003: Tiger
19278 Added inheritance support for design by contract feature.
19279
1928009/01/2003: beazley
19281 Fixed [ 794914 ] Wrong types in template specialization.
19282 SWIG was not handling arguments correctly in template
19283 partial specialization. For example,
19284
19285 template<class T> class Foo<T *> {
19286 public:
19287 T *blah();
19288 };
19289
19290 %template(FooInt) Foo<int *>;
19291
19292 in this class, the return type of blah was set to
19293 'int **', but it should really be 'int *'. This has been
19294 fixed, but it will affect all prior uses of partial
19295 specialization.
19296
1929709/01/2003: beazley
19298 Fixed [ 786394 ] Patch for generated perl code does not compile under RedHat9.
19299 Reported by Scott Finneran.
19300
1930109/01/2003: beazley
19302 Fixed [ 791579 ] (unsigned) long long handled incorrectly (Tcl).
19303 This was an error in the Tcl typemaps.i file.
19304 Reported by Kjell Wooding.
19305
1930609/01/2003: beazley
19307 Fixed [ 797573 ] no way to rename classes coming from C structures.
19308 This problem relates to renaming of anonymous structures with a
19309 typedef. For example:
19310
19311 %rename(Bar) Foo;
19312 typedef struct {
19313 ...
19314 } Foo;
19315
19316 Reported by Britton Leo Kerin.
19317
1931809/01/2003: beazley
19319 Fixed [ 797576 ] -help seems to imply that only tcl-specific options exist.
19320 Added a comment to alert user to other options.
19321 Reported by Britton Leo Kerin.
19322
1932309/01/2003: beazley
19324 Fixed [ 798205 ] Segfault in SWIG_ConvertPtr.
19325 Reported by Prabhu Ramachandran.
19326
1932708/30/2003: mrose (Mark Rose)
19328 Modified the director typemaps in python/std_complex.i to use the
19329 new-style macro and conversion functions, which eliminated some
19330 redundant code. Fixed a few bugs in these typemaps as well, although
19331 more testing is needed.
19332
1933308/29/2003: mrose (Mark Rose)
19334 Completed initial support for wrapping abstract classes with directors.
19335 Constructor wrappers will be generated for abstract classes that have
19336 directors, and instances of the director classes will be created regardless
19337 of whether the proxy class has been subclassed in the target language.
19338 No checks are made during construction to ensure that all pure virtual
19339 methods are implemented in the target language. Instead, calls to
19340 unimplemented methods will throw SWIG_DIRECTOR_PURE_VIRTUAL_EXCEPTION
19341 exceptions in C++.
19342
19343 Integrated Prabhu Ramachandran's typemap patches, which provide director
19344 typemap support for enums and std::size_t, and fix a couple bugs in the
19345 director std::vector<> typemaps.
19346
1934708/29/2003: cheetah (William Fulton)
19348 [C#] Implemented exception handling for throwing C# exceptions from C/C++ code.
19349 A few delegate functions are available for calling which then throw the C#
19350 exception. Use the SWIG_CSharpThrowException function from C/C++ typemaps.
19351 See the generated wrapper code or csharphead.swg for all available exceptions.
19352 Example:
19353
19354 SWIG_CSharpThrowException(SWIG_CSharpException, "exception description");
19355
19356 The 'throws' typemaps are also now implemented, so code is automatically
19357 generated to convert any C++ exception into a C# System.Exception when the C++
19358 method declares an exception specification such as:
19359
19360 int foo() throw(Bar);
19361
19362 Also any parameters that are references to a C++ class or a class passed by value
19363 and are passed as a C# null will now throw a C# NullReferenceException.
19364
1936508/29/2003: cheetah (William Fulton)
19366 [C#] Fix to match the calling convention of all pinvoke methods so that they
19367 match the calling convention used by default in the C# 'static extern' declarations
19368 (__stdcall is used on Windows).
19369
1937008/19/2003: cheetah (William Fulton)
19371 [Java] Reworked std::string typemaps. Fixes a number of string in std namespace
19372 problems. For example %template vector<string>. The templated class' get method
19373 wasn't returning a Java String, but a SWIGTYPE_p_string. Reported
19374 by Zach Baum.
19375
1937608/15/2003: beazley
19377 Fixed [ 763522 ] 1.3.19 segfault in SwigType_add_pointer/DohInsertitem.
19378 Related to problem with unnamed class handling in Perl module.
19379
1938008/15/2003: beazley
19381 Fixed [ 763563 ] Missing indication of optional arguments.
19382 Tcl module. Reported by Krzysztof Kozminski.
19383
1938408/15/2003: beazley
19385 Fixed [ 787432 ] long param handled as int. Tcl module
19386 now uses Tcl_GetLongFromObj to convert integer values.
19387
1938808/11/2003: beazley
19389 Fixed [ 775989 ] numeric template parameters. There were
19390 some errors in template expansion related to the use of
19391 arrays where the array dimension was a template parameter.
19392 It should work now. Reported by Bryan Green.
19393
1939408/10/2003: mrose (Mark Rose)
19395 Added a director typemap (outv) for return by value and cleaned up up a few
19396 of the commented director typemaps.
19397
1939808/10/2003: mrose (Mark Rose)
19399 Fixed constructor generation for director classes to ignore private
19400 constructors. Protected constructors are also ignored for now, pending
19401 a solution to the problem of wrapping classes that only define protected
19402 constructors.
19403
1940408/07/2003: cheetah (William Fulton)
19405 New commandline option -outdir <dir> to specify where the language specific
19406 files are to be generated. This is useful for target languages like Python,
19407 Java etc which generate proxy files in the appropriate language.
19408 This option does not apply to the C/C++ wrapper file.
19409
1941008/07/2003: cheetah (William Fulton)
19411 On Windows the generated files (other than the _wrap.c or _wrap.cxx files)
19412 were sometimes incorrectly being generated into the current directory unless
19413 the input file used the Unix path separator. The Windows path separator
19414 should now be used. Bug reported by Robert Davies.
19415
1941608/07/2003: beazley
19417 Added array variable set typemap to Perl module.
19418
1941908/07/2003: beazley
19420 Fixed [ 775677 ] Array init causes codegen bug..
19421
1942208/07/2003: beazley
19423 Fixed [ 779062 ] Class"\n"::foo not supported. SWIG
19424 should now correctly handle whitespace in between
19425 namespace qualifiers. For example "A :: Foo :: Bar".
19426
1942707/31/2003: cheetah (William Fulton)
19428 Fixes for parameters which are classes that are passed by value and have
19429 a default value. A copy constructor for SwigValueWrapper is required
19430 (SF #780056). Also fixed memory leak in these circumstances. These mods
19431 also fix SF #780054.
19432
1943307/28/2003: beazley
19434 Improved run-time error message for pointers in Python module.
19435 Contributed by Zooko.
19436
1943707/10/2003: ballabio (Luigi Ballabio)
19438 [Almost all languages] Wrappers for std::pair added.
19439 Typemaps for Python, Ruby, Guile and MzScheme.
19440
1944107/01/2003: mkoeppe (Matthias Koeppe)
19442 [Chicken] Handle the case of more than one argout typemap
19443 per function.
19444
1944506/29/2003: cheetah (William Fulton)
19446 [Java, C#] SF #670949 request. The destructor wrapper function name is now
19447 configurable. A new attribute called methodname in the
19448 javadestruct/javadestruct_derived (Java) or csdestruct/csdestruct_derived (C#)
19449 typemaps specifies the method name. For example in Java the destructor is
19450 wrapped by default with the delete method:
19451
19452 %typemap(javadestruct, methodname="delete") SWIGTYPE {...}
19453
1945406/27/2003: cheetah (William Fulton)
19455 [Java, C#] The throws attribute for adding exception classes to the throws
19456 clause also now works with the following typemaps:
19457 newfree
19458 javain, javaout (Java)
19459 csin, csout (C#)
19460
19461 For example, the 'AnException' will be added to the throws clause in the
19462 proxy function:
19463
19464 %typemap(javaout, throws="AnException") int {
19465 int returnValue=$jnicall;
19466 if (returnValue==0) throw new AnException("Value must not be zero");
19467 return returnValue;
19468 }
19469
1947006/25/2003: mrose (Mark Rose)
19471 [Python] Director typemap marshalling checks for null pointers when
19472 walking the parameter list instead of relying soley on the parameter
Olly Bettsf9566ad2013-01-08 18:47:40 +130019473 count. Cures a segfault that occurred for multiple argument inv typemaps.
William S Fultoncf768a22003-12-17 21:46:32 +000019474 Someone with more Swig experience should probably review this code.
19475
1947606/24/2003: mkoeppe (Matthias Koeppe)
19477 [Chicken] Don't emit calls to "C_check_for_interrupt",
19478 which may result in an endless loop. Patch by [email protected].
19479
1948006/20/2003: cheetah (William Fulton)
19481 [C#] Finalizers now use destructor syntax as the override which was used in
19482 the Finalize method is not in the ECMA standards, spotted by the MS compiler.
19483
1948406/10/2003: cheetah (William Fulton)
19485 [C#] A number of changes have been made to remove the Java naming
19486 that was used in the C# module.
19487
19488 Typemap name changes:
19489 jni -> ctype
19490 jtype -> imtype
19491 jstype -> cstype
19492 javain -> csin
19493 javaout -> csout
19494 javainterfaces -> csinterfaces
19495 javabase -> csbase
19496 javaclassmodifiers -> csclassmodifiers
19497 javacode -> cscode
19498 javaimports -> csimports
19499 javaptrconstructormodifiers -> csptrconstructormodifiers
19500 javagetcptr -> csgetcptr
19501 javafinalize -> csfinalize
19502
19503 Feature name changes:
19504 javaconst -> csconst
19505 javamethodmodifiers -> csmethodmodifiers
19506
19507 Pragma changes:
19508 pragma(java) -> pragma(csharp)
19509 jniclassbase -> imclassbase
19510 jniclassclassmodifiers -> imclassclassmodifiers
19511 jniclasscode -> imclasscode
19512 jniclassimports -> imclassimports
19513 jniclassinterfaces -> imclassinterfaces
19514
19515 Special variable name changes:
19516 $javaclassname -> $csclassname
19517 $javainput -> $csinput
19518 $jnicall -> $imcall
19519
19520 This will break SWIG interface files that use these typemaps, features
19521 and pragmas. Please update your code or use macros for backwards
19522 compatibility.
19523
19524 *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
19525
1952606/10/2003: mkoeppe (Matthias Koeppe)
19527 [MzScheme] Applied MzScheme module updates contributed by
19528 John Lenz <[email protected]>.
19529
19530 - Updated mzscheme to use SWIG's common runtime type
19531 system from common.swg.
19532
19533 - The Lib/mzscheme directory has been reorganized to
19534 standardize names across the language modules:
19535 mzscheme.i was moved to mzscheme.swg, mzscheme.swg and
19536 mzschemedec.swg have been removed, mzrun.swg (which
19537 contains the runtime code) has been added.
19538
19539 - The swig_proxy structure was renamed to swig_mz_proxy.
19540 swig_mz_proxy now contains a pointer to a swig_type_info
19541 structure.
19542
19543 - Added varin and varout typemaps for SWIGTYPE [] and
19544 SWIGTYPE &.
19545
19546 - Garbage collection by calling scheme_add_finalizer() has
19547 been added.
19548
19549 *** NEW FEATURE [MzScheme] ***
19550
1955106/10/2003: cheetah (William Fulton)
19552 [Java] New typemaps: javadestruct and javadestruct_derived
19553 for the C++ destructor wrapper. The javadestruct version gets used by
19554 classes at the top of an inheritance chain and the javadestruct_derived
19555 version gets used by other classes.
19556
19557 [C#] cildispose and cildisposeoverride typemaps replaced by
19558 csdestruct and csdestruct_derived typemaps. The delete()
19559 method has been removed and its functionality put into these
19560 typemaps designed for the Dispose() method.
19561
19562 - New typemaps csinterfaces and csinterfaces_derived replace
19563 the javainterfaces typemap. Also fixes the peculiarity of all classes
19564 in an inheritance chain individually deriving from the IDisposable
19565 interface.
19566
19567 - New typemap csfinalize for finalizers. C++ destructors are now called
19568 by garbage collector during finalization. Problem reported by
19569 Andreas Schörk.
19570
1957106/10/2003: Tiger
19572 Modified contract code for error message output.
19573 Contract code can now print out simple error message.
19574 Modified contract code to prepare for inheritance
19575
1957606/03/2003: mkoeppe
19577 [Guile] Applied Guile module updates contributed by
19578 John Lenz <[email protected]>.
19579
19580 - SWIG currently uses Guile's gh_ API, which is marked as
19581 deprecated in Guile 1.6 and will be removed in Guile
19582 1.9. This change introduces a command-line flag "-scm"
19583 which causes SWIG to generate wrappers that use Guile's
19584 SCM API instead; this requires Guile >= 1.6.
19585
19586 - The Lib/guile directory has been reorganized to
19587 standardize names across language modules: guiledec.swg
19588 and guile.swg have been moved into guile_gh_run.swg,
19589 guile.i has been moved to guile_gh.swg, guile_scm.swg
19590 and guile_scm_run.swg which contain the SCM API stuff
19591 have been added
19592
19593 - ghinterface.i, which contains the defines from the gh_
19594 functions to the scm_functions has been added
19595
19596 - The API for dealing with pointer objects is now
19597 SWIG_ConvertPtr, SWIG_MustGetPtr, SWIG_NewPointerObj.
19598
19599 - Added varin and varout typemaps for SWIGTYPE [] and SWIGTYPE &
19600
19601 - Garbage collection has been added.
19602
19603 *** NEW FEATURE [Guile] ***
19604
1960506/01/2003: cheetah (William Fulton)
19606 Dimensionless arrays such as
19607
19608 int foo[] = {1, 2};
19609 extern int bar[];
19610
19611 produce a warning that the variable is read-only. Depending on the target
19612 language, this used to cause compile errors or generate a setter that
19613 generated a runtime error. A setter cannot be automatically generated
19614 because the array size cannot be determined by SWIG. A varin, globalin
19615 or memberin typemap (depending on the target language) must be written
19616 by the user.
19617
1961805/29/2003: beazley
19619 Refinement to default typemap matching and arrays. When an
19620 array is declared like this:
19621
19622 int foo[4];
19623
19624 The default typemap now resolves to
19625
19626 SWIGTYPE [ANY]
19627
19628 If no match is found for that, it then resolves to
19629
19630 SWIGTYPE []
19631
19632 If no array dimension is specified in the original declaration,
19633 the SWIGTYPE [] is used right away.
19634
19635 Note: This change has been made to resolve problems related to
19636 arrays with and without dimensions. For example, sometimes SWIG
19637 was generating setter functions for array variables with no dimensions
19638 (an error). Likewise, SWIG sometimes made arrays with dimensions
19639 read-only (also an error). This fixes the arrays_global test
19640 problem.
19641
1964205/28/2003: beazley
19643 Fixed subtle type handling bug with references and pointers.
19644 If you had functions like this:
19645
19646 typedef Foo Bar;
19647
19648 Foo *func1();
19649 void func2(Bar &x);
19650
19651 Then func2() wouldn't accept objects returned by func1()
19652 because of a type error. It should work now.
19653 Reported by Brian Yang.
19654
1965505/21/2003: cheetah (William Fulton)
19656 Fixes to some of the Visual C++ example project files which would not
19657 work with spaces in the paths held in the environment variables used to
19658 point to the target language's library / include directory.
19659 SF bug #740769
19660
1966105/21/2003: songyanf (Tiger)
19662 Added -contracts option.
19663 First try of the idea of "Wrap by Contract":
19664 build up realiable cross-language module by wrapping with SWIG.
19665 Implemented basic assertion
19666 (preassertion & postassertion & invariant)
19667 for simple C/C++ functions.
19668
19669 Current format of contracts are:
19670 %contract class_name :: func_name (paras...) {
19671 require:
19672 boolean exprs;
19673 exprs;
19674 ensure:
19675 boolean expr;
19676 exprs;
19677 invariant:
19678 boolean expr;
19679 exprs;
19680 }
19681
19682 *** NEW FEATURE ***
19683
1968405/19/2003: cheetah (William Fulton)
19685 Build tweaks. There were a few preprocessor definitions which were
19686 specified in the Makefile for passing on the commandline when compiling.
19687 These are now all defined in swigconfig.h. Autoconf doesn't normally
19688 allow installation directories to be defined in this config header file,
19689 but an autoconf archive macro enables this. This macro along with future
19690 autoconf macros are going to be put in the Tools/config directory.
19691
19692 'swig -version' now reports the target build platform.
19693
1969405/11/2003: cheetah (William Fulton)
19695 [C# and Java] Fix to the following typemaps:
19696
19697 javabase, javainterfaces, javaimports, javaclassmodifiers,
19698 javaptrconstructormodifiers, javafinalize, javagetcptr & javacode.
19699
19700 These are the typemaps for modifying/generating proxy classes.
19701 Previously the typemaps would use the proxy class name and not the
19702 C++ type, which was inconsistent with all other typemaps.
19703
19704 In most circumstances the proxy class name and the C++ class name/type
19705 is the same except for classes in namespace, templated classes etc. so
19706 this shouldn't affect most cases.
19707
19708 *** POTENTIAL INCOMPATIBILITY FOR JAVA and C# MODULES ***
19709
1971005/09/2003: cheetah (William Fulton)
19711 Visual C++ Project files have been added so that the runtime libraries
19712 can be built on Windows (for Tcl, Perl, Python and Ruby).
19713
1971405/01/2003: beazley
19715 Fixed problem with return by value, const, and private constructors.
19716 For example:
19717
19718 class B {
19719 private:
19720 B();
19721 public:
19722 B(const B&);
19723 };
19724
19725 class A {
19726 ...
19727 const B returnB() const;
19728 ...
19729 };
19730
19731 Problem and patch suggestion reported by Bill Hoffman.
19732
1973304/29/2003: cheetah (William Fulton)
19734 Build changes:
19735 - Single autoconf invocation - autoconf in the Tools directory has gone.
19736
19737 - Libtool bootstrapped when running autogen.sh. This requires anyone
19738 using the cvs version of SWIG to have libtool installed on their
19739 machine. Suggest version 1.4.2 or higher, preferably the latest - 1.5.
19740
19741 - Automake is now used to build the runtime libraries in conjunction
19742 with libtool.
19743
19744 - Runtime libraries are now successfully built as DLLs on Cygwin.
19745
19746 - Skipping languages is no longer just determined in the top level
19747 makefile but in configure.in. This info is used for building
19748 the runtime libraries and for running the examples and test-suite.
19749
19750 - These changes have fixed multiple build directory builds, that is
19751 building from directories other than the top level directory.
19752 Installation from multiple build directories also working. An initial
19753 configure in the top level directory is no longer needed as described
19754 in 04/02/2003 entry. A 'make distclean' will be needed before building
19755 in a directory other than the top level directory if the autotools
19756 have been run from this top level directory at some point, but
19757 autoconf will tell you this. Note that 'make check' only works from
19758 the top level directory at the moment.
19759
1976004/28/2003: beazley
19761 Fixed [ 723471 ] Wrapper_print() fails with preprocessor directives.
19762
1976304/28/2003: beazley
19764 Minor refinement of const static member variable handling
19765 described in CHANGES 08/11/2002. Previously, SWIG merely
19766 checked to see if there was an initializer in the declaration.
19767 Now, SWIG additionally checks to make sure the static member
19768 is const.
19769
1977004/25/2003: ljohnson (Lyle Johnson)
19771 [Ruby] Added a kind of limited support for multiple inheritance,
19772 activated using the -minherit command-line option. I've also updated
19773 the "C++ Inheritance" section of the Ruby documentation to discuss
19774 how this works, and its limitations. Also also modified the minherit.i
19775 test case to run against this.
19776
1977704/25/2003: ljohnson (Lyle Johnson)
19778 [Ruby] Added the -globalmodule command-line option for the Ruby
19779 module, for wrapping stuff into the global module (Kernel) instead
19780 of a nested module. Updated documentation accordingly.
19781
1978204/23/2003: mrose (Mark Rose)
19783 Fixed symname error in director calls to Python methods
19784 that extend C++ operators.
19785
19786 Stopped director destructor wrappers from calling __set_up,
19787 which was leaving the director flag in an inconsistent state.
19788
1978904/23/2003: beazley
19790 Fixed problem with namespace resolution and nested namespaces.
19791 Reported by Alfred Lorber (and Marcelo Matus).
19792
1979304/16/2003: cheetah (William Fulton)
19794 Patch for Java examples and test-suite to run on Mac OS X.
19795
1979604/15/2003: ljohnson (Lyle Johnson)
19797 [Ruby] Incorporated Nobu Nakada's patches for supporting the Ruby
19798 1.8 allocation framework.
19799
1980004/15/2003: ljohnson (Lyle Johnson)
19801 [Ruby] Replaced all uses of the deprecated STR2CSTR() macro with the
19802 safer StringValuePtr() macro. For more information, see ruby-talk:67059
19803 and follow-ups to that post.
19804
1980504/11/2003: beazley
19806 Fixed problem with preprocessor macro expansion. For example:
19807
19808 #define min(x,y) ((x) < (y)) ? (x) : (y)
19809 int f(int min);
19810
19811 Reported by Sebastien Recio.
19812
1981304/10/2003: cheetah (William Fulton)
19814 [Java] Added a runtime check to typemaps in arrays_java.i library to check
19815 that the Java array passed in is the same size as the C array and throw an
19816 exception if not.
19817
19818 Also fix to use delete instead of free for arrays created using new.
19819
1982004/07/2003: cheetah (William Fulton)
19821 Remove GCC3 warning when compiling the examples and test-suite:
19822
19823 cc1plus: warning: changing search order for system directory "/usr/include"
19824 cc1plus: warning: as it has already been specified as a non-system directory
19825
19826 See SF patch #715531 submitted by Gerald Williams
19827
1982804/03/2003: cheetah (William Fulton)
19829 [C#] Improved wrapping of enums and constants. These were previously
19830 wrapped as C# variables rather than constants. Either these are wrapped
19831 as readonly (runtime) constants or compile time constants, depending on
19832 the %javaconst directive (The directive is likely to change name soon).
19833 For example wrapping:
19834 %javaconst(0);
19835 #define ABC 22
19836 %javaconst(1) XYZ;
19837 #define XYZ 33
19838 is now:
19839 public static readonly int ABC = examplePINVOKE.get_ABC();
19840 public const int XYZ = 33;
19841
1984204/03/2003: cheetah (William Fulton)
19843 [Java] Global constants and enums are put in their own interface called
19844 xxxConstants, where xxx is the module name. This is an improvement as
19845 it is possible to derive (implement) a Java class from the xxxConstants
19846 interface to improve the syntax; namely when wrapping:
19847 enum {ONE=1, TWO, THREE};
19848 accessing these from a Java class implementing xxxConstants is neater:
19849 int number = ONE;
19850 than the previous:
19851 int number = xxx.ONE;
19852
19853 Patch submitted by Dave Dribin.
19854
1985504/02/2003: cheetah (William Fulton)
19856 Build improvements for multiple builds. This allows one to build
19857 the SWIG executable and runtime libraries for different platforms/compilers
19858 etc by running configure in different directories. This isn't 100% just
19859 yet and won't be until libtool is better configured... a 'configure' and
19860 'make distclean' needs to be run in the root directory before it all works.
19861 For example:
19862 $ ./configure
19863 $ make distclean
19864 $ mkdir config1; cd config1; ../configure CC=gcc CXX=g++; make; cd ..
19865 $ mkdir config2; cd config2; ../configure CC=cc CXX=c++; make; cd ..
19866
19867 To be improved. A 'make check' does not work yet either.
19868
1986904/01/2003: beazley
19870 Fixed template partial specialization argument expansion bug.
19871 This showed up when trying to use std_vector.i with vectors
19872 of pointers.
19873
1987403/31/2003: cheetah (William Fulton)
19875 Fix for parallel make builds of SWIG, for example
19876 make -j 4
19877 Build failure reported by Bill Clarke.
19878
1987903/28/2003: beazley
19880 Released 1.3.19.
19881
19882
William S Fultona3255742002-10-23 19:08:17 +000019883
Dave Beazley10427702003-03-28 16:12:03 +000019884Version 1.3.19 (March 28, 2003)
19885===============================
Olly Bettsfdcea432009-02-26 05:53:37 +000019886
Dave Beazley10427702003-03-28 16:12:03 +00001988703/28/2003: beazley
19888 Variety of minor bug fixes to the 1.3.18 release including:
19889
19890 - Segmentation fault with %extend directive.
19891 - Typemap variable substitution bug.
19892 - Expression evaluation bug.
19893 - Large memory leak with template expansion.
19894
Dave Beazley95c1e322003-03-23 20:38:05 +000019895Version 1.3.18 (March 23, 2003)
19896===============================
19897
1989803/21/2003: beazley
19899 Fixed two problems with the %extend directive, overloading, and
19900 template expansion. See the 'template_extend_overload' and
19901 'template_extend_overload_2' tests in Examples/test-suite for
19902 details.
19903
1990403/20/2003: cheetah (William Fulton)
19905 [C#] Added some typemaps as suggested by Andreas Schoerk for handling
19906 parameters that are passed as pointers or by reference. These have
19907 been put in typemaps.i.
19908
1990903/20/2003: beazley
19910 Fixed a C++ scoping bug related to code like this:
19911
19912 class Foo {
19913 public:
19914 int Foo::bar();
19915 };
19916
19917 Previously, SWIG just tossed out the Foo::bar() declaration. Now,
19918 the declaration is wrapped provided that the prefix is exactly the
19919 same as the current scope (including any enclosing namespaces).
19920 Reported by Bruce Lowery.
19921
1992203/20/2003: beazley
19923 Incorporated [ 696516 ] Enabling exception processing for data member access.
19924 In some compilers, attribute access can generate exceptions. However,
19925 SWIG ordinarily assumes that no exceptions will be raised. To disable this,
19926 use the %feature("allowexcept"). For example:
19927
19928 %feature("allowexcept") Foo::x;
19929 ...
19930 class Foo {
19931 public:
19932 int x; /* Exception handling enabled */
19933 ...
19934 };
19935
19936 Patch contributed by Yakov Markovitch.
19937
1993803/20/2003: beazley
19939 Incorporated Patch. [ 701860 ] Improve Performance (python proxies).
19940 Gives a performance boost to proxy class code and the management of the
19941 .this and .thisown attributes. Contributed by Mike Romberg.
19942
1994303/19/2003: cheetah (William Fulton)
19944 [C# and Java] Added missing vararg support.
19945
1994603/18/2003: mrose (Mark Rose)
19947 Removed code related to tagging individual methods for directors.
19948 The concept of having directors for some but not all virtual methods
19949 of a class is deeply flawed. The %feature("nodirector") tag is also
19950 gone.
19951
19952 Directors are off by default. To enable them for a class, issue
19953 %feature("director") classname; which will create director methods
19954 for every virtual method in the hierarchy of the class.
19955
1995603/17/2003: beazley
19957 Fixed a subtle problem with passing arguments of type function. For
19958 example:
19959
19960 int foo(int x(int, int));
19961
19962 or
19963
19964 typedef int binop_t(int, int);
19965 int foo(binop_t x);
19966
19967 In old versions, this would produce code that wouldn't compile. Now,
19968 SWIG merely adds an extra pointer, making these declarations the same
19969 as:
19970
19971 int foo(int (*x)(int, int));
19972
19973 typedef int binop_t(int, int);
19974 int foo(binop_t *x);
19975
19976 Reported by Garth Bushell.
19977
1997803/17/2003: mrose (Mark Rose)
19979 Fixed the return statement for director base class calls that have no
19980 return value.
19981
1998203/15/2003: beazley
19983 Fixed a problem with const smart-pointer wrapping. For example:
19984
19985 class Foo {
19986 public:
19987 int x;
19988 void bar() const;
19989 void spam();
19990 };
19991
19992 class Blah {
19993 ...
19994 const Foo *operator->();
19995 ...
19996 };
19997
19998 In this case, only "x" and "bar" are visible from Blah (since application
19999 of spam violates constness). Moreover, access to "x" is read-only.
20000
2000103/15/2003: mrose (Mark Rose)
20002 Cleaned up two signed versus unsigned comparisons in python/std_vector.i.
20003
2000403/15/2003: cheetah (William Fulton)
20005 [C#] Global variables are wrapped using properties instead of get and set methods.
20006 Member variable wrapping bug fixes, for example wrapping pointers work now.
20007 Typemaps are used for all variable wrapping to generate the property code.
20008
2000903/13/2003: mrose (Mark Rose)
20010 Fixed a bug in the virtual method unrolling for directors.
20011 The order of unrolling is now from base to derived, to ensure
20012 that the most derived implementation of a director method is
20013 found.
20014
20015 Director methods for pure virtual methods now throw
20016 DIRECTOR_PURE_VIRTUAL_EXCEPTION if _up is set.
20017
2001803/12/2003: cheetah (William Fulton)
20019 [C#] Polymorphism fix: virtual functions now use the appropriate
20020 keyword in the C# proxy class, virtual or override.
20021 Some 'using System;' statement fixes needed by the Mono compiler.
20022
2002303/11/2003: beazley
20024 Fixed subtle bug in the application of SwigValueWrapper<> to
20025 template classes with default constructors. Reported by
20026 Bruce Lowery.
20027
2002803/11/2003: beazley
20029 The $descriptor(type) variable is now expanded in code supplied to
20030 %extend. This is useful for certain kinds of advanced wrapping
20031 (especially container classes).
20032
2003303/11/2003: luigi
20034 Support for std::map.
20035 (a) Integration with scripting language (a la std::vector) for
20036 Python, Ruby, MzScheme, and Guile;
20037 (b) Simple wrapper for other languages
20038
2003903/10/2003: beazley
20040 Fixed problem with escape sequences in string and character constants. SWIG
20041 wasn't parsing certain octal codes correctly.
20042
2004303/07/2003: beazley
20044 Fixed a variety of subtle preprocessor problems reported by
20045 Sebastien Recio.
20046
20047 (a) Empty preprocessor values no longer generate "bad constant
20048 value" errors. For example:
20049
20050 #define FOO
20051 #define FOO BAR
20052
20053 (b) Macro names can now span multiple lines (technically valid,
20054 although questionable practice). For example:
20055
20056 #define A_LONG_MACRO_\
20057 NAME 42
20058
20059 (c) Whitespace is no longer required before certain macro values.
20060 For example:
20061
20062 #define FOO"Hello"
20063 #define BAR\
20064 "Hello"
20065
2006603/07/2003: ljohnson (Lyle Johnson)
20067 [Ruby] Added missing long long and unsigned long long typemaps
20068 in the Lib/ruby/typemaps.i library file.
20069
2007003/07/2003: mrose (Mark Rose)
20071 Added Examples/python/callback to demostrate how directors can
20072 be used to implement callbacks in Python
20073 Added Examples/python/extend to demonstrate virtual method
20074 calls from C++ to Python (really the same as the callback
20075 example, just a different context).
20076 Added four tests for very basic director functionality. These
20077 have runtime tests under python.
20078 The Python module now emits #define SWIG_DIRECTORS near the
20079 top of the output file if directors are enabled. This is useful
20080 for disabling parts of tests in target languages that don't
20081 support directors.
20082
2008303/06/2003: mrose (Mark Rose)
20084 Added a section to Doc/Manual/Python.html on cross language
20085 polymorphism (directors).
20086
2008703/06/2003: mrose (Mark Rose)
20088 The short-lived "-fdirectors" command line option has been
20089 removed. To enable directors, instead use the extended %module
20090 directive as follows:
20091
20092 %module(directors="1") modulename
20093
2009403/06/2003: cheetah (William Fulton)
20095 The long long typemaps have been rewritten so that they can be more
20096 easily used with non ISO compilers, like Visual C++. For example
20097 if you are wrapping the Windows 64 bit type __int64 the long long
20098 typemaps can be used with %apply:
20099
20100 %apply long long { __int64 };
20101 __int64 value1(__int64 x);
20102
20103 __int64 will now appear in the generated code instead of long long.
20104
2010503/06/2003: beazley
20106 *** DEVELOPER CHANGE ***
20107 Swig module mutation has been changed slightly. When a language
20108 class method wants to save node attributes, it now uses one of the
20109 following functions:
20110
20111 Swig_require()
20112 Swig_save()
20113
20114 The first argument to these functions is a namespace in which
20115 saved attributes are placed. For example,this code
20116
20117 Node *n;
20118 Swig_save("cDeclaration",n,"type","parms","name",NIL);
20119
20120 saves the attributes as "cDeclaration:type", "cDeclaration:parms",
20121 and so forth. If necessary, a language module can refer to
20122 old values by using this special namespace qualifier.
20123
20124 In addition to this, a special attribute "view" contains the name
20125 of the last namespace used to save attributes. In the above
20126 example, "view" would have the value "cDeclaration". The value
20127 of "cDeclaration:view" would have the previous view and so forth.
20128
20129 Swig_restore(n) restores a node to the state before the last
20130 Swig_require() or Swig_save() call.
20131
20132 Note: This change makes it easier for language modules to refer
20133 to old values of attributes.
20134
20135
2013603/06/2003: mrose (Mark Rose)
20137 Merged the cross-language polymorphism patch. When enabled, C++
20138 "proxy" classes (called directors) are generated for each specified
20139 C++ class. Directors pass method calls from C++ to Python, similar
20140 to the way the usual proxy (shadow) classes pass method calls from
20141 Python to C++. Together, these two types of proxies allow C++
20142 classes that are extended in Python to behave just like ordinary
20143 C++ classes and be used in C++ like native objects.
20144
20145 This feature is still very experimental and is disabled by default.
20146 To enable director support, specify '-fdirectors' on the SWIG command
20147 line or in the SWIG_FEATURES environment variable. In the interface
20148 file, add %feature("director") to generate directors for all classes
20149 that have virtual methods.
20150
20151 See http://stm.lbl.gov/~tm2/swig/ProxyDoc.html for more details.
20152
20153
2015403/03/2003: beazley
20155 Fixed a small glitch in typemap local variable replacement. If you had
20156 a typemap like this:
20157
20158 %typemap(in) type ($1_type temp) {
20159 ...
20160 temp = ...;
20161 ...
20162 }
20163
20164 and no occurrence of "$1_type" appeared in the body, then the local
20165 variable type wouldn't be substituted.
20166
2016703/03/2003: cheetah (William Fulton)
20168 [C#] New version of the CSharp module which is typemap based.
20169 It also uses ECMA C# and no longer uses Microsoft Visual C++.NET
20170 glue. This means that it will work on non-Windows platforms.
20171 Contributed by Neil Cawse.
20172
2017302/27/2003: beazley
20174 Fixed [ 653548 ] error parsing casting operator definition.
20175 SWIG now ignores casting operators declared outside of a class.
20176 For example:
20177
20178 inline A::operator char *() { ... }
20179
20180 Bug reported by Martin Casado.
20181
2018202/27/2003: beazley
20183 Added support for anonymous bit-fields. For example:
20184
20185 struct Foo {
20186 int x : 4;
20187 int : 4;
20188 int y : 8;
20189 };
20190
20191 Anonymous bit-fields are ignored by SWIG. Problem
20192 reported by Franz Höpfinger.
20193
2019402/26/2003: cheetah (William Fulton)
20195 [Java] Better typemaps in the Examples/java/typemap example and also
20196 fixes subtle bug when using the StringBuffer typemaps more than once.
20197
2019802/26/2003: beazley
20199 Fixed [ 642112 ] Constants char bug.
20200
2020102/26/2003: beazley
20202 Fixed [ 675337 ] Partial template specialization not entirely working.
20203 There was a subtle problem related to the naming and ordering of
20204 template partial specialization arguments. Matching worked okay,
20205 the resulting templates weren't expanded correctly.
20206
2020702/25/2003: beazley
20208 Fixed problem with parsing (and generating code) for
20209 references to arrays. For example:
20210
20211 int foo(int (&x)[10]);
20212
2021302/25/2003: beazley
20214 Fixed [ 635347 ] Compilation warning from libpy.c.
20215 Reported by Daniel L. Rall.
20216
2021702/25/2003: beazley
20218 Fixed a subtle problem with virtual method implementation
20219 checking and typedef.
20220
20221 typedef int *intptr;
20222
20223 struct A {
20224 virtual int *foo() = 0;
20225 };
20226 struct B : public A {
20227 virtual intptr foo() { };
20228 };
20229
20230 SWIG was treating these declarations as different even though
20231 they are the same (via typedef).
20232
2023302/25/2003: ljohnson (Lyle Johnson)
20234 [Ruby] Added range checking for the NUM2USHRT macro, per [ 675353 ].
20235
2023602/24/2003: beazley
20237 Fixed a subtle problem with the code that determined if a class is abstract
20238 and can be instantiated. If you had classes like this:
20239
20240 struct A {
20241 virtual int foo(int) = 0;
20242 };
20243 struct B : virtual A {
20244 virtual int foo(int);
20245 };
20246
20247 struct C : virtual A {
20248 };
20249
20250 /* Note order of base classes */
20251 struct D : B, C { }; /* Ok */
20252 struct E : C, B { }; /* Broken */
20253
20254 then SWIG determined that it could instantiate D(), but not E().
20255 This inconsistency arose from the depth-first search of the
20256 inheritance hierarchy to locate the implementations of virtual
20257 methods. This problem should now be fixed---SWIG will attempt
20258 to locate any valid implementation of a virtual method by
20259 traversing over the entire hierarchy.
20260
2026102/22/2003: cheetah (William Fulton)
20262 [Java] Fix for using enum typemaps. The Java final static variable type
20263 can be set using the jstype typemap, enabling enums to be mapped to
20264 something other than int. Bug reported by Heiner Petith.
20265
2026602/21/2003: songyanf (Tiger)
20267 Added CSharp (C#) module prototype
20268 i.e. csharp.cxx & csharp.h at Source/Modules/.
20269 They are for test usage only now and need improvement.
20270 The interface also need to be modified.
20271
20272 *** NEW FEATURE ***
20273
2027402/20/2003: songyanf (Tiger)
20275 Fixed problem with typedef with -fvirtual.
20276 Similar as beazley's modification today.
20277
2027802/20/2003: beazley
20279 Added support for gcc-style variadic preprocessor macros.
20280 Patch [ 623258 ] GCC-style vararg macro support.
20281 Contributed by Joe Mason.
20282
2028302/20/2003: beazley
20284 Fixed [ 605162 ] Typemap local variables.
20285 Reported by Lyle Johnson.
20286
2028702/20/2003: beazley
20288 Fixed problem with abstract classes and typedef. For example:
20289
20290 class Foo {
20291 public:
20292 virtual void foo(int x) = 0;
20293 };
20294
20295 typedef int Integer;
20296 class Bar : public Foo {
20297 public:
20298 virtual void foo(Integer x);
20299 };
20300
20301 SWIG was getting confused about the latter method---making Bar
20302 abstract. Reported by Marcelo Matus.
20303
2030402/19/2003: cheetah (William Fulton)
20305 [Java] %javaconst(flag) can also be used on enums as well as constants.
20306 This feature enables true Java compiler constants so that they can be
20307 used in Java switch statements. Thanks to Heiner Petith for patches.
20308
2030902/19/2003: songyanf (Tiger)
20310 Modified -fcompact feature to deal with PP lines
20311
2031202/18/2003: beazley
20313 Fixed [ 689040 ] Missing return value in std_vector.i.
20314 Reported by Robert H. de Vries.
20315
2031602/18/2003: beazley
20317 Fixed a few evil scoping problems with templates, namespaces, and the
20318 %extend directive. Problem reported by Luigi Ballabio.
20319
20320
2032102/18/2003: cheetah (William Fulton)
20322 [Ruby] Improved support for Visual C++ and other native Windows compilers.
20323 It is no longer necessary to specify "/EXPORT:Init_<module>", where <module> is the
20324 swig module name when linking using these native Windows compilers.
20325
2032602/15/2003: songyanf (Tiger)
20327 Added -fvirtual option.
20328 Reduce the lines and size of the wrapper file
20329 by omitting redifined virtual function in children classes.
20330
20331 Modified -compact option to -fcompact option
20332
20333 Added -small option.
20334 -small = -fvirtual -fcompact
20335 And it can be extended by future feature options,
20336 which are used to reduce wrapper file szie.
20337
20338 Added SWIG_FEATURES environment variable check.
20339 To dynamically set the feature options such as -fcompact & -fvirtual
20340 *** NEW FEATURE ***
20341
2034202/13/2003: lenz
20343 Updated Doc/Manual/Perl5.html to talk about C++ compile problems
20344 configure.in now checks for PERL5_CCFLAGS
20345 Runtime/Makefile.in and Example/Makefile.in now use PERL5_CCFLAGS
20346 Added Lib/perl5/noembed.h which contains all the known macro conflicts
20347
2034802/12/2003: beazley
20349 Fixed [ 685410 ] C++ Explicit template instantiation causes SWIG to exit.
20350 Fixes a syntax error with declarations similar to this:
20351
20352 template class std::vector<int>;
20353
20354 SWIG now ignores the instantiation and generates a warning message.
20355 We might do more later. Reported by Thomas Williamson.
20356
2035702/11/2003: cheetah (William Fulton)
20358 Rewrote bool typemaps to remove performance warning for compiling generated code
20359 under Visual C++.
20360
2036102/11/2003: cheetah (William Fulton)
20362 Fix for wrapping reference variables (const non-primitive and all non-const types)
20363 for example:
20364 int& i;
20365 Class& c;
20366 const Class& c;
20367
2036802/11/2003: beazley
20369 Fixed more very subtle preprocessor corner cases related to recursive
20370 macro expansion. For example:
20371
20372 #define cat(x,y) x ## y
20373
20374 cat(cat(1,2),3) // Produces: cat(1,2)3
20375
20376 #define xcat(x,y) cat(x,y)
20377
20378 xcat(xcat(1,2),3) // Produces 123
20379
20380 See K&R, 2nd Ed. p. 231.
20381
2038202/10/2003: cheetah (William Fulton)
20383 Fixed [ 683882 ] - patch submitted by F. Postma for SWIG to compile on HP-UX.
20384
2038502/10/2003: beazley
20386 Fixed subtle preprocessor argument expansion bug. Reported by Marcelo Matus.
20387
2038802/10/2003: songyanf
20389 Added -compact option.
20390 Reduce the lines and size of the wrapper file
20391 by omitting comments and combining short lines.
20392 *** NEW FEATURE ***
20393
2039402/07/2003: beazley
20395 Fixed [ 651355 ] Syntax error with cstring.i
20396 Reported by Omri Barel.
20397
2039802/07/2003: beazley
20399 Fixed [ 663632 ] incompatibility with standard cpp.
20400 This is a refinement that fixes this problem:
20401
20402 // Some macro with an argument
20403 #define FOO(x) x
20404
20405 int FOO; /* Not a macro---no arguments */
20406
2040702/05/2003: beazley
20408 Fixed [ 675491 ] parse error with global namespace qualification.
20409 Submitted by Jeremy Yallop.
20410
2041102/04/2003: beazley
20412 Fixed bug in varargs processing introduced by the numinputs typemap parameter.
20413
2041401/08/2003: ttn
20415 [xml] Fix string-replacement ordering buglet.
20416 Thanks to Gary Herron.
20417
2041812/23/2002: cheetah (William Fulton)
20419 Further build changes:
20420 - The SWIG executable is now built using a single Makefile.
20421 - This makefile is generated by Automake (Source/Makefile.am).
20422 - Dependency tracking and tags support are in this makefile.
20423 - Automake 1.7.2 and Autoconf 2.54 minimum versions are needed to build SWIG from CVS.
20424 - Running ./autogen.sh now installs Autoconf/Automake support files into
20425 Tools/config and these files are no longer stored in CVS.
20426 - Bug fixes in 'make install' for systems using .exe executable extension and
20427 ./configure --with-release-suffix=whatever
20428
2042912/16/2002: cheetah (William Fulton)
20430 More build changes:
20431 - Autoconf's AC_CANONICAL_HOST replaces proprietary approach for detecting build host.
20432 - Autoconf support files moved to Tools/config.
20433
2043412/16/2002: cheetah (William Fulton)
20435 Modifications to run on MacOS, submitted by Bernard Desgraupes.
20436 Mainly ensuring generated files are output in the appropriate directory for
20437 some modules.
20438
2043912/11/2002: cheetah (William Fulton)
20440 Various build modifications and bug fixes:
20441 - Simplification of version string. Use autoconf's PACKAGE_VERSION instead.
20442 - Build time removed from SWIG version.
20443 - Using standard autoconf config header generation.
20444 - Updated old autoconf macros as reported by autoupdate.
20445 - Removed $prefix in autoconf from search paths as autoconf won't expand them.
20446 - Subtle bug fix where 'make prefix=/somewhere; make clean; make prefix=/somwhere/else'
20447 produced an executable using the incorrect library directories.
20448 - Added -ldflags commandline option for MzScheme, Ocaml, Pike and PHP.
20449 - Fixed reporting of compiler used when using -version commandline option.
20450 - SWIG web address added to -version commandline option.
20451
2045212/11/2002: beazley
20453 Minor fix to Tcl dynamic cast typemaps. Reported by
20454 Kristopher Blom.
20455
2045612/10/2002: beazley
20457 Fixed subtle template argument replace bug. Reported by
20458 Chris Flatley.
20459
2046012/10/2002: beazley
20461 Reverted CHANGES 09/03/2002, preprocessor argument evaluation. Arguments
20462 are not evaluated during collection, K&R, p. 230.
20463
2046412/06/2002: beazley
20465 Fixed [ 649022 ] Compilation problems with KAI/KCC
20466
2046712/02/2002: beazley
20468 SWIG 'rel-1-3' CVS branch merged back into the main branch.
20469
20470
Dave Beazley5de5df32002-12-03 19:23:40 +000020471Version 1.3.17 (November 22, 2002)
20472==================================
Olly Bettsfdcea432009-02-26 05:53:37 +000020473
Dave Beazley5de5df32002-12-03 19:23:40 +00002047411/19/2002: beazley
20475 Fixed [ 613922 ] preprocessor errors with HAVE_LONG_LONG.
20476
2047711/19/2002: beazley
20478 Fixed [ 615480 ] mzscheme SWIG_MustGetPtr_.
20479
2048011/19/2002: beazley
20481 Fixed [ 635119 ] SWIG_croak causes compiler warning.
20482
2048311/16/2002: cheetah (William Fulton)
20484 [Java] Added typemaps for pointers to class members.
20485
2048611/15/2002: cheetah (William Fulton)
20487 [Java] Bug fix: Overloaded C++ functions which cannot be overloaded in Java
20488 once again issue a warning.
20489
2049011/14/2002: cheetah (William Fulton)
20491 [Java] Handling of NULL pointers is improved. A java null object will now
20492 be translated to and from a NULL C/C++ pointer by default. Previously when
20493 wrapping:
20494
20495 class SomeClass {...};
20496 void foo(SomeClass *s);
20497
20498 and it was called from Java with null:
20499
20500 modulename.foo(null)
20501
20502 a Java NullPointerException was thrown. Extra typemaps had to be written in
20503 order to obtain a NULL pointer to pass to functions like this one. Now the
20504 default wrapping will detect 'null' and translate it into a NULL pointer.
20505 Also if a function returns a NULL pointer, eg:
20506
20507 SomeClass *bar() { return NULL; }
20508
20509 Then this used to be wrapped with a SomeClass proxy class holding a NULL
20510 pointer. Now null is returned instead. These changes are subtle but useful.
20511 The original behaviour can be obtained by using the original typemaps:
20512
20513 %typemap(javaout) SWIGTYPE {
20514 return new $&javaclassname($jnicall, true);
20515 }
20516 %typemap(javaout) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
20517 return new $javaclassname($jnicall, $owner);
20518 }
20519 %typemap(javagetcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] %{
20520 protected static long getCPtr($javaclassname obj) {
20521 return obj.swigCPtr;
20522 }
20523 %}
20524
20525 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
20526
20527
2052811/12/2002: beazley
20529 Fixed problem with abstract methods and signatures. For example:
20530
20531 class abstract_foo {
20532 public:
20533 virtual int meth(int meth_param) = 0;
20534 };
20535
20536
20537 class abstract_bar : public abstract_foo {
20538 public:
20539 int meth(int meth_param_1, int meth_param_2) { return 0; }
20540 };
20541
20542 In this case, abstract_bar is still abstract.
20543
20544 Fixes [ 628438 ] Derived abstract class not abstract.
20545 Reported and patched by Scott Michel.
20546
2054711/11/2002: beazley
20548 Fixed a matching problem with typemaps and array dimensions. For example, if you
20549 had this:
20550
20551 typedef char blah[20];
20552
20553 and a typemap:
20554
20555 %typemap() char [ANY] {
20556 ... $1_dim0 ...
20557 }
20558
20559 then $1_dim* variables weren't be expanded properly. It should work now.
20560 Problem reported by Pankaj Kumar Goel.
20561
2056211/07/2002: mkoeppe
20563 Added an experimental new module that dumps SWIG's parse
20564 tree as (Common) Lisp s-expressions. The module is
20565 invoked with SWIG's -sexp command-line switch. The output
20566 can be read into Common Lisp. There is (prototype)
20567 example Lisp code that generates Foreign Function Interface
20568 definitions for use with Kevin Rosenberg's UFFI.
20569
20570 *** EXPERIMENTAL NEW FEATURE ***
20571
2057211/07/2002: mkoeppe
20573 Removed duplicate declaration of "cpp_template_decl" in
20574 parser.y; bison 1.75 complained.
20575
2057611/06/2002: cheetah (William Fulton)
20577 [Java] Default primitive array handling has changed like arrays of classes.
20578 C primitive arrays are no longer wrapped by a Java array but with a pointer
20579 (type wrapper class). Again the changes have been made for efficiency reasons.
20580 The original typemaps have been moved into arrays_java.i, so the original
20581 behaviour can be obtained merely including this file:
20582
20583 %include "arrays_java.i"
20584
20585 The array support functions are no longer generated by default. They are only
20586 generated when including this file, thus this often unused code is only
20587 generated when specifically requiring this type of array support.
20588
20589 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
20590
2059111/05/2002: ljohnson (Lyle Johnson)
20592 [Ruby] Added support for nested module declarations (as was
20593 previously added for the Perl module). So a %module directive
20594 of the form:
20595
20596 %module "Outer::Inner::Foo"
20597
20598 will nest everything as (in Ruby code):
20599
20600 module Outer
20601 module Inner
20602 module Foo
20603 # stuff goes here
20604 end
20605 end
20606 end
20607
2060811/05/2002: mkoeppe
20609 [MzScheme] Add an argument (-declaremodule) that generates
20610 code to correctly declare a primitive module extension.
20611 Patch submitted by Bruce Butterfield.
20612
2061311/02/2002: cheetah (William Fulton)
20614 [Java] Added patch submitted by Michael Cahill to remove unused parameter
20615 warnings for the jenv and cls parameters. This patch also also allows one
20616 to use "void" in the jni typemap for any type without code being generated
20617 attempting to return a value.
20618
2061910/29/2002: cheetah (William Fulton)
20620 [Java] Array handling is different. Arrays of classes are no longer wrapped
20621 with proxy arrays, eg wrapping
20622
20623 class X {...};
20624 X foo[10];
20625
20626 used to be wrapped with these Java getters and setters:
20627
20628 public static void setFoo(X[] value) {...}
20629 public static X[] getFoo() {...}
20630
20631 This approach is very inefficient as the entire array is copied numerous
20632 times on each invocation of the getter or setter. These arrays are now
20633 wrapped with a pointer so it is only possible to access the first array element
20634 using a proxy class:
20635
20636 public static void setFoo(X value) {...}
20637 public static X getFoo() {...}
20638
20639 Arrays of enums have also been similarly changed. This behaviour is now like the
20640 other SWIG language's implementation and the array library should be used to
20641 access the other elements. The original behaviour can be achieved using the
20642 macros and typemaps in arrays_java.i, for example:
20643
20644 %include "arrays_java.i"
20645 JAVA_ARRAYSOFCLASSES(X)
20646 class X {...};
20647 X foo[10];
20648
20649 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
20650
2065110/29/2002: cheetah (William Fulton)
20652 [Java] Two new typemaps javain and javaout for generating the proxy class
20653 and type wrapper class method calls to the JNI class. The new typemaps are
20654 really used for transforming the jstype (used in proxy class and type wrapper
20655 classes) to the jtype (used in the JNI class) and visa versa. A javain typemap
20656 is required whenever an in typemap is written and similarly javaout for an out
20657 typemap. An example is probably best to show them working:
20658
20659 %typemap(javain) Class "Class.getCPtr($javainput)"
20660 %typemap(javain) unsigned short "$javainput"
20661 %typemap(javaout) Class * {
20662 return new Class($jnicall, $owner);
20663 }
20664
20665 %inline %{
20666 class Class {};
20667 Class * bar(Class cls, unsigned short ush) { return new Class(); };
20668 %}
20669
20670 The generated proxy code is then:
20671
20672 public static Class bar(Class cls, int ush) {
20673 return new Class(exampleJNI.bar(Class.getCPtr(cls), ush), false);
20674 }
20675
20676
20677 Some new special variables have been introduced in order to use these typemaps.
20678 Here $javainput has been replaced by 'cls' and 'ush'. $jnicall has been replaced by
20679 the native method call, 'exampleJNI.bar(...)' and $owner has been replaced by 'false'.
20680 $javainput is analogous to the $input special variable. It is replaced by the parameter name.
20681 $jnicall is analogous to $action in %exception. It is replaced by the call to the native
20682 method in the JNI class.
20683 $owner is replaced by either true if %newobject has been used otherwise false.
20684
20685 The java.swg file contains default javain and javout typemaps which will produce the same code
20686 as previously. This change is only of concern to those who have written their own typemaps as
20687 you will then most likely have to write your own javain and javaout typemaps.
20688
20689 The javaout typemap also makes it possible to use a Java downcast to be used on abstract
20690 proxy base classes. See the Java documentation on dynamic_cast.
20691
20692 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
20693
2069410/24/2002: ttn
20695 [Methodology] Upgaded to libtool 1.4.3, presumably w/ better
20696 support for newish platforms (like MacOS X).
20697
2069810/21/2002: ttn
20699 Fixed Runtime/Makefile.in bug -- thanks to Richard Calmbach.
20700
2070110/18/2002: ttn
20702 Fixed typo in doh.h -- thanks to Max Horn.
20703
William S Fultona3255742002-10-23 19:08:17 +000020704Version 1.3.16 (October 14, 2002)
20705=================================
20706
2070710/13/2002: beazley
20708 Fixed bug with %extend directive and %feature reported
20709 by William Fulton.
20710
2071110/13/2002: beazley
20712 Added OpenVMS build directory (vms). Contributed by
20713 Jean-François Pieronne.
20714
2071510/09/2002: cheetah (William Fulton)
20716 [Java] Added throws clause to the native functions in the JNI class.
20717 The throws clause is the same as the one generated for proxy functions
20718 and module class functions.
20719
2072009/27/2002: beazley
20721 Fixed some problems with the %import directive and classes that
20722 were defined but not wrapped. Problem reported by Leslie Brooks,
20723 Gerry Woods, and others.
20724
2072509/23/2002: cheetah (William Fulton)
20726 [Java] Some error checking added:
20727 1) OutOfMemoryException check in the char * typemaps.
20728 2) As SWIG treats pointers, references and passing by value all the
20729 same, it is possible to pass a NULL pointer to a function that expects
20730 an object passed by value or by reference. A NullPointerException is
20731 now thrown under this scenario.
20732
2073309/20/2002: ttn
20734 [Methodology] Reworked "make clean" and "make install"
20735 to be more table driven.
20736 [Docs] Explain how to extend "make install" w/ extra-install.list.
20737
2073809/15/2002: beazley
20739 Deprecation of the "ignore" typemap. The "ignore" typemap has
20740 been deprecated in favor of a generalization of the "in" typemap.
20741 To ignore an argument, use something like this instead:
20742
20743 %typemap(in,numinputs=0) int *output (int temp) {
20744 $1 = &temp;
20745 }
20746
20747 This change fixes a number of subtle bugs related to the interaction
20748 of the "in" and "ignore" typemaps (which were supposed to be
20749 mutually exclusive).
20750
20751 The use of the numinputs argument is reserved for future expansion.
20752 Currently, values >1 will generate an error. However, future
20753 releases of SWIG may utilize that to support multi-input typemaps.
20754
20755 %typemap(ignore) still works, but generates a warning message and is
20756 translated to %typemap(in,numinputs=0).
20757
20758 *** POTENTIAL INCOMPATIBILITY ***
20759 *** NEW FEATURE ***
20760
2076109/15/2002: beazley
20762 Fixed segmentation fault for unnamed structures. For example:
20763
20764 typedef struct {
20765 } *blah;
20766
20767
20768 Reported by Roger Gibson.
20769 Note: we might be able to generate wrappers in special cases.
20770
2077109/13/2002: beazley
20772 Minor modification to generated wrapper functions. Pointer arguments are now
20773 always set to an initial value of 0. Simplifies typemap writing and cleanup
20774 code (since you can rely on zero-value initialization). This also greatly
20775 reduces the need to ever write an "arginit" typemap.
20776
2077709/12/2002: beazley
20778 Minor enhancement to smart-pointer support. If operator->()
20779 is part of an ignored base class like this,
20780
20781 %ignore Bar;
20782
20783 class Foo {
20784 public:
20785 int blah();
20786 };
20787
20788 class Bar { /* Ignored */
20789 public:
20790 ...
20791 Foo *operator->();
20792 ...
20793 };
20794
20795 class Spam : public Bar { };
20796
20797 then methods from Foo are still available. For example,
20798
20799 >>> s = Spam()
20800 >>> s.blah()
20801 0
20802 >>>
20803
20804 The only catch is that the operator->() itself is not available
20805 (since it wasn't wrapped). Therefore, there won't be any
20806 __deref__() operation unless it is explicitly added to Spam
20807 (either using %extend or just placing operator->() in the
20808 definition of Spam).
20809
2081009/11/2002: ttn
20811 [Methodology] Reworked "make check" to be more table driven.
20812 [Docs] Docuemented methodology in Manual/Extending.html.
20813
2081409/11/2002: ttn
20815 [Docs] Prefixed Manual/*.html with "<!DOCTYPE html ...>" to
20816 pander dotingly to (over-)sensitive editors.
20817
2081809/10/2002: ttn
20819 [Guile] Converted Examples/guile/simple "make check"
20820 behavior to actually check execution results. Reduced
20821 iteration counts so that the test doesn't take too long.
20822
2082309/10/2002: beazley
20824 SWIG-1.3.15 released.
20825
20826
20827Version 1.3.15 (September 9, 2002)
20828==================================
Olly Bettsfdcea432009-02-26 05:53:37 +000020829
William S Fultona3255742002-10-23 19:08:17 +00002083009/09/2002: beazley
20831 Fixed nasty runtime type checking bug with subtypes and inheritance
20832 and templates.
20833
2083409/09/2002: cheetah (William Fulton)
20835 [Java] Java exception classes for a method's throws clause can be generated by
20836 specifying them in a comma separated list in the throws attribute in any one
20837 of the following typemaps: in, out, check, freearg, argout and throws. A classic
20838 example would be to convert C++ exceptions into a standard Java exception:
20839
20840 %typemap(throws, throws="java.io.IOException") file_exception {
20841 jclass excep = jenv->FindClass("java/io/IOException");
20842 if (excep)
William S Fulton6b5b4022004-07-04 07:13:16 +000020843 jenv->ThrowNew(excep, $1.what());
William S Fultona3255742002-10-23 19:08:17 +000020844 return $null; // or use SWIG_fail
20845 }
20846
20847 class file_exception {...};
20848 void open(const char *filename) throw(file_exception);
20849
20850 The Java method will then be declared with a throws clause:
20851
20852 public static void open(String filename) throws java.io.IOException {...}
20853
2085409/08/2002: mkoeppe
20855 * [Guile] Improved the documentation system. The arglist no
20856 longer gets cluttered with type specification, making it
20857 more readable. (Also the ILISP function C-u M-x
20858 `arglist-lisp' RET works better this way.) The types of
20859 arguments are explained in an extra sentence after the
20860 arglist.
20861
20862 There are now two documentation-related typemap arguments:
20863
20864 %typemap(in, doc="$NAME is a vector of integers",
20865 arglist="$name") int *VECTOR { ... }
20866
20867 The "arglist" texts of all arguments of a function make up
20868 its arglist in the documentation. The "doc" texts of all
20869 arguments are collected to make a sentence that describes
20870 the types of the arguments. Reasonable defaults are
20871 provided.
20872
20873 As usual, $name is substituted by the name of the
20874 argument. The new typemap variable $NAME is like $name,
20875 but marked-up as a variable. This means that it is
20876 upper-cased; in TeXinfo mode ("-procdocformat texinfo") it
20877 comes out as @var{name}.
20878
20879 The directives %values_as_list, %values_as_vector,
20880 %multiple_values now also have an effect on the
20881 documentation. (This is achieved via the new pragmas
20882 return_nothing_doc, return_one_doc, return_multi_doc.)
20883
20884 Documentation has also improved for variables that are
20885 wrapped as procedures-with-setters (command-line switch
20886 "-emit-setters").
20887
20888 * [Guile] Emit constants as _immutable_ variables. (This
20889 was broken recently.)
20890
2089109/07/2002: mkoeppe
20892 [Guile] Updated the typemaps in list-vector.i.
20893
2089409/07/2002: mkoeppe
20895 Short-circuit the typechecks for overloaded functions.
20896 (The changes in code generation are visible in the new
20897 testcase "overload_complicated".)
20898
2089909/06/2002: cheetah (William Fulton)
20900 [Java] Solution for [ 596413 ]
20901 New typemap so that the Java proxy classes and type wrapper classes
20902 wrapper constructor modifier can be tailored by users. The default value is
20903 protected. Normally SWIG generates a constructor like this which can only
20904 be accessed within one package:
20905
20906 protected Bar(long cPtr, boolean cMemoryOwn) {
20907 ...
20908 }
20909
20910 If you are using SWIG across multiple packages or want to use this constructor
20911 anyway, it can now be accessed outside the package. To modify use for example:
20912
20913 %typemap(javaptrconstructormodifiers) SWIGTYPE "public"
20914
20915 to change to public for all proxy classes and similarly for all type wrapper classes:
20916
20917 %typemap(javaptrconstructormodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "public"
20918
2091909/06/2002: cheetah (William Fulton)
20920 [Java] Added throws typemaps for the Java module. C++ exceptions get converted into
20921 java.lang.RuntimeException Java exceptions.
20922
20923 Warning: This may change from java.lang.Runtime exception in the future.
20924
2092509/05/2002: cheetah (William Fulton)
20926 [Java] Fix for variables declared as references.
20927
2092809/05/2002: beazley
20929 Fixed [ 605162 ] Typemap local variables. Reported by Lyle Johnson.
20930
2093109/05/2002: ljohnson (Lyle Johnson)
20932 [Ruby] More updates to the Ruby module documentation, including
20933 a new typemap example that demonstrates how to collect key-value
20934 pairs from an argument list into a Hash.
20935
2093609/05/2002: beazley
20937 Fixed bug with template expansion and constructors.
20938
20939 template<class T> class Foo {
20940 public:
20941 Foo<T>() { }
20942 };
20943
20944 The extra <T> in the constructor was carried through in the
20945 name--causing runtime problems in generated modules.
20946 Reported by Jordi Arnabat Benedicto.
20947
2094809/05/2002: mkoeppe
20949 [Guile] Support overloading.
20950
2095109/04/2002: ljohnson (Lyle Johnson)
20952 [Ruby] Updated typemaps for long long and unsigned long long types
20953 to use Ruby 1.7 support for these types when available.
20954
2095509/04/2002: ljohnson (Lyle Johnson)
20956 [Ruby] Added output typemaps for const reference to primitive
20957 types.
20958
2095909/04/2002: mkoeppe
20960 [Guile] Fix pass-by-value typemaps. Reported by Arno
20961 Peters via Debian bugtracking (#156902), patch by Torsten
20962 Landschoff <[email protected]>.
20963
2096409/03/2002: samjam (Sam Liddicott)
20965 Better reference support.
20966 Functions that want a void** can take a NULL by reference and
20967 the void* will be made for you and then passed-by-reference
20968
20969 Also all integer-class native types can be passed by reference
20970 where an int* or int& etc is needed
20971
2097209/03/2002: beazley
20973 Changed the evaluation order of preprocessor macro arguments.
20974 Arguments are now expanded by the preprocessor *before* they
20975 are passed to macro expansion. This fixes a subtle expansion
20976 bug reported by Anthony Heading.
20977
2097809/03/2002: beazley
20979 Fixed the file include order (again, apparently). See 2/27/99.
20980
2098109/02/2002: beazley
20982 [Perl] Better exception handling support. Since Perl error handling
20983 relies on setjmp/longjmp, wrapper functions have been modified slightly
20984 to provide an extra block scope:
20985
20986 XS(foo) {
20987 char _swigmsg[SWIG_MAX_ERRMSG] = "";
20988 const char *_swigerr = _swigmsg;
20989 {
20990 /* Normal wrapper function here */
20991 ...
20992 SWIG_croak("An error occurred\n");
20993 ...
20994 XSRETURN(argvi); /* Successful return */
20995 fail:
20996 /* cleanup code */
20997 }
20998 croak(_swig_err);
20999 }
21000
21001 The macro SWIG_croak(x) sets the value of _swigerr to x and
21002 executes a "goto fail". The whole wrapper function is enclosed
21003 block scope to provide proper cleanup of C++ objects. Since
21004 croak executes a longjmp(), there is no way to properly reclaim
21005 resources if this executes in the same scope as the wrapper
21006 function.
21007
21008 The _swigmsg[] variable is normally unused, but can be used
21009 to store small error messages using sprintf or snprintf. It
21010 has a capacity of at least 256 bytes (SWIG_MAX_ERRMSG).
21011
2101209/02/2002: beazley
21013 [Tcl] Added better support for exceptions. Instead of returning TCL_ERROR,
21014 use the macro SWIG_fail to return with an error. This ensures that
21015 arguments are properly cleaned up. Exception specifiers are now
21016 handled by default.
21017
2101809/02/2002: ljohnson (Lyle Johnson)
21019 [Ruby] The type-checking system for the Ruby module has had a flaw
21020 in that some types which should be considered equivalent
21021 weren't. This bug was best demonstrated by the inherit_missing.i
21022 test suite case, which defines a base class "Foo" that is
21023 subclassed by "Bar". The "Foo" class isn't actually wrapped (i.e.
21024 it's not directly accessible from Ruby) but we'd still like to be
21025 able to pass "Bar" instances to functions expecting Foos and have
21026 that work; it wasn't. The revised implementation (similar to that
21027 used for some other language modules) adds a new instance variable
21028 (__swigtype__) to each object that indicates its SWIG type;
21029 that is, each "Bar" instance will now have a string instance
21030 variable called "__swigtype__" whose value is "_p_Bar".
21031
21032 Unless developers were taking advantage of this low-level
21033 implementation detail, they shouldn't notice any compatibility
21034 problems; nevertheless, I'm marking it as a "potential
21035 incompatibility".
21036
21037 *** POTENTIAL INCOMPATIBILITY ***
21038
2103909/01/2002: ljohnson (Lyle Johnson)
21040 [Ruby] Fixed SF Bug #603199.
21041
2104208/08/2002: cheetah (William Fulton)
21043 [Java] Added OUTPUT, INPUT and INOUT typemaps in typemaps.i for C++
21044 references.
21045
2104608/27/2002: mkoeppe
21047 [Guile] Fixed error in "lib_std_vector" testcase and
21048 compiler warning in "lib_cdata" testcase.
21049
2105008/27/2002: ljohnson (Lyle Johnson)
21051 [Ruby] Added the "%mixin" directive, which allows the user to
21052 specify a comma-separated list of module names to mix-in to a
21053 class. So, for example, if you'd like to specify that Ruby's
21054 Enumerable module should be mixed-in to your class Foo, you'd
21055 write:
21056
21057 %mixin Foo "Enumerable";
21058
21059 or to specify that the modules Fee, Fie and Fo should be mixed
21060 in to Foo:
21061
21062 %mixin Foo "Fee,Fie,Fo";
21063
21064 *** NEW FEATURE ***
21065
2106608/27/2002: ljohnson (Lyle Johnson)
21067 [Ruby] Modified the %alias directive so that multiple aliases
21068 can be specified for an instance method by using a comma-separated
21069 list of aliases.
21070
2107108/27/2002: ljohnson (Lyle Johnson)
21072 [Ruby] Added "throw" typemaps for the Ruby module.
21073
2107408/26/2002: beazley
21075 Two new command line options for printing dependencies.
21076 'swig -M' lists all file dependencies. 'swig -MM' lists
21077 dependencies, but excludes files in the SWIG library.
21078 Example:
21079
21080 % swig -M -python example.i
21081 example_wrap.cxx: \
21082 /u0/beazley/Projects/lib/swig1.3/swig.swg \
21083 /u0/beazley/Projects/lib/swig1.3/python/python.swg \
21084 example.i \
21085 example.h
21086
21087 % swig -MM -python example.i
21088 example_wrap.cxx: \
21089 example.i \
21090 example.h
21091
21092 *** NEW FEATURE ***
21093
2109408/26/2002: beazley
21095 Fixed [ 597599 ] union in class: incorrect scope.
21096 Reported by Art Yerkes.
21097
2109808/26/2002: beazley
21099 Fixed [ 600132 ] Default argument with namespace.
21100 Reported by Shibukawa Yoshiki.
21101
2110208/24/2002: beazley
21103 Automatic C++ exception handling enabled for all language modules. This is
21104 pretty simple. If you have a class like this:
21105
21106 class Foo {
21107 };
21108 class Bar {
21109 public:
21110 void blah() throw(Foo);
21111 }
21112
21113 then the generated wrapper code looks like this:
21114
21115 wrap_Bar_blah() {
21116 ...
21117 try {
21118 arg1->blah();
21119 }
21120 catch (Foo &_e) {
21121 /* "throw" typemap code inserted. $1 = _e */
21122 }
21123 catch (...) {
21124 throw;
21125 }
21126 }
21127 The "throw" typemap can be used to raise an error in the target
21128 language. It can do anything. Here is a very simple example:
21129
21130 %typemap("throw") Foo {
21131 PyErr_SetString(PyExc_RuntimeError, "Foo exception");
21132 return NULL;
21133 }
21134
21135 To make this work in each language module, simply define a few default
21136 "throw" typemaps for SWIGTYPE, SWIGTYPE *, int, const char *, and a
21137 few common exception types. That's all there is to it.
21138
21139 Automatic exception handling can be disabled using -noexcept or
21140 setting the NoExcept global variable to 1.
21141 *** NEW FEATURE ***
21142
2114308/23/2002: beazley
21144 [ Python ]
21145 Automatic translation of C++ exception specifications into error handling code.
21146 For example:
21147
21148 class Foo {
21149 };
21150 class Bar {
21151 public:
21152 void blah() throw(Foo);
21153 }
21154
21155 In this case, Foo is wrapped as a classic-style class (compatible
21156 with exception handling). Furthermore, you can write Python code
21157 like this:
21158
21159 b = Bar()
21160 try:
21161 b.blah();
21162 except Foo,e: # Note use of exception class here!
21163 # Handle Foo error
21164 ...
21165
21166 The object "e" in the exception handler is just a wrapped Foo
21167 object. Access it like a normal object.
21168
21169 If an exception is not wrapped as a class, a RuntimeError
21170 exception is raised. The argument to this exception is
21171 the exception object. For example:
21172
21173 class Bar {
21174 public:
21175 void blah() throw(int);
21176 }
21177
21178 b = Bar()
21179 try:
21180 b.blah();
21181 except RuntimeError,e:
21182 print e.args[0] # Integer exception value
21183
21184 Comments:
21185
21186 - If a class is used as an exception, it *must* be wrapped
21187 as a Python classic-style class (new classes don't work).
21188
21189 - Automatic exception handling is compatible with %exception.
21190
21191 - Use -noexcept to turn off this feature.
21192
21193 - The newly introduced "throw" typemap is used to raise
21194 Python errors (naturally).
21195
21196 *** EXPERIMENTAL NEW FEATURE ***
21197
2119808/23/2002: beazley
21199 Information from throw() specifiers is now stored in the parse
21200 tree. For example:
21201
21202 class Foo {
21203 public:
21204 int blah() throw(spam,bar);
21205 }
21206
21207 The stored information is fully corrected for namespaces and works
21208 with templates. Uses will follow.
21209
2121008/22/2002: beazley
21211 Exception handling code is no longer applied to member access
21212 function. For example, in this code
21213
21214 %exception {
21215 try {
21216 $action
21217 } catch(whatever) {
21218 ...
21219 }
21220 }
21221
21222 class Foo {
21223 public:
21224 int x;
21225 ...
21226 }
21227
21228 The exception handling code is not applied to accessor functions
21229 for Foo::x. This should reduce the amount of extra code
21230 generated.
21231
21232 Caveat: Exception handling code *is* used when attributes are
21233 accessed through a smart-pointer or a synthesized attributed
21234 added with %extend is used.
21235
2123608/22/2002: beazley
21237 Made more patches to hopefully eliminate problems when compiling SWIG
21238 as a 64-bit executable.
21239
2124008/22/2002: beazley
21241 Fixed a bug with const reference members, variables, and static members.
21242 For example:
21243
21244 class Foo {
21245 public:
21246 static const int &ref;
21247 };
21248
21249 SWIG was trying to generate "set" functions which wouldn't compile.
21250
2125108/21/2002: beazley
21252 Made the warning message for "Class X might abstract" off by default.
21253 Enable with -Wall.
21254
2125508/21/2002: beazley
21256 Refined handling of const and non-const overloaded methods. If
21257 a class defines a method like this:
21258
21259 class Foo {
21260 public:
21261 int bar(int);
21262 int bar(int) const;
21263 }
21264
21265 Then the non-const method is *always* selected in overloading and
21266 the const method silently discarded. If running with -Wall, a warning
21267 message will be generated.
21268
2126908/19/2002: beazley
21270 Better support for using declarations and inheritance. Consider this:
21271
21272 class Foo {
21273 public:
21274 int blah(int x);
21275 };
21276
21277 class Bar {
21278 public:
21279 double blah(double x);
21280 };
21281
21282 class FooBar : public Foo, public Bar {
21283 public:
21284 char *blah(char *x);
21285 using Foo::blah;
21286 using Bar::blah;
21287 };
21288
21289 Now SWIG wraps FooBar::blah as an overloaded method that uses all
21290 accessible versions of blah(). See section 15.2.2 in Stroustrup, 3rd Ed.
21291
21292 SWIG also supports access change through using declarations. For example:
21293
21294 class Foo {
21295 protected:
21296 int x;
21297 int blah(int x);
21298 };
21299
21300 class Bar : public Foo {
21301 public:
21302 using Foo::x;
21303 using Foo::blah;
21304 };
21305
21306
21307 Caveat: SWIG does not actually check to see if declarations imported
21308 via 'using' are in the inheritance hierarchy. If this occurs, the
21309 wrapper code won't compile anyways---not sure it's worth worrying about.
21310
2131108/18/2002: beazley
21312 Modified overloading dispatch to not include nodes with an "error" attribute.
21313 A language module can set this if a node couldn't be wrapped and you don't want
21314 it included in the dispatch function.
21315
2131608/18/2002: beazley
21317 Enhancement to overloaded function dispatch. The dispatcher is now aware of
21318 inheritance relationships. For example:
21319
21320 class Foo { };
21321 class Bar : public Foo { };
21322
21323 void spam(Foo *f);
21324 void spam(Bar *b);
21325
21326 In this case, the dispatcher re-orders the functions so that spam(Bar *b) is
21327 checked first---it is more specific than spam(Foo *f).
21328
2132908/17/2002: beazley
21330 Added -Werror command line option. If supplied, warning messages are treated
21331 as errors and SWIG will return a non-zero exit code.
21332
2133308/17/2002: beazley
21334 Fixed [ 596135 ] Typedef of reference can't compile. For example:
21335
21336 typedef int &IntRef;
21337 void foo(IntRef i);
21338
21339 SWIG-1.3.14 generated code that wouldn't compile.
21340
21341Version 1.3.14 (August 12, 2002)
21342================================
21343
2134408/11/2002: mmatus
21345 Static const members initialized during declaration, and
21346 only them, ie:
21347
21348 struct A
21349 {
21350 static const int a = 1 ; // this one
21351 static const int b; // not this one
21352 };
21353
21354 are emitted like constants (equivalent to enums or
21355 explicit %constant).
21356
21357 This is because they cannot be added directly to 'cvar'
21358 since they lack the needed reference (well, you can force
21359 them to have a real reference, but in an ugly way which
21360 goes completely again the original purpose of initialize
21361 them during declaration, you also have to deal with extra
21362 linking matters, and it take a while to figure out what is
21363 the problem and how to solve it).
21364
21365 Please test it with your preferred target language, and
21366 not only the code generation, but really run the example
21367 in the test-suite (static-const-member-2.i) because the
21368 problem and the solution cannot be "fully" appreciated
21369 until you try to load the module and run it.
21370
21371 In some target languages (python specially), this can
21372 produces a difference in the way that the static constant
21373 members 'a' and 'b' are internally wrapped. Hopefully,
21374 they still can be accessed in the same way.
21375
21376
2137708/11/2002: mmatus
21378 [python] Now static const members can be accessed in a more
21379 natural way, ie, if you have
21380
21381 struct A
21382 {
21383 typedef unsigned int viewflags;
21384 static const viewflags forward_field = 0;
21385 static const viewflags backward_field;
21386 };
21387
21388 now you can do:
21389
21390 print A.backward_field
21391
21392 and also
21393
21394 a = A()
21395 print a.forward_field
21396
21397 Note that if the static const members don't have an
21398 initializer (like backward_field), still you can access
21399 them in the same way in the python side, but the
21400 implementation is a quite different: backward_field will
21401 still appear in the cvar entity, and also, you are
21402 responsible to initialize it in some code unit, and link it
21403 properly. forward_field, by the other hand, will not
21404 appear in the cvar entity but only as a A member, similar
21405 to what happen with enum or %constant members.
21406
2140708/11/2002: mmatus
21408 [python] Common code in the __setattr__/__getattr__ now
21409 goes to two "free" methods at the beginning of the proxy
21410 file, from where each class use it. This change reduces
21411 the size of the proxy file, specially if you wrap a lot of
21412 small classes in one module (up to 33% in some cases),
21413 making it faster to load too.
21414
2141508/09/2002: beazley
21416 [Perl5] If a function that returns char * returns NULL,
21417 undef is returned to the Perl interpreter.
21418
2141908/09/2002: beazley
21420 Fix to conversion operators and namespaces. For example:
21421
21422 namespace ns {
21423 struct Foo { };
21424 struct Bar {
21425 operator Foo*();
21426 };
21427 }
21428
21429 In the wrapper code, SWIG was using ->operator Foo*()
21430 when it should have been using ->operator ns::Foo*().
21431
21432 Note: if using %rename with a conversion operator, you
21433 might have to do this:
21434
21435 %rename(toFooPtr) ns::operator ns::Foo*();
21436 // ^^^^ note extra qualifier
21437 namespace ns {
21438 ...
21439
21440
2144108/09/2002: beazley
21442 [Python] Minor enhancement to 'const' variable declarations.
21443 Normally const declarations are wrapped as read-only variables
21444 accessible only through the cvar attribute (see SWIG.html for
21445 a discussion of why). However, in many programs, "const"
21446 declarations may just be constants---making the cvar. access
21447 awkward. To fix this, "const" declarations are now available
21448 both through cvar. and as a simple name. For example:
21449
21450 const int FOO = 42;
21451
21452 In Python:
21453
21454 >>> print example.cvar.FOO
21455 42
21456 >>> print example.FOO
21457 42
21458
21459 Note: There are cases where the value of a "const" variable
21460 might change. For example:
21461
21462 char *const BAR = "Hello World";
21463
21464 In this case, the pointer itself can not change, but the
21465 data being pointed to could be modified. In these situations,
21466 cvar.BAR should be accessed to obtained the current value.
21467
2146808/08/2002: beazley
21469 [Python] Fixed generation of the proxy code (.py files) to more
21470 closely follow the order of declarations as they appear in
21471 the .i file. In the past, all of the class wrappers appeared
21472 first, followed by function stubs, inserted Python code, and
21473 other details.
21474
2147508/08/2002: cheetah (William Fulton)
21476 [Java] Proxy method _delete() changed to delete(). There shouldn't ever
21477 be a wrapped function called delete() as it is a C++ keyword and there
21478 is no such thing as a member function in C.
21479
21480 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
21481
21482 Backwards compatibility can be achieved by adding the function back in
21483 for all proxy classes:
21484 %typemap(javacode) SWIGTYPE %{
21485 public void _delete() {
21486 delete();
21487 }
21488 %}
21489
21490 Java backwards compatibility summary
21491 ------------------------------------
21492
21493 There are a number of changes that have been made in improving the Java module
21494 for ver 1.3.14. If at all possible change your code to take advantages of the
21495 improvements. If you were using proxy classes you may not notice any backwards
21496 compatibility issues. Here is an example which will help with most backwards
21497 compatibility problems where it is not possible to modify the code that uses
21498 the generated output:
21499
21500 Replace:
21501 %module modulename
21502
21503 With:
21504 %module (jniclassname="modulename") modulename;
21505 %typemap(javacode) SWIGTYPE %{
21506 public long getCPtr$javaclassname() {
21507 return swigCPtr;
21508 }
21509 public void _delete() {
21510 delete();
21511 }
21512 %}
21513 %pragma(java) jniclassclassmodifiers="public";
21514
21515 The proxy constructors that took parameters (long cPtr, boolean cMemoryOwn)
21516 were public and are now protected. If you were making use of these then you'll
21517 have to modify your code and the best solution would be to use the new type
21518 wrapper classes.
21519
21520 The other main areas are the pragmas and global variable wrapping. Replace
21521 the pragmas with one of the new directives or typemaps mentioned below and use
21522 %rename on the variables.
21523
21524 If you were not using proxy classes, you will have to define a jstype typemap
21525 as well as a jtype typemap.
21526
2152708/08/2002: cheetah (William Fulton)
21528 [Java] Fix for wrapping two dimension array variables.
21529
2153008/07/2002: beazley
21531 [Python,Tcl]
21532 Object management now has a much better sense of ownership.
21533 Ownership bits is changed whenever an object is stored in a
21534 global variable or structure member. For example:
21535
21536 struct Foo {
21537 int val;
21538 Foo *next;
21539 };
21540
21541 Now in Python
21542
21543 >>> f = Foo()
21544 >>> f.thisown
21545 1
21546 >>> g = Foo()
21547 >>> g.next = f # Assign a pointer
21548 >>> f.thisown # Notice ownership change
21549 0
21550 >>>
21551
21552 This scheme is mostly a conservative heuristic designed to
21553 provide segmentation faults. It could cause a memory leak
21554 if ownership is changed unnecessarily. In this case, you can
21555 either write a typemap (that doesn't change ownership), or
21556 manually set the thisown attribute back to 1.
21557
2155808/07/2002: beazley
21559 [Tcl] Major usability improvements to the object interface.
21560 Suppose you had code like this:
21561
21562 struct Foo {
21563 int x;
21564 int spam();
21565 };
21566
21567 void blah(Foo *f);
21568
21569 In past versions of SWIG, you could create objects and use
21570 them like this:
21571
21572 % Foo f
21573 % f configure -x 3
21574 % f spam
21575 37
21576
21577 The only problem is that if you tried to call blah(), it didn't
21578 work:
21579
21580 % blah f
21581 Type Error. Expected _p_Foo
21582 %
21583
21584 Instead, you had to do this:
21585
21586 % blah [f cget -this]
21587
21588 SWIG now automatically extracts the -this pointer, avoiding this
21589 problem. This means that saying "blah f" is perfectly legal and
21590 everything will still work normally.
21591
21592 Caveat: Since pointer strings start with a leading underscore (_),
21593 don't use this in object names. For example:
21594
21595 % Foo _f
21596 % blah _f # Potential crash
21597
21598 Objects now have a -thisown attribute that shows the ownership.
21599 This builds upon the CHANGES 11/24/2001 entry.
21600
2160108/07/2002: samjam, Sam Liddicott
21602 Properly implemented pointer system using php resources.
21603 Still need to work out whether or not to let script-users call
21604 destructors directly
21605
2160608/06/2002: beazley
21607 Upgraded mzscheme module to support version 201 and added
21608 overloading support.
21609
2161008/05/2002: beazley
21611 Added parsing support for extra grouping (in very limited cases).
21612 For example:
21613
21614 typedef int (FuncPtr)(int, double);
21615
21616 *** EXPERIMENTAL ***
21617
2161808/03/2002: ljohnson (Lyle Johnson)
21619 [Ruby] Updates to typemaps.i as those done previously for Perl,
21620 Python and Tcl modules. Now supports reference types with INPUT,
21621 OUTPUT and INOUT typemaps.
21622
2162308/02/2002: beazley
21624 New library file cstring.i added. Provides macros for
21625 manipulating char * data.
21626
2162708/02/2002: beazley
21628 Deprecated the %new directive. Use %newobject instead. For
21629 example:
21630
21631 %newobject foo;
21632 ...
21633 char *foo();
21634
21635 %newobject follows the same rules as %rename, %ignore, %feature,
21636 etc.
21637
21638 *** POTENTIAL INCOMPATIBILITY ***
21639
2164008/01/2002: cheetah (William Fulton)
21641 [Java] New attribute 'jniclassname' for the module directive allows a way of
21642 changing the JNI class name from the default which uses the modulename with JNI
21643 appended after it.
21644
21645 %module (jniclassname="name") modulename
21646
21647 If 'name' is the same as 'modulename' then the module class name gets changed
21648 from 'modulename' to modulenameModule.
21649
2165008/01/2002: beazley
21651 Fixed problem with file include order. Language specific
21652 directories should take precedence over generic directories.
21653 For example: "swig_lib/python/foo.i" should be loaded before
21654 "swig_lib/foo.i". I thought this was the case already, but
21655 apparently it has been broken for quite some time.
21656
2165708/01/2002: beazley
21658 Added std_deque.i library file. Work in progress.
21659
2166008/01/2002: beazley
21661 [Python,Tcl,Perl]
21662 Improvements to typemaps.i. INPUT/INOUT typemaps perform better
21663 error checking. Typemaps are now supplied for references like
21664 int &OUTPUT, double &INOUT, etc.
21665
2166608/01/2002: beazley
21667 [Python] Deprecated the T_* and L_* typemaps in typemaps.i.
21668 Multiple return values are always placed in a tuple. Deprecated
21669 the BOTH typemaps. This is now INOUT (e.g., int *INOUT).
21670
21671 *** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***
21672
2167308/01/2002: beazley
21674 Deprecated the array.i, carray.i, and timer.i library files.
21675
2167608/01/2002: beazley
21677 Deprecated the pointer.i library file. Use cpointer.i instead.
21678 *** POTENTIAL INCOMPATIBILITY ***
21679
2168008/01/2002: cheetah (William Fulton)
21681 [Java] For consistency the global variable getters and setters use the JavaBean
21682 property design pattern like member variables always have. This means if you are
21683 wrapping a variable called foo, the getter is called getFoo() and the setter is
21684 called setFoo(). Before the recent changes to the Java module the getters and
21685 setters were called get_foo() and set_foo(). If you really want the original
21686 function names use the %rename directive like this: %rename(_foo) Foo;
21687
2168807/31/2002: beazley
21689 Fixed casting problem with multiple inheritance. If you had this,
21690
21691 class foo {};
21692 class bar : public foo {};
21693 class baz : public foo {};
21694 class spam : public bar, public baz {};
21695
21696 then the wrappers wouldn't compile due to an ambiguous cast.
21697 Reported by Art Yerkes.
21698
2169907/30/2002: cheetah (William Fulton)
21700 [Java] Due to new static typechecking all pointers held in a Java long are part of
21701 the internal workings and this pointer value in the Java long has become abstracted
21702 data. The type wrapper constructor and getCPtr() methods are as such protected.
21703 If you need to mess around with pointers from Java or for example create a proxy
21704 class or type wrapper class around a null pointer, add a function/constructor
21705 to do so with the %javacode typemap. You can also make getCPtr() public again with
21706 the %javagetcptr typemap.
21707
2170807/30/2002: cheetah (William Fulton)
21709 [Java] Fixes for %typemap(ignore). In particular when ignoring the last parameter
21710 in a function. Also for all parameters in constructors. These mods have also fixed
21711 multi-argument typemaps for proxy classes - SF 581791.
21712
2171307/30/2002: cheetah (William Fulton)
21714 [Java] %newobject (replacement for %new) now implemented for Java.
21715
2171607/29/2002: beazley
21717 Fixed problem with typemap copies, %apply, and %clear inside
21718 C++ namespaces.
21719
2172007/28/2002: cheetah (William Fulton)
21721 [Java] The JNI class now has package access as the class modifier
21722 has been changed from "public" to nothing. This has been done
21723 as this class is now more for the internal workings of SWIG since the module
21724 class has static type checking for all types.
21725
21726 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
21727
21728 Backwards compatibility can be achieved by using the %jniclassclassmodifier
21729 pragma to change it back to "public".
21730
2173107/28/2002: cheetah (William Fulton)
21732 [Java] Proxy/Shadow classes are generated by default. The -proxy and
21733 -shadow command line options are deprecated. If you want to use the
21734 low-level functional interface then use the new -noproxy commandline option.
21735
21736 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
21737
2173807/28/2002: cheetah (William Fulton)
21739 [Java] Remaining pragmas shakeup. These were the remaining pragmas and their
21740 new names where changed:
21741
21742 modulebase
21743 modulecode
21744 moduleclassmodifiers
21745 moduleimport => moduleimports
21746 moduleinterface => moduleinterfaces
21747
21748 The moduleimports works slightly differently to how the moduleimport pragma worked.
21749 Now it actually takes code which gets placed before the class definition so the
21750 whole import statement has to be given, for example:
21751
21752 %pragma(java) moduleimports=%{
21753 import java.io.*;
21754 import java.math.*;
21755 %}
21756
21757 The moduleinterfaces is slightly different to the old moduleinterface in that if
21758 more than one interface is required they must be comma separated in one use of
21759 the pragma, for example:
21760
21761 %pragma(java) moduleinterfaces="Serializable, MyInterface"
21762
21763 These last two pragmas are consistent with the javainterfaces and javaimports
21764 typemap.
21765
21766 A similar set of pragmas has been introduced, namely:
21767
21768 jniclassbase
21769 jniclasscode
21770 jniclassclassmodifiers
21771 jniclassimport
21772 jniclassinterface
21773
21774 These work in the same way as their module counterparts. Note that previously
21775 the moduleXXX pragmas worked on the old module class which is now called the
21776 JNI class (the class with the native functions). The jniclassXXX pragmas now
21777 work on the new module class (the class that has all the global functions and
21778 global variable getters and setters when using proxy classes, plus all other
21779 remaining functions when using the low-level procedural interface).
21780
21781 In summary the contents of the pragmas make up a class like this:
21782
21783 <jniclassimports>
21784 <jniclassmodifiers> class modulename extends <jniclassbase> implements <jniclassinterfaces> {
21785 <jniclasscode>
21786 ... SWIG generated functions ...
21787 }
21788}
21789 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
21790
2179107/28/2002: cheetah (William Fulton)
21792 [Java] Deprecated modulemethodmodifiers pragma and replaced with
21793 a better %feature based directive called %javamethodmodifiers.
21794 A useful example would be for synchronisation in multi-threaded apps:
21795
21796 %javamethodmodifiers foo(int a) "public synchronized";
21797
21798 Changes this function from the default ("public") to "public synchronized".
21799
21800 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
21801
2180207/26/2002: beazley
21803 Several directives now allow optional configuration parameters.
21804 These include:
21805
21806 %module(name="value", name="value", ...) modulename
21807 %import(name="value", ...) "filename.i"
21808 %extend(name="value", ...) classname {
21809 ...
21810 }
21811
21812 These currently have no effect and are reserved for
21813 future expansion.
21814
2181507/26/2002: beazley
21816 Enhancements to smart-pointer handling. SWIG only provides
21817 extra support for a smart-pointer if operator->() returns
21818 a proper pointer. For example:
21819
21820 Foo *operator->();
21821
21822 If operator->() returns an object by value or reference,
21823 then SWIG examines the returned object to see if it also
21824 implements operator->(). If so, SWIG chases operator->()
21825 until it can find one that returns a pointer. This allows
21826 cases like this to work:
21827
21828 class Foo {
21829 public:
21830 void blah();
21831 };
21832
21833 class Bar {
21834 ...
21835 Foo *operator->();
21836 ...
21837 };
21838
21839 class Spam {
21840 ...
21841 Bar operator->();
21842 ...
21843 };
21844
21845 For example:
21846
21847 >>> s = Spam()
21848 >>> s.blah() # Invokes Foo::blah()
21849
21850 The s.blah() call actually invokes:
21851
21852 ((s.operator->()).operator->())->blah();
21853
2185407/26/2002: beazley
21855 Fixed a bug with typedef and references. For example:
21856
21857 typedef Foo & FooRef;
21858 FooRef blah();
21859
21860 Previous versions of SWIG generated code that wouldn't
21861 compile.
21862
2186307/25/2002: beazley
21864 Wrapping of static methods has been improved in proxy classes. In older
21865 versions of SWIG, if you had this:
21866
21867 class Foo {
21868 public:
21869 static void bar();
21870 };
21871
21872 The static method was only available as a function Foo_bar(). For example:
21873
21874 >>> Foo_bar()
21875
21876 Now, the static method can also be invoked through an instance like this:
21877
21878 >>> f = Foo()
21879 >>> f.bar() # Invokes static method
21880
21881 This works with all versions of Python. Additionally, for Python-2.2,
21882 the static method can be invoked as:
21883
21884 >>> Foo.bar()
21885
21886 The old-style function is still support for backwards compatibility. If
21887 you care about making your code across different versions of Python,
21888 either use Foo_bar() or access the method through an instance.
21889
2189007/25/2002: beazley
21891 Changes to the Python module. Proxy classes now utilize new Python-2.2
21892 features including properties and static methods. However, these features
21893 are supported in a way that provides backwards compatibility with older
21894 Python versions. In other words, proxy classes work with all versions
21895 of Python and only use new features when running on Python-2.2.
21896
21897
2189807/25/2002: beazley
21899 Modified %extend so that overloaded methods can be added. For example:
21900
21901 %extend Foo {
21902 void bar(int x) { };
21903 void bar(char *s) { };
21904 ...
21905 }
21906
21907 This works with both C++ *and* C.
21908
2190907/24/2002: cheetah (William Fulton)
21910 [Java] More new typemaps so that the Java proxy classes and type wrapper classes
21911 can be further tailored by users. These are the default code for generating the
21912 finalize() methods (proxy classes only) and the getCPtr() methods for proxy
21913 classes and type wrapper classes:
21914
21915 %typemap(javafinalize) SWIGTYPE %{
21916 protected void finalize() {
21917 _delete();
21918 }
21919 %}
21920
21921 %typemap(javagetcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] %{
21922 public static long getCPtr($javaclassname obj) {
21923 return obj.swigCPtr;
21924 }
21925 %}
21926
21927 The javagetcptr typemap will enable users to handle Java null by overriding
21928 this typemap - a requested feature.
21929
21930 The -nofinalize commandline option has been deprecated. The javafinalize
21931 typemap is more powerful as it will allow the removal of the finalize methods
21932 for all or any one or more particular proxy class.
21933
2193407/23/2002: cheetah (William Fulton)
21935 [Java] The getCPtrXXX() function has been changed to a static function and
21936 is now of the form:
21937
21938 protected static long getCPtr(XXX obj) {...}
21939
21940 This is a requested change which will allow Java null pointers to be used as null
21941 can be passed in for obj. However, to achieve this the appropriate code must be
21942 written using the new javagetcptr typemap directive.
21943
21944 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
21945
21946 Backwards compatibility can be achieved by adding this function back in using the
21947 new javacode typemap:
21948
21949 %typemap(javacode) SWIGTYPE %{
21950
21951 // SWIG-1.3.12 and SWIG-1.3.13
21952 public long getCPtr$javaclassname() {
21953 return swigCPtr;
21954 }
21955 // SWIG-1.3.11 and earlier
21956 public long getCPtr() {
21957 return swigCPtr;
21958 }
21959
21960 %}
21961
21962
2196307/23/2002: cheetah (William Fulton)
21964 [Java] New directive to control constant code generation - %javaconst.
21965 The default handling for handling constants is to get the value through
21966 a JNI call, eg
21967
21968 #define YELLOW 5
21969 #define BIG 1234LL
21970
21971 results in:
21972
21973 public final static int YELLOW = modulename.get_YELLOW();
21974 public final static long BIG = modulename.get_BIG();
21975
21976 Earlier versions of the Java module initialised the value using the C value:
21977
21978 public final static int YELLOW = 5;
21979 public final static long BIG = 1234LL;
21980
21981 This works in most cases, but the value for BIG won't compile as 1234LL is not
21982 valid Java code and this is one of the reasons why the default is now to get the
21983 values through a JNI call. The side effect is that these 'constants' cannot be used
21984 in switch statements. The %javaconst directive allows one to specify the
21985 way the constant value is initialised and works like other %feature
21986 directives, eg
21987
21988 %javaconst(0); // all constants from this point on are initialised using the C value
21989 %javaconst(1) BIG; // just BIG initialised using JNI call (must be parsed before BIG is defined)
21990
2199107/23/2002: beazley
21992 *** IMPORTANT CHANGES TO THE PYTHON MODULE ***
21993
21994 (1) The Python module now enables shadow/proxy classes by default.
21995 This means that two files are always created by SWIG. For
21996 instance, if you have this:
21997
21998 // file: foo.i
21999 %module foo
22000 ...
22001
22002 Then swig generates two files "foo_wrap.c" and "foo.py".
22003
22004 (2) The name of the low-level C extension module has been changed
22005 to start with a leading underscore. This means that you have
22006 to compile the module as follows:
22007
22008 $ cc -c -I/usr/local/include/python2.2 foo_wrap.c
22009 $ cc -shared foo_wrap.o $(OBJS) -o _foo.so
22010 ^^^^
22011 note extra underscore
22012
22013 This naming scheme is consistent with other Python modules that
22014 utilize extension code. For instance, the socket module consists
22015 of "_socket.so" and "socket.py". In previous versions of SWIG,
22016 the shared object file was named "foocmodule.so".
22017
22018 (3) A new directive can be used to insert Python code into
22019 the corresponding .py file. For example:
22020
22021 %pythoncode %{
22022 def foo():
22023 print "Hello World"
22024 %}
22025
22026 This directive allows you to create modules as a mix of C and Python.
22027 Python code is seamlessly added to the module.
22028
22029 (4) The -shadow command line option is deprecated. This is turned on
22030 by default.
22031
22032 (5) To disable the generation of the extra python file, use the "-noproxy"
22033 command line option.
22034
22035 *** POTENTIAL INCOMPATIBILITY ***
22036 This change will likely break the build environment of projects that
22037 utilize shadow classes. To fix this, you probably only need to
22038 change the name of the target .so file. For example, if you have
22039 Makefile information like this:
22040
22041 TARGET = examplecmodule.so
22042
22043 Just change it to:
22044
22045 TARGET = _example.so
22046
22047 *** DOCUMENTATION UPDATE ***
22048 The file Doc/Manual/Python.html has been updated to describe these changes.
22049
22050
2205107/23/2002: beazley
22052 Added -noextern option. If supplied, SWIG will not generate
22053 extra extern declarations. This is sometimes an issue on
22054 non-unix platforms.
22055
2205607/23/2002: beazley
22057 Added a warning for ignored friend functions.
22058
2205907/23/2002: beazley
22060 Fixed [ 574498 ] -proxy and %include "pointer.i" clash.
22061 Reported by David Creasy.
22062
2206307/23/2002: beazley
22064 Fixed [ 576103 ] global destruction warning with shadow.
22065 Perl extensions should no longer report the warning
22066
22067 "Use of uninitialized value during global destruction."
22068
22069 when running with "perl -w". Reported by
22070 Brett Williams.
22071
2207207/23/2002: beazley
22073 In C++ mode, SWIG now always defines namespace std. By default,
22074 it's empty. However, this will silence errors from programs
22075 that include statements such as "using namespace std;".
22076 This fixes Bug [ 584017 ] using namespace std generates error.
22077 Reported by Joseph Winston.
22078
2207907/22/2002: beazley
22080 Added a new warning message for %apply. If you use %apply but no typemaps
22081 are defined, you will get a warning message. This should help with
22082 problems like this:
22083
22084 %apply char *OUTPUT { ... };
22085
22086 In old versions of SWIG, this silently did nothing. Now you get an error like this:
22087
22088 file:line. Warning. Can't apply (char *OUTPUT). No typemaps are defined.
22089
2209007/22/2002: cheetah (William Fulton)
22091 [Java] Started Java pragma deprecation. Replacements use %typemap based
22092 directives and enable proxy classes and the new type wrapper classes to be
22093 tailored in various ways. These are the new typemaps:
22094
22095 %typemap(javabase) - base (extends) for Java class
22096 %typemap(javaclassmodifiers) - class modifiers for the Java class: default is "public"
22097 %typemap(javacode) - java code is copied verbatim to the Java class
22098 %typemap(javaimports) - import statements for Java class
22099 %typemap(javainterfaces) - interfaces (extends) for Java class
22100
22101 And these are the %pragma directives being deprecated:
22102 allshadowbase
22103 allshadowclassmodifiers
22104 allshadowcode
22105 allshadowimport
22106 allshadowinterface
22107 shadowbase
22108 shadowclassmodifiers
22109 shadowcode
22110 shadowimport
22111 shadowinterface
22112
22113 Note that it is possible to target a particular proxy class:
William S Fultonc10a84c2022-08-20 22:14:58 +010022114 %typemap(javaimports) Foo "import java.util.*"
William S Fultona3255742002-10-23 19:08:17 +000022115 or a particular type wrapper class:
William S Fultonc10a84c2022-08-20 22:14:58 +010022116 %typemap(javaimports) double* "import java.math.*"
William S Fultona3255742002-10-23 19:08:17 +000022117 Note that $javaclassname in these typemaps are substituted with either the proxy
22118 classname when using proxy classes or the SWIGTYPE class name.
22119
2212007/18/2002: cheetah (William Fulton)
22121 [Java] Java module overhaul to implement static type checking of all
22122 types.
22123
22124 1) Changes when using Java Proxy classes
22125 ----------------------------------------
22126
22127 Previously when wrapping global functions:
22128
22129 class SomeClass{};
22130 void foo(SomeClass* s);
22131 SomeClass* bar();
22132
22133 The native method prototypes used a long for pointers and looked like this:
22134
22135 public class modulename {
22136 ...
22137 public final static native void foo(long jarg1);
22138 public final static native long bar();
22139 }
22140
22141 and unlike member functions of a C++ class there was no wrapper around the native calls
22142 to make the use of them more user friendly. They would be used from Java like this:
22143
22144 SomeClass s = new SomeClass(modulename.bar(), false);
22145 modulename.foo(s.getCPtrSomeClass());
22146
22147 Note that the following will have the same effect, but then it would not have
22148 been possible to call any proxy member functions in SomeClass:
22149
22150 long s = modulename.bar();
22151 modulename.foo(s);
22152
22153 Now wrapper functions are generated:
22154
22155 public class modulename {
22156 public static void foo(SomeClass s) {
22157 // calls the native function
22158 }
22159
22160 public static SomeClass bar() {
22161 // calls the native function
22162 }
22163 }
22164
22165 Which means these functions can now be used more naturally with proxy classes:
22166
22167 SomeClass s = modulename.bar();
22168 modulename.foo(s);
22169
22170 2) Changes when not using Java Proxy classes
22171 --------------------------------------------
22172
22173 The so called low-level interface was rather low-level indeed. The
22174 new static type checking implementation makes it less so but it remains a
22175 functional interface to the C/C++ world. Proxy classes are the obvious way to use
22176 SWIG generated code, but for those who want a functional interface all non-primitive
22177 types now have a simple Java class wrapper around the C/C++ type. Pointers and
22178 references to primitive types are also wrapped by type wrapper classes. The type
22179 wrapper classnames are based on the SWIG descriptors used by the other language
22180 modules. For example:
22181
22182 C/C++ type Java type wrapper class name
22183 ---------- ----------------------------
22184 int* SWIGTYPE_p_int
22185 double** SWIGTYPE_p_p_double
22186 SomeClass* SWIGTYPE_p_SomeClass
22187 SomeClass& SWIGTYPE_p_SomeClass
22188 SomeClass SWIGTYPE_p_SomeClass
22189
22190 Note that everything wrapped by SWIG is accessed via a pointer even when wrapping
22191 functions that pass by value or reference. So the previous example would now be
22192 used like this:
22193
22194 SWIGTYPE_p_SomeClass s = example.bar();
22195 example.foo(s);
22196
22197 Note that typedefs that SWIG knows about are resolved, so that if one has
22198
22199 class Foo{};
22200 typedef Foo Bar;
22201
22202 then any use of Bar will require one to use SWIGTYPE_p_Foo;
22203
22204 Some considerations:
22205 Make sure you make a firm decision to use either proxy classes or the functional
22206 interface early on as the classnames are different.
22207
22208 3) Pointers and non-parsed types
22209 --------------------------------
22210 Sometimes SWIG cannot generate a proxy class. This occurs when the definition of
22211 a type is not parsed by SWIG, but is then used as a variable or a parameter.
22212 For example,
22213
22214 void foo(Snazzy sds);
22215
22216 If SWIG has not parsed Snazzy it handles it simply as a pointer to a Snazzy.
22217 The Java module gives it a type wrapper class around the pointer and calls it
22218 SWIGTYPE_p_Snazzy. In other words it handles it in the same manner as types are
22219 handled in the low-level functional interface. This approach is used for all
22220 non-proxy classes, eg all pointer to pointers and pointers to primitive types.
22221
22222 4) Backwards compatibility
22223 -----------------------
22224 Backwards compatibility is not an issue if you have been using proxy classes and
22225 no global variables/functions. Otherwise some changes will have to be made.
22226 The native methods still exist but they are now in a JNI class, which is called
22227 modulenameJNI. As this class is really part of the internal workings,
22228 it should not be required so the class has become protected. Some pragmas/directives
22229 will hopefully be added to help with backwards compatibility.
22230
22231 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
22232
2223307/18/2002: beazley
22234 Modified wrapping of uninstantiated templates returned by
22235 value. Just to be safe, they are now wrapped by SwigValueWrapper<>
22236 just in case they don't define a default constructor. This
22237 would be used if you had code like this
22238
22239 Foo<int> blah();
22240 void moreblah(Foo<int> x);
22241
22242 but you didn't instantiate Foo<int> using %template.
22243 We should probably add a warning for this.
22244
2224507/17/2002: beazley
22246 Added an error check to detect shadowed template paramaters.
22247 For example:
22248
22249 template<class T> class Foo {
22250 public:
22251 int T;
22252 };
22253
22254 This results in an error, not a warning. This warning is
22255 also needed to fix some rather insidious problems like
22256 this:
22257
22258 struct T {
22259 int blah;
22260 };
22261
22262 template<class T> class Foo {
22263 public:
22264 typedef T Traits; // Which T is this????
22265 };
22266
22267 In this case, the template parameter T shadows the outer
22268 structure (which is what you want).
22269
2227007/16/2002: beazley
22271 Improved support for templates with integer arguments. SWIG is
22272 much more aware of situations such as this:
22273
22274 const int Size = 100;
22275
22276 %template(Foo100) Foo<100>;
22277 void bar(Foo<Size> *x); // Knows that Foo<Size> is the same as Foo<100>;
22278
2227907/15/2002: beazley
22280 Fixed bug with %feature/%ignore/%rename and namespaces.
22281 For example:
22282
22283 %ignore Foo::Bar
22284 namespace Foo {
22285 class Bar {
22286 ...
22287 };
22288 }
22289
22290 Reported by Marcelo Matus.
22291
2229207/09/2002: beazley
22293 Added parsing support for constructors that try to catch
22294 exceptions in initializers. For example:
22295
22296 class Foo {
22297 Bar b;
22298 public:
22299 Foo(int x) try
22300 : b(x) { ... }
22301 catch(int) {
22302 ...
22303 }
22304 }
22305
22306 This has no effect on the generated wrappers. However, the try and catch
22307 parts of the declaration are ignored. See Stroustrup, 3rd Ed, section
22308 14.4.6.1 for details.
22309
2231007/06/2002: beazley
22311 Fixed bug in template symbol table management. This fixes
22312 two bugs. First, mixing abstract methods, templates, and
22313 inheritance no longer generates a failed assertion.
22314
22315 template <class T>
22316 class A {
22317 public:
22318 virtual void foo() = 0;
22319 };
22320
22321 template <class T>
22322 class B : public A<T>
22323 {
22324 };
22325 %template(A_int) A<int>;
22326 %template(B_int) B<int>;
22327
22328 This fix also fixes a subtle problem with default values and
22329 templates. For example:
22330
22331 template <class C>
22332 struct B {
22333 typedef unsigned int size_type;
22334 static const size_type nindex = static_cast<size_type>(-1);
22335 void foo(size_type index = nindex);
22336 };
22337
22338 Bugs reported by Marcelo Matus.
22339
22340
2234107/05/2002: ljohnson (Lyle Johnson)
22342 [Ruby] Changed the definition of the SWIG_ConvertPtr() function
22343 for the SWIG/Ruby runtime support so that it looks like the
22344 Python version. If the last argument (flags) is non-zero,
22345 SWIG_ConvertPtr() will raise an exception for type mismatches
22346 as before. If flags is zero, this function will return -1 for
22347 type mismatches without raising an exception.
22348
22349 *** POTENTIAL INCOMPATIBILITY FOR RUBY MODULE ***
22350
2235107/04/2002: beazley
22352 Overloaded functions/methods/constructors now work in many language
22353 modules. The support is completely transparent--just call the
22354 function normally and SWIG will dispatch to the correct implementation.
22355 There are a variety of issues associated with this. Please refer
22356 to the overloading section of Doc/Manual/SWIGPlus.html for details.
22357 *** NEW FEATURE ***
22358
2235907/04/2002: beazley
22360 Fixed a bug with namespaces, enums, and templates. For example:
22361
22362 namespace hello {
22363 enum Hello { Hi, Hola };
22364
22365 template <Hello H>
22366 struct traits
22367 {
22368 typedef double value_type;
22369 };
22370
22371 traits<Hi>::value_type say_hi()
22372 {
22373 return traits<Hi>::value_type(1);
22374 }
22375 }
22376 SWIG wasn't generating wrappers that properly qualified
22377 traits<Hi>. Reported by Marcelo Matus.
22378
2237906/30/2002: beazley
22380 Supplied array variable typemaps for Tcl module. If you have a
22381 variable like this:
22382
22383 int foo[10];
22384
22385 then a set function like this is generated:
22386
22387 void foo_set(int *x) {
22388 memmove(foo,x,10*sizeof(int));
22389 }
22390
2239106/30/2002: beazley
22392 New %fragment directive. When writing typemaps, it can be easy to
22393 get carried away and write a lot of code. However, doing so causes
22394 tremendous code bloat. A common way to solve this is to write
22395 helper functions. For example:
22396
22397 %{
22398 void some_helper_function() {
22399 ...
22400 }
22401 %}
22402
22403 %typemap(in) type {
22404 some_helper_function(...);
22405 }
22406
22407 The only problem with this is that the wrapper file gets polluted
22408 with helper functions even if they aren't used. To fix this,
22409 a new fragment directive is available. For example:
22410
William S Fultonacc27452008-06-26 18:33:06 +000022411 (corrected typo in line below - 06/26/2008)
22412 %fragment("type_header","header") %{
William S Fultona3255742002-10-23 19:08:17 +000022413 void some_helper_function() {
22414 ...
22415 }
22416 %}
22417
22418 %typemap(in, fragment="type_header") type {
22419 some_helper_function(...);
22420 }
22421
22422 In this case, the code fragment is only emitted if the typemap is
22423 actually used. A similar capability is provided for declaration
22424 annotation and the %feature directive. For example:
22425
22426 %feature("fragment","type_header") SomeDeclaration;
22427
22428 The first argument to %fragment is the fragment name. The second argument
22429 is the file section where the fragment should be emitted.
22430
22431 The primary use of this directive is for writers of language modules
22432 and advanced users wanting to streamline typemap code.
22433
22434 *** EXPERIMENTAL NEW FEATURE ***
22435
2243606/30/2002: beazley
22437 Supplied memberin typemaps for all arrays in an attempt to eliminate
22438 confusion about their use.
22439
2244006/29/2002: beazley
22441 Experimental support for smart-pointers. When a class defines
22442 operator->() like this
22443
22444 class Foo {
22445 ...
22446 Bar *operator->();
22447 ...
22448 };
22449
22450 SWIG locates class Bar and tries to wrap its member variables and
22451 methods as part of Foo. For example, if Bar was defined like this:
22452
22453 class Bar {
22454 public:
22455 int x;
22456 int spam();
22457 };
22458
22459 You could do this (in the target language):
22460
22461 f = Foo()
22462 f.x = 4 # Accesses Bar::x
22463 f.spam() # Accesses Bar::spam
22464
22465 The primary use of this feature is to emulate the behavior of C++
22466 smart-pointers---which allow attributes to accessed transparently
22467 through operator->.
22468
22469 This feature is supported automatically in SWIG---no special directives
22470 are needed. To disable this behavior. Use %ignore to ignore
22471 operator->.
22472 *** NEW FEATURE ***
22473
2247406/26/2002: beazley
22475 Deprecated the %except directive. %exception should be used instead.
22476
2247706/25/2002: beazley
22478 Major cleanup of the modules directory. Eliminated most
22479 header files, consolidated module code into single files.
22480
2248106/24/2002: beazley
22482 Reworked the instantiation of language modules. All language
22483 modules must now define a factory function similar to this:
22484
22485 extern "C" Language *
22486 swig_python(void) {
22487 return new PYTHON();
22488 }
22489
22490 This function is then placed in a table and associated with
22491 a command line option in swigmain.cxx.
22492
22493 This approach has a number of benefits. It decouples the
22494 SWIG main program from having to know about the class
22495 definitions for each module. Also, by using a factory
22496 function, it will be easier to implement dynamic loading
22497 of modules (simply load the file and invoke the factory
22498 function).
22499
2250006/24/2002: beazley
22501 Fixed syntax error for reference conversions. For example:
22502
22503 operator Foo &();
22504
2250506/24/2002: beazley
22506 Fixed syntax error for operator new[] and operator delete[].
22507
2250806/24/2002: beazley
22509 Fixed code generation problem for constants and default arguments
22510 involving templates.
22511
2251206/19/2002: ljohnson (Lyle Johnson)
22513 [Ruby] Fixed a bug for the '-feature' command line argument;
22514 that setting was effectively being ignored and so the feature
22515 name was always set equal to the module name.
22516
2251706/17/2002: beazley
22518 Fixed problems with static members and enums in templates.
22519
Dave Beazley61932862002-06-17 20:28:59 +000022520Version 1.3.13 (June 17, 2002)
22521==============================
Olly Bettsfdcea432009-02-26 05:53:37 +000022522
Dave Beazley61932862002-06-17 20:28:59 +00002252306/16/2002: beazley
22524 Fixed a bug with __FILE__ expansion in the preprocessor. On Windows,
22525 the backslash (\) is now converted to (\\) in the string literal
22526 used for __FILE__. Reported by Steve Glaser.
22527
2252806/14/2002: beazley
22529 Fixed warning message about 'name private in this context'. The
22530 warning is only generated for public methods. Reported by
22531 Scott Michel.
22532
2253306/14/2002: beazley
22534 Fixed some problems related to template instantiation
22535 and namespaces. When SWIG expands a template, it does
22536 so with fully resolved types. For example, if you have this:
22537
22538 template<class T> class foo { };
22539 typedef double Double;
22540 %template(foo_d) foo<Double>;
22541
22542 then, it is handled as foo<double> in the typesystem.
22543 This fixes a number of subtle problems with inheritance
22544 and templates.
22545
2254606/14/2002: ljohnson (Lyle Johnson)
22547 [Ruby] Added missing bool typemaps for INPUT, OUTPUT and
22548 INOUT in Lib/ruby/typemaps.i.
22549
2255005/29/2002: cheetah (William Fulton)
22551 [Java] Fix for a couple of broken pragmas.
22552
2255305/29/2002: cheetah (William Fulton)
22554 Fix for unnecessary cast when wrapping global variable where
22555 the type is not parsed by SWIG - Java variables example
22556 failure as reported by Larry Virden.
22557
2255806/10/2002: beazley
22559 Modified %template to allow for empty instantiations.
22560
22561 %template() foo<int,int>;
22562
22563 This registers foo<int,int> with the type system, but
22564 doesn't wrap it (same as %ignore). This may only be a
22565 temporary measure. SWIG might be able to automatically
22566 instantiate templates in certain cases.
22567
2256806/10/2002: beazley
22569 Fixed function prototype problems with Tcl 8.4
22570
2257106/09/2002: beazley
22572 Fixed problem with templates and location of base classes.
22573 This one is a little mind-bending, but here is an example
22574 that illustrates:
22575
22576 template <class ArgType, class ResType>
22577 struct traits
22578 {
22579 typedef ArgType arg_type;
22580 typedef ResType res_type;
22581 };
22582
22583 template <class ArgType, class ResType>
22584 struct Function
22585 {
22586 };
22587
22588 template <class AF, class AG>
22589 struct Class : Function<typename traits<AF, AG>::arg_type,
22590 typename traits<AF, AG>::res_type>
22591 {
22592 };
22593
22594 %template(traits_dd) traits <double, double>;
22595 %template(Function_dd) Function <double, double>;
22596 %template(Class_dd) Class <double, double>;
22597
22598
22599 In this example, the base class of 'Class' is determined from
22600 the Function template, but the types are obtained through typedefs.
22601 Because of this, SWIG could not locate the wrapped base class
22602 (Function<double,double>). Should be fixed in 1.3.13 even
22603 though I can think of a million other things that might
22604 also be broken.
22605
2260606/07/2002: beazley
22607 Fixed a problem with conversion operators. If you had an
22608 operator like this,
22609
22610 operator double() const;
22611
22612 SWIG was ommitting the "const" qualifier. This affected
22613 %rename and other directives. Reported by Zhong Ren.
22614
2261506/07/2002: beazley
22616 Lessened the strictness of abstract class checking. If
22617 you have code like this:
22618
22619 class Foo {
22620 public:
22621 virtual int method() = 0;
22622 };
22623
22624 class Bar : public Foo {
22625 public:
22626 Bar();
22627 ~Bar();
22628 };
22629
22630 SWIG will go ahead and generate constructor/destructors
22631 for Bar. However, it will also generate a warning message
22632 that "Bar" might be abstract (since method() isn't defined).
22633 In SWIG-1.3.12, SWIG refused to generate a constructor at all.
22634
2263506/07/2002: beazley
22636 Change to %template directive. If you specify something like this:
22637
22638 %template(vi) std::vector<int>;
22639
22640 It is *exactly* the same as this:
22641
22642 namespace std {
22643 %template(vi) vector<int>;
22644 }
22645
22646 SWIG-1.3.12 tried to instantiate the template outside of the namespace
22647 using some trick. However, this was extremely problematic and full
22648 holes. This version is safer.
22649
2265006/07/2002: beazley
22651 Fixed bug with scope qualification and templates. For example:
22652
22653 A<B::C>::DD
22654
22655 Before, this was separated as scopes A<B, C>, and DD. Fixed now.
22656
2265706/06/2002: beazley
22658 Allow the following syntax:
22659
22660 class A { };
22661 struct B : A { ... };
22662
22663 A base class without a specifier is assumed to be public for a struct.
22664
2266506/06/2002: beazley
22666 Fixed syntax error with template constructor initializers.
22667 Reported by Marcelo Matus.
22668
2266906/06/2002: beazley
22670 Fixed bug with default template arguments.
22671 Reported by Marcelo Matus.
22672
2267306/05/2002: beazley
22674 Fixed subtle problems with %rename directive and template
22675 expansion.
22676
22677 Code like this should now work:
22678
22679 %rename(blah) foo<double>::method;
22680 ...
22681 template<class T> class foo {
22682 public:
22683 void method();
22684 };
22685
22686 %template(whatever) foo<double>;
22687
2268806/05/2002: beazley
22689 Resolved some tricky issues of multi-pass compilation and
22690 and inheritance. The following situation now generates
22691 an error:
22692
22693 class Foo : public Bar {
22694 ...
22695 };
22696
22697 class Bar {
22698 ...
22699 };
22700
22701 The following code generates a warning about incomplete classes.
22702
22703 class Bar;
22704 class Foo : public Bar { };
22705
22706 The following code generates a warning about an undefined class.
22707
22708 class Foo : public Bar { }; // Bar undefined
22709
22710 This fixes a failed assertion bug reported by Jason Stewart.
22711
2271206/05/2002: ljohnson
22713 [Ruby] Added a warning message for the Ruby module about the lack
22714 of support for multiple inheritance. Only the first base class
22715 listed is used and the others are ignored. (Reported by Craig
22716 Files).
22717
2271806/03/2002: beazley
22719 Fixed a bug with struct declarations and typedef. For example:
22720
22721 typedef struct Foo Foo;
22722 struct Foo {
22723 ...
22724 };
22725
22726 A few other subtle struct related typing problems were
22727 also resolved.
22728
Dave Beazley74a64552002-06-02 21:00:22 +000022729Version 1.3.12 (June 2, 2002)
22730=============================
22731
2273205/30/2002: beazley
22733 Fixed problem related to forward template class declarations and
22734 namespaces. Bug reported by Marcelo Matus.
22735
2273605/30/2002: beazley
22737 Added 'make uninstall' target. Contributed by Joel Reed.
22738
2273905/29/2002: beazley
22740 Fixed rather insidious bug with %rename, %feature and template specialization.
22741 For example:
22742
22743 %exception vector::__getitem__ {
22744 ... some exception ...
22745 }
22746
22747 template<class T> class vector {
22748 ...
22749 T __getitem__(int index); // Fine
22750 ...
22751 };
22752
22753 template<> class vector<int> {
22754 ...
22755 T __getitem__(int index); // Oops.
22756 ...
22757 };
22758
22759 Now, the %exception directive (and other features) should correctly apply to
22760 both vector and specializations.
22761
2276205/29/2002: beazley
22763 Subtle changes to %template() directive. Template arguments are now
22764 reduced to primitive types in template matching. For example:
22765
22766 template<class T> class vector<T *> {
22767 ... partial specialization ...
22768 }
22769
22770 typedef int *IntPtr; // Gross typedef
22771
22772 // Gets the above partial specialization
22773 %template(vectorIntPtr) vector<IntPtr>;
22774
22775 This change is extremely subtle, but it fixes a number of potential
22776 holes in Luigi's STL library modules. For example:
22777
22778 typedef int Integer;
22779 %template(vectori) vector<int>;
22780
2278105/29/2002: beazley
22782 Fixed rather insidious typemap bug related to const. const
22783 was being discarded through typedefs.
22784
2278505/29/2002: ljohnson (Lyle Johnson)
22786 [Ruby] Added input typemaps for const references to primitive
22787 types (in Lib/ruby/ruby.swg).
22788
2278905/29/2002: cheetah (William Fulton)
22790 [Java] The java arrray support functions are enclosed by
22791 a SWIG_NOARRAYS #define. Useful if not using arrays and
22792 it is desirable to minimise the amount of compiled code.
22793
2279405/29/2002: cheetah (William Fulton)
22795 [Java] Enums were not renamed when using %name or %rename
22796 fix.
22797
2279805/28/2002: ljohnson
22799 [Ruby] Modified the name of the wrapper functions for the
22800 "new" singleton method and "initialize" instance method for
22801 consistency with the other language modules. The wrapper name
22802 for the function that implements "new" is alloc_classname and
22803 the wrapper name for the function that implements "initialize"
22804 is new_classname.
22805
22806
2280705/27/2002: beazley
22808 Changes to runtime. Pointer conversion/creation functions
22809 now almost always have an extra "flags" argument. For
22810 example:
22811
22812 SWIG_ConvertPtr(obj, void **, swig_type_info *ty, int flags);
22813 ^^^^^^^^^^
22814 This extra parameter is reserved for future expansion and will
22815 be used for more control over pointers in future versions.
22816
2281705/27/2002: beazley
22818 Fix for C++ classes with private assignment operators. It
22819 is now possible to safely return objects like this by value.
22820 Caveat: the class must provide a copy constructor.
22821
2282205/26/2002: beazley
22823 -proxy option added to many language modules. This is the
22824 same as -shadow. We are merely changing terminology.
22825
2282605/26/2002: beazley
22827 [perl] Fixed some inconsistencies in the -package option.
22828 -package merely sets the package name to be used on the
22829 wrappers. It does not change the name of the shared library
22830 file or the name of the generated .pm file. This was
22831 broken at some point, but works again now.
22832
2283305/25/2002: beazley
22834 [perl] Fixed [ 475452 ] memory leak in return-by-value.
22835 Problem related to static member variables returning newly
22836 allocated objects. Reported by Roy Lecates.
22837
2283805/25/2002: beazley
22839 [perl] Fixed [ 513134 ] %BLESSEDMEMBERS isn't always right.
22840 Reported by Fleur Diana Dragan.
22841
2284205/25/2002: beazley
22843 Fixed [ 540735 ] -importall and the -I option.
22844
2284505/25/2002: beazley
22846 [guile] Fixed [ 532723 ] Default arg for char* can SegV.
22847 Error in guile module. Reported by Brett Williams.
22848
2284905/25/2002: beazley
22850 Subtle change to typemap application code. The "freearg"
22851 typemap must exactly match up with the "in" or "ignore"
22852 typemap. For example:
22853
William S Fultonec965842022-08-20 15:23:15 +010022854 %typemap(in) (char *data, int len) { ... }
22855 %typemap(freearg) char *data { ... }
Dave Beazley74a64552002-06-02 21:00:22 +000022856
22857 void foo(char *data, int len);
22858
22859 In this case, the "in" typemap is applied, but the
22860 freearg typemap is not. This is because the freearg
22861 typemap doesn't match up with the input argument sequence.
22862
2286305/25/2002: beazley
22864 Fixed [ 548272 ] Default argument code missing braces.
22865 Reported by Brett Williams.
22866
2286705/25/2002: beazley
22868 Fixed [ 547730 ] SwigValueWrapper needed for constructors.
22869 Reported by William Fulton.
22870
2287105/25/2002: beazley
22872 Undefined identifiers now evaluate to 0 when evaluating
22873 preprocessor expressions. For example:
22874
22875 #if !FOO
22876 ...
22877 #endif
22878
22879 where FOO is undefined or set to some non-numeric value.
22880
22881 Fixes [ 540868 ] #if defined whatever - not parsed.
22882 Reported by Adam Hupp.
22883
22884
2288505/24/2002: beazley
22886 SWIG now ignores the C++ 'export' keyword.
22887
2288805/23/2002: beazley
22889 Some refinement of type-name mangling to account for pointers, arrays,
22890 references, and other embedded type constructs.
22891
2289205/23/2002: beazley
22893 Initial attempt at supporting template partial specialization. At
22894 the very least, it is parsed and the classes are stored. Matching
22895 of instantiations to specialized version is more limited and based on
22896 the SWIG default typemap rules:
22897
22898 SWIGTYPE *
22899 SWIGTYPE []
22900 SWIGTYPE &
22901
22902 Now, why in the world would you want to use this feature? Other
22903 than allowing for slightly modified class APIs, this capability is
22904 primarily used to provide advanced wrapping support for STL-like
22905 objects. It can also be mixed with typemaps. Here is an example:
22906
22907
22908 /* Generic version */
22909 template<class T> class vector {
22910 %typemap(in) vector<T> * {
22911 // A container of objects
22912 }
22913 };
22914 /* Partial specialization (pointers) */
22915 template<class T> class vector<T *> {
22916 %typemap(in) vector<T> * {
22917 // A container of pointers to objects.
22918 }
22919 };
22920 /* Specialization (integers). */
22921 template<> class vector<int> {
22922 %typemap(in) vector<int> * {
22923 // A container of integers.
22924 }
22925 };
22926
22927 *** EXPERIMENTAL FEATURE ***
22928
2292905/23/2002: beazley
22930 Enhancement to typemaps. Normally, typemap variables are
22931 renamed to avoid conflicts. For example:
22932
22933 %typemap(in) int * (int temp) {
22934 $1 = &temp;
22935 }
22936
22937 This results in code that creates and uses variables "temp1","temp2",
22938 "temp3" and so forth depending on how many times the typemap is used.
22939 Sometimes you want a single variable instead. To do that, using
22940 the following naming scheme:
22941
22942 %typemap(in) int *(int _global_temp) {
22943 }
22944
22945 Is this case, a single variable _global_temp is emitted in the
22946 wrapper functions. It is shared across all typemaps. Repeated
22947 typemaps do not replicate the variable---they use the first one
22948 emitted.
22949 *** NEW FEATURE ***
22950
2295105/23/2002: beazley
22952 Minor enhancement to typemaps. If you have this code,
22953
22954 %typemap(in) Foo (int somevar = 3) {
22955 ...
22956 }
22957
22958 the default value for somevar is now emitted into the wrapper code.
22959
2296005/22/2002: beazley
22961 Fixed %extend to be better behaved in namespaces. If you have code
22962 like this:
22963
22964 namespace foo {
22965 struct bar {
22966 %extend {
22967 void blah();
22968 };
22969 };
22970 }
22971
22972 SWIG matches the blah() method to a C function named
22973 void foo_bar_blah(foo::bar *self).
22974
22975 This is consistent with the non-namespace version.
22976 Bug reported by Marcelo Matus.
22977
2297805/22/2002: beazley
22979 New library files: cpointer.i, carrays.i, cmalloc.i. These
22980 provide access to C pointers and memory allocation functions.
22981 See Doc/Manual/Library.html for details.
22982
2298305/22/2002: cheetah (William Fulton)
22984 [Java] C type char no longer maps to Java type byte, but to Java type char.
22985 It is now treated as a character rather than a signed number. This fits in
22986 with the other language modules and is a more natural mapping as char* is
22987 mapped as a string of characters. Note that the C signed char type is still
22988 mapped to a Java byte.
22989
22990 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
22991
2299205/22/2002: cheetah (William Fulton)
22993 [Java] Improved constants wrapping. Constants (#define and %constant) values
22994 are now obtained through a JNI call. Previously the value was compiled as
22995 Java code, but this didn't work for all cases, eg #define 123ULL.
22996
2299705/22/2002: beazley
22998 Fixed bogus error message with %extend directive and C++
22999 access specifiers. Reported by Marcelo Matus.
23000
2300105/22/2002: beazley
23002 Namespaces and enums now work correctly. For example:
23003
23004 namespace Foo {
23005 enum Bar { A, B };
23006 }
23007
23008 Bug reported by Marcelo Matus.
23009
2301005/21/2002: beazley
23011 The %types directive can now be used to specify inheritance relationships
23012 in the runtime type system. For example,
23013
23014 %types(Foo = Bar);
23015
23016 specifies that Foo isa Bar. Using this is potentially quite dangerous.
23017 However, this is useful in certain cases (and in the SWIG library).
23018
2301905/20/2002: beazley
23020 %nodefault and %makedefault directives now require a trailing semicolon.
23021 For example:
23022
23023 %nodefault;
23024 ...
23025 %makedefault;
23026
23027 In addition both directives can take a class name. For example:
23028
23029 %nodefault Foo;
23030
23031 class Foo { /* No default constructor/destructor */
23032 };
23033
23034 class Bar { /* Default constructor/destructor generated */
23035 };
23036
23037 *** POTENTIAL INCOMPATIBILITY ***
23038 If you don't use the trailing semicolon, things will mysteriously break.
23039
2304005/20/2002: beazley
23041 More improvements to type system handling. SWIG now correctly handles
23042 template names and parameters in a namespace. For example:
23043
23044 namespace foo {
23045 template<class T> class bar { };
23046 typedef int Integer;
23047
23048 void blah(bar<Integer> *x);
23049 };
23050
23051 In the generated code, all of the typenames are properly qualified.
23052
2305305/17/2002: cheetah (William Fulton)
23054 [Java] deprecated broken -jnic and -jnicpp commandline options. The C or C++
23055 JNI calling convention is now determined from the -c++ commandline option.
23056
2305705/16/2002: cheetah (William Fulton)
23058 [Java] The JCALL macros which exist so that the same typemaps can be used
23059 for generating both the C and C++ JNI calling conventions no longer appear
23060 in the generated code. This is because the output is now passed through the
23061 SWIG preprocessor which does the macro expansion for either C or C++ (depending
23062 on whether -c++ is passed on the SWIG commandline).
23063
23064 The generation of the functions used in the array typemaps have been adjusted
23065 to take account of this. The side effect is that any typemaps which contained
23066 JCALL macros within %{ %} brackets will have to be moved within {} brackets
23067 so that the SWIG preprocessor can expand the macros.
23068
23069 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
23070
2307105/13/2002: beazley
23072 Class templates may now be used as template parameters. For example:
23073
23074 template<class T, template<class> class C> class Foo {
23075 ...
23076 };
23077 template<class T> class Bar {
23078 ...
23079 };
23080
23081 %template(Fooi) Foo<int, Bar>;
23082
23083 SWIG doesn't really do anything special with this---it's just
23084 another way of specifying a template parameter.
23085
2308605/13/2002: beazley
23087 Minor refinement of template support. Template parameter names are no longer
23088 required for types. For example:
23089
23090 template<bool> class Foo {
23091 };
23092
23093 Obviously, names are required for template<class T>;
23094
2309505/12/2002: beazley
23096 New macro expansion in typemaps. The sequence:
23097
23098 $descriptor(type)
23099
23100 Will expand into the SWIG type descriptor structor for
23101 the given type. Type may be any abstract datatype.
23102 For example:
23103
23104 $descriptor(int *)
23105 $descriptor(int (*)(int,double))
23106 $descriptor(vector<int> *)
23107
23108 Caveat: It is *NOT* currently legal to use other typemap
23109 substitution variables in the macro. For example
23110 $descriptor($1_type).
23111
23112 The primary purpose of this modification is to better
23113 support typemaps for container objects or to allow typemaps
23114 that might be performing type conversions.
23115 *** NEW FEATURE ***
23116
2311705/11/2002: beazley
23118 The wrapping of references to primitive types has been
23119 changed as follows:
23120
23121 Arguments of type 'const primitive &' are now passed
23122 by value as opposed to pointers. Return values of
23123 type 'const primitive &' are returned as values instead of
23124 pointers.
23125
23126 'primitive' is any one of int, short, long, long long,
23127 char, float, double, bool (as well as unsigned variants).
23128
23129 This change is being made to better support C++ wrapping--especially
23130 code that makes use of templates and the STL.
23131
2313205/11/2002: beazley
23133 The %template directive can now be used to access templates
23134 in a namespace. For example:
23135
23136 namespace std {
23137 template<class T> class complex {
23138 T re, im;
23139 public:
23140 complex(T _r = T(), T _i = T()) : re(_r), im(_i) { }
23141 T real() { return re; }
23142 T imag() { return im; }
23143 };
23144 }
23145
23146 %template(complex) std::complex<double>;
23147
23148 Note: There are some very subtle namespace/symbol table
23149 management issues involved in the implementation of this.
23150 It may not work in certain cases.
23151
2315205/10/2002: beazley
23153 Member template constructor support added. For example:
23154
23155 template<typename _T1, typename _T2>
23156 struct pair {
23157 _T1 first;
23158 _T2 second;
23159 pair() : first(_T1()), second(_T2()) { }
23160 template<class _U1, class _U2> pair(const pair<_U1,_U2> &x);
23161 };
23162
23163 To instantiate the template, use %template and %extend.
23164 For example, this expands the constructor into a default
23165 copy constructor:
23166
23167 %extend pair {
23168 %template(pair) pair<_T1,_T2>;
23169 }
23170
23171 Highly experimental. Other uses may be broken.
23172
2317305/10/2002: beazley
23174 The %extend (%addmethods) directive no longer works unless
23175 it appears in the public section of a class. An error
23176 message is now generated (as opposed to a segmentation fault).
23177
2317805/09/2002: beazley
23179 New %warnfilter() directive. This directive attaches a warning
23180 filter to specific declarations and has the same semantics as
23181 %rename, %ignore, %feature, and so forth. For example:
23182
23183 %warnfilter(501) foo; // Suppress overloaded warning
23184 int foo(int);
23185 int foo(double);
23186
23187 or
23188
23189 %warnfilter(501) Object::foo(double);
23190 class Object {
23191 public:
23192 int foo(int);
23193 int foo(double);
23194 };
23195
23196 This feature only suppresses warnings in later stages of code
23197 generation. It does not suppress warnings related to preprocessing
23198 or parsing.
23199 *** NEW FEATURE ***
23200
2320105/09/2002: beazley
23202 SWIG now supports C99 variadic preprocessor macros. For example:
23203
23204 #define debugf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
23205
23206 The argument "..." is used to indicate variable arguments which
23207 are all placed into the special argument name __VA_ARGS__ in
23208 the macro expansion.
23209
23210 SWIG also implements the GNU (##) extension for swallowing the
23211 preceding comma when __VA_ARGS__ is empty. For example:
23212
23213 #define debugf(fmt,...) fprintf(stderr,fmt, ##__VA_ARGS__)
23214
23215 Here is how this is expanded:
23216
23217 debugf("%d", 3) --> fprintf(stderr,"%d",3)
23218 debugf("Hello") --> fprintf(stderr,"Hello" )
23219
23220 (notice the deleted comma).
23221 *** NEW FEATURE ***
23222
2322305/08/2002: samjam (Sam Liddicott)
23224 Many changes to php module. Shadow classes are now implemented
23225 entirely in native C and no need for php-code shadow wrappers
23226 Populated template config.m4 and Makefile.in as needed by
23227 phpize are generated.
23228
2322905/08/2002: ljohnson (Lyle Johnson)
23230 [Ruby] A copy constructor is now turned into a "clone"
23231 instance method (see Dave's change for copy constructors
23232 dated 4/7/2002). This seems like the appropriate thing
23233 to do for Ruby code.
23234
2323505/08/2002: ljohnson (Lyle Johnson)
23236 [Ruby] Fixed [ 553864 ] Inline destructor code not written.
23237
2323805/08/2002: beazley
23239 %ignore behaves better with constructors, destructors, and the
23240 type system in general. For constructors and destructors,
23241 %ignore now suppresses the creation of a default constructor
23242 or destructor. For example:
23243
23244 %ignore ~Foo;
23245 class Foo {
23246 public:
23247 Foo();
23248 ~Foo();
23249 ...
23250 };
23251
23252 In SWIG-1.3.11, ~Foo() simply "disappeared" and the code generator
23253 created a wrapper for a default destructor (as if it was never
23254 declared in the interface). In SWIG-1.3.12, %ignore suppresses
23255 the creation of a destructor if one is actually defined.
23256
23257 Similarly, even though a declaration is ignored, information
23258 may still be needed to properly handle types. For example, here
23259 is a very subtle error that is fixed by this change:
23260
23261 %ignore std::string; // Prevent class wrapping
23262 namespace std {
23263 class string {
23264 ...
23265 };
23266 %typemap(in) string * {
23267 ...
23268 }
23269 }
23270
23271 void foo(std::string *s); // Broken.
23272
23273 Before this fix, %ignore would cause the class definition to disappear.
23274 This, in turn, would cause the typemap to be misapplied.
23275
2327605/08/2002: beazley
23277 Minor changes to %rename, %ignore, %feature, and related directives
23278 for better support of destructors. Destructors can now be precisely
23279 tagged. For example:
23280
23281 %ignore Foo::~Foo;
23282 %feature("action") ~Bar {
23283 ...
23284 }
23285
23286 *Developer warning*
23287 Operations such as renaming and feature attachment for classes used to
23288 be applied to destructors as well. For instance, if you did this:
23289
23290 %rename(Bar) Foo;
23291
23292 The operation applied to the class itself, the constructor, and
23293 the destructor. This is no longer the case. Now such operations
23294 will only apply to the class and the constructor. Note: if you
23295 were relying on this for class renaming, be aware that renamed
23296 classes should really only be handled at the level of the class itself
23297 and not the level of individual declarations in the class (although
23298 they can be renamed individually if needed). As far as I know,
23299 the Language class is already taking care of this case correctly.
23300
2330105/07/2002: beazley
23302 New set of tests. The Examples/test-suite/errors directory contains
23303 tests that try to exercise all of SWIG's error and warning messages.
23304
2330505/07/2002: beazley
23306 Start of a warning framework. Warning messages are now assigned numeric values
23307 that are shown in warning messages. These can be suppressed using the
23308 -w option. For example:
23309
23310 swig -w302 example.i
23311 swig -w302,305 example.i
23312
23313 Alternatively, the #pragma preprocessor directive can be used to disable this:
23314
23315 #pragma SWIG nowarn=302
23316 #pragma SWIG nowarn=302,305
23317
23318 Note: Since SWIG is a multi-pass compiler, this pragma should
23319 only be used to change global settings of the warning filter. It should
23320 not be used to selectively enable/disable warnings in an interface file.
23321 The handling of #pragma occurs in the C++ preprocoessor and affects all
23322 subsequent stages of compilation.
23323
23324 The -Wall option turns on all warnings and overrides any filters that
23325 might have been set.
23326
23327 Warnings can be issued from an interface using %warn. For example:
23328
23329 %warn "110:%section is deprecated"
23330
23331 The first part of a warning message is an optional warning number.
23332 A complete set of warning numbers is found in Source/Include/swigwarn.h.
23333 *** NEW FEATURE ***
23334
2333505/07/2002: beazley
23336 Internal parsing change. Directives to include files now use brackets [ ... ]
23337 instead of { ... }.
23338
23339 %includefile "foo.i" [
23340 ...
23341 ]
23342
23343 The use of { ... } was a bad choice because they were included implicitly by
23344 the preprocessor and made it impossible to properly detect legitimate missing '}'
23345 errors.
23346
2334704/16/2002-
2334805/02/2002: beazley
23349 SWIG European Tour: Paris-Amsterdam-Bath.
23350
2335104/23/2002: beazley
23352 The %addmethods directive has been renamed to %extend.
23353 For example:
23354
23355 class Foo {
23356 ...
23357 };
23358
23359 %extend Foo {
23360 int blah() { ... };
23361 int bar() { ... };
23362 ...
23363 };
23364
23365 Motivation: the %addmethods directive can be used for many
23366 other tasks including adding synthesized attributes, constructors,
23367 and typemaps. Because of this, "addmethods" is somewhat misleading.
23368 %extend more precisely describes this operation---extension of a
23369 class or structure.
23370
23371 *** POTENTIAL INCOMPATIBILITY ***
23372 %addmethods still works via a macro definition. However,
23373 a warning message may be generated. Errors involving %addmethods
23374 will actually refer to the %extend directive.
23375
2337604/23/2002: beazley
23377 Further refinement of the type system. Typedef now
23378 propagates through functions, pointers to functions,
23379 and pointers to member functions.
23380 For example:
23381
23382 typedef int Integer;
23383 void foo(int (*x)(int), Integer (*y)(Integer));
23384
23385 In this case, arguments 'x' and 'y' have exactly
23386 the same type (and would obviously accept objects
23387 of either type).
23388
23389 Similarly, consider this:
23390
23391 class Foo {
23392 };
23393
23394 typedef Foo Bar;
23395 void bar(int (Foo::*x)(int), int (Bar::*y)(int));
23396
23397 In this case, arguments x and y are the same
23398 type (via typedef).
23399
2340004/22/2002: beazley
23401 SWIG now generates a warning message if any part of
23402 an expression involves values from a private part of a class.
23403 For example:
23404
23405 class Foo {
23406 private:
23407 static int X;
23408 public:
23409 void blah(int a, int b = X); // Warning
23410 };
23411
23412 In this case, the default argument is ignored. There
23413 are workarounds, but they are rather clumsy. For instance,
23414 you might do this:
23415
23416 %feature("action") blah(int,int) {
23417 if ($nargs == 1) {
23418 result = blah(arg1);
23419 } else {
23420 result = blah(arg1,arg2);
23421 }
23422 }
23423 void blah(int a, int b = 0);
23424
23425
2342604/21/2002: beazley
23427 Use of the %inline directive inside a namespace is
23428 forbidden and now generates an error message. This is
23429 not allowed since the inlined code that is emitted is
23430 not placed inside a namespace. This confuses other
23431 stages of parsing.
23432
2343304/21/2002: beazley
23434 Some bug fixes to casting operations and expression
23435 parsing. Due to some parsing issues, it is not
23436 currently possible to use casts for all possible
23437 datatypes. However, the common cases work.
23438
2343904/20/2002: beazley (Amsterdam)
23440 Member templates now work. Simply use the %template
23441 directive inside a class or %addmethods to create
23442 instantiations (see Doc/Manual/SWIGPlus.html). Supporting
23443 this was easy---earlier changes to templates made it
23444 possible using only a two-line modification to the parser
23445 and a few minor modifications elsewhere. Hmmm, come to
23446 think of it, the smoke was rather thick in that Internet "cafe".
23447 *** NEW FEATURE ***
23448
2344904/19/2002: beazley (TGV)
23450 Improved handling of non-type template parameters. For example:
23451
23452 vector<int,100>;
23453
23454 Simple numbers and strings can be used with the %template
23455 directive as well. For example:
23456
23457 %template(vecint100) vector<int,100>;
23458
23459 Note: Arithmetic expressions are not currently allowed.
23460
23461 Default template arguments now work and do not have to
23462 be given to %template.
23463
2346404/18/2002: beazley (Paris)
23465 Change in internal template handling. Template
23466 parameters are now fully integrated into the type
23467 system and are aware of typedefs, etc. This builds
23468 upon the change below.
23469
23470 *** DEVELOPER WARNING ***
23471 Word of caution to language module writers. The "name"
23472 parameter of certain parse tree nodes (classes, functions, etc.)
23473 may be parameterized with types. This parameterization is
23474 done using SWIG type-strings and not the underlying C version.
23475 For example,
23476
23477 int max<int *>(int *,int *)
23478
23479 has a name of "max<(p.int)>". If you use the name directly,
23480 you may get syntax errors in the generated code. To fix this,
23481 use SwigType_namestr(name) to convert a parameterized name
23482 to a C name with valid syntax. The internal version is
23483 used to reduce template types to a common representation
23484 and to handle issues of typedef.
23485
2348604/16/2002: beazley (somewhere over the Atlantic)
23487 Enhancement of typedef resolution. The type system is now
23488 aware of template arguments and typedef. For example:
23489
23490 typedef int Integer;
23491
23492 foo(vector<int> *x, vector<Integer> *y);
23493
23494 In this case, vector<int> and vector<Integer> are
23495 the same type. There is some interaction between this
23496 mechanism and the implementation of typemaps. For example,
23497 a typemap defined for vector<int> * would apply to either type.
23498 However, a typemap for vector<Integer> * would only apply to
23499 that type.
23500
23501 Typedefs and typemaps and matched by left-most expansion.
23502 For example:
23503
23504 vector<Integer,Integer> -->
23505 vector<int, Integer> -->
23506 vector<int, int>
23507
23508
2350904/24/2002: cheetah (William Fulton)
23510 [Java] Changes to Java shadow classes.
23511 Overcomes a bug where the module assumed that a pointer to a derived
23512 class could be used in place of a pointer to a base class. Thanks
23513 to Stephen McCaul for analysing the bug and submitting patches.
23514
23515 A consequence is that the getCPtr() method in each shadow class has
23516 disappeared and has been replaced with a getCPtrXXX(), where XXX is the
23517 shadow class name. If you have code that previously used getCPtr(),
23518 and the associated class is wrapping a C struct or a C++ class that
23519 is not involved in an inheritance chain, just use the new method. If
23520 however, the class is involved in an inheritance chain, you'll have
23521 to choose which pointer you really want. Backwards compatibility
23522 has been broken as not using the correct pointer can lead to weird bugs
23523 through ill-defined behaviour. If you are sure you want the old methods,
23524 you could add them back into all shadow classes by adding this at the
23525 beginning of your interface file:
23526
23527 %pragma(java) allshadowcode=%{
23528 public long getCPtr(){
23529 return swigCPtr;
23530 }
23531 %}
23532
William S Fultona3255742002-10-23 19:08:17 +000023533 Please see entry dated 07/23/2002 to see how to do this after the deprecation
23534 of the allshadowcode pragma.
23535
Dave Beazley74a64552002-06-02 21:00:22 +000023536 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
23537
2353804/13/2002: beazley
23539 Fixed problem with default arguments and references. Declarations such
23540 as this should now work:
23541
23542 void foo(const string &x = "Hello");
23543
2354404/12/2002: beazley
23545 Added typemap $* substitutions for typemaps involving arrays.
23546 Requested by William Fulton.
23547
2354804/11/2002: beazley
23549 Template specialization is now supported. For example:
23550
23551 template<> class vector<int> {
23552 ...
23553 };
23554
23555 When the %template directive is used, it will use a specialization
23556 if one is defined. There are still some limitations. Partial
23557 specialization is not supported. A template of type <void *> does
23558 not match all pointers.
23559 *** NEW FEATURE ***
23560
2356104/11/2002: beazley
23562 Major change to template wrapping internals. Template declarations are
23563 no longer processed as macros but now result in real parse-tree
23564 nodes. The %template directive expands these nodes into a
23565 specific instantiation. This change enables a number of
23566 new and interesting capabilities:
23567
23568 Directives such as %rename, %feature, and %addmethods can
23569 now be applied to uninstantiated templates. For example:
23570
23571 %rename(barsize) vector::bar(char *buf, int len);
23572 ...
23573 template<typename T> class vector {
23574 public:
23575 ...
23576 void bar(char *buf);
23577 void bar(char *buf, int len); // Renamed
23578 ...
23579 };
23580
23581 %template(intvector) vector<int>; // Renaming carries through
23582
23583
23584 By parsing templates into an internal data structure, it will
23585 be possible to support specialization (and maybe partial
23586 specialization).
23587
23588 This is highly experimental and a work in progress.
23589
23590 *** POTENTIAL INCOMPATIBILITY ***
23591 In SWIG-1.3.11, template declarations were simply processed
23592 as weird macros. No other information was retained. This
23593 made it impossible to support more advanced features and
23594 complicated many other parts of the implementation.
23595
2359604/09/2002: beazley
23597 Change to template class wrapping. There were a variety of
23598 "issues" with the old approach related to parsing, the type
23599 system, and namespaces. These changes are meant to rectify
23600 some of these problems:
23601
23602 A specific instantiation of a template can now be specified
23603 by including the class inline like this:
23604
23605 class vector<int> {
23606 public:
23607 vector();
23608 ~vector();
23609 ... whatever ...
23610 };
23611
23612 This is template specialization, but partial specialization is
23613 not yet implemented.
23614
23615 The %template directive has been modified to expand roughly as
23616 follows:
23617
23618 %template(vecint) vector<int>;
23619
23620 becomes
23621
23622 %rename(vecint> vector<int>;
23623 class vector<int> {
23624 public:
23625 vector();
23626 ...
23627 };
23628
23629 Note that this simply builds upon the code above (templates
23630 included inline).
23631
23632 This modified approach to wrapping fixes some subtle type
23633 issues. For instance, you can now define typemaps and typedefs
23634 like this:
23635
23636 %typemap(in) vector<int> * {
23637 ...
23638 }
23639 typedef vector<int> intvector;
23640 ...
23641 void blah(intvector *v); // Gets the above typemap
23642
23643 This did not work in SWIG-1.3.11 due to a peculiarity of
23644 the template implementation.
23645
23646 %template(name) no longer installs the template as a class
23647 with name "name". This might break %addmethods as described
23648 in the manual. For example:
23649
23650 %template(vecint) vector<int>;
23651 %addmethods vecint { // Fails. vecint not a class
23652 ...
23653 };
23654
23655 To fix this, just use the template name instead:
23656
23657 %addmethods vector<int> {
23658 ...
23659 }
23660
23661 Note: This technique might be a way to implement some bizarre
23662 template specialization techniques. For example:
23663
23664 %addmethods vector<int> {
23665 // Only applied if vector<int> instantiated later
23666 %typemap(in) vector<int> * {
23667 ...
23668 }
23669 ...
23670 };
23671
23672 *** POTENTIAL INCOMPATIBILITY ***
23673
2367404/08/2002: beazley
23675 Fixed [ 540868 ] #if defined whatever - not parsed. SWIG should
23676 now correctly handle preprocessor directives like this:
23677
23678 #if defined __cplusplus
23679 ...
23680 #endif
23681
23682 Note: was implemented previously, but there was a minor bug.
23683 Reported by Adam Hupp.
23684
2368504/07/2002: beazley
23686 %readonly and %readwrite are deprecated due to a change in the
23687 implementation. Instead of being pragmas, mutability is now
23688 controlled as a "feature" using the following two directives:
23689
23690 %immutable;
23691 int x; // read-only variable
23692 int y; // read-only variable
23693 %mutable;
23694 int z; // Modifiable
23695
23696 %immutable and %mutable are much more powerful than their older
23697 counterparts. They can now pinpoint a specific declaration like
23698 this:
23699
23700 %immutable x; /* Any x */
23701 %immutable Foo::x; /* x in class Foo */
23702
23703 In fact, the matching algorithm is the same as for %rename,
23704 %ignore, and other directives. This means that the declaration
23705
23706 %immutable Foo::x;
23707
23708 would not only apply to class Foo but to all derived classes
23709 as well.
23710
23711 *** POTENTIAL INCOMPATIBILITY ***
23712 %immutable and %mutable must be terminated by a semi-colon. This
23713 differs slightly from the older %readonly and %readwrite directives.
23714 Since %immutable and %mutable can be applied to declarations the
23715 semicolon is needed to distinguish between a global feature and
23716 one targeted to a single declaration. Note: this incompatibility is the
23717 primary reason for changing the name of the directive.
23718
2371904/07/2002: beazley
23720 New handling of copy constructors. If a class defines
23721 constructors like this:
23722
23723 class Foo {
23724 public:
23725 Foo();
23726 Foo(const Foo &); // Copy constructor
23727 ...
23728 };
23729
23730 SWIG now generates a function copy_Foo() for the copy
23731 constructor.
23732
23733 In previous verions, this generated a name-clash and an
23734 error message. To preserve backwards compatibility, SWIG
23735 does not change the behavior if %rename is used to resolve
23736 the name conflict. However, if no name resolution is made,
23737 this new approach is used.
23738
23739 Copy constructors may be handled as a special case in the
23740 target language. However, this is up to the language module
23741 itself.
23742
2374304/07/2002: beazley
23744 The %template directive is now namespace aware. This allows
23745 code like this:
23746
23747 namespace foo {
23748 template<typename T> max(T a, T b) { return a > b ? a : b; }
23749 }
23750
23751 using namespace foo;
23752 %template(maxint) max<int>; // Ok
23753
23754 namespace bar {
23755 using foo::max;
23756 %template(maxdouble) max<double>; // Ok
23757 }
23758
23759 Caveat: the template name supplied to %template must be defined in the
23760 same scope in which the %template directive appears. This code is
23761 illegal:
23762
23763 %template(maxint) foo::max<int>;
23764
2376504/07/2002: beazley
23766 Minor enhancement to preprocessor. The preprocessor can now perform
23767 string comparison. For example:
23768
23769 #define A "hello"
23770 ...
23771 #if A == "hello"
23772 ...
23773 #endif
23774
23775 The primary use of this is in SWIG macros. For example:
23776
23777 %define FOO(x)
23778 #if #x == "int"
23779 /* Special handling for int */
23780 ...
23781 #endif
23782 %enddef
23783
23784 Normal users can probably safely ignore this feature. However, it may
23785 be used in parts of the SWIG library.
23786
2378704/07/2002: beazley
23788 Further refinement of default constructor/destructor wrapper generation.
23789 SWIG is now much more aware of pure virtual methods. For instance:
23790
23791 class A { /* Abstract */
23792 public:
23793 virtual void method1() = 0;
23794 virtual void method2() = 0;
23795 };
23796 class B : public A { /* Abstract */
23797 public:
23798 virtual void method1() { };
23799 };
23800
23801 class C : public B { /* Ok */
23802 public:
23803 virtual void method2() { };
23804 };
23805
23806 In this case, SWIG will only generate default constructors for C.
23807 Even though B looks fine, it's missing a required method and is abstract.
23808
2380904/04/2002: beazley
23810 Subtle change to structure data member access. If you
23811 have a structure like this:
23812
23813 struct Foo {
23814 Bar b;
23815 };
23816
23817 The accessor functions for b are generated as follows:
23818
23819 (1) If b is *not* defined as a structure or class:
23820
23821 Bar Foo_b_get(Foo *self) {
23822 return self->b;
23823 }
23824 void Foo_b_set(Foo *self, Bar value) {
23825 self->b = value;
23826 }
23827
23828 (2) If b *is* defined as a structure or class:
23829
23830 Bar *Foo_b_get(Foo *self) {
23831 return &self->b;
23832 }
23833 void Foo_b_set(Foo *self, Bar *value) {
23834 self->b = *value;
23835 }
23836 See the "Structure data members" section of Doc/Manual/SWIG.html
23837 for further details.
23838
23839 *** POTENTIAL INCOMPATIBILITY ***
23840 This may break interfaces that relied on a lot of a undeclared
23841 structure and class names. To get the old behavior, simply
23842 use a forward declaration such as "struct Bar;"
23843
2384404/04/2002: beazley
23845 C++ namespace support added. SWIG supports all aspects of
23846 namespaces including namespace, using, and namespace alias
23847 declarations. The default behavior of SWIG is to flatten
23848 namespaces in the target language. However, namespaces are
23849 fully supported at the C++ level and in the type system.
23850 See Doc/Manual/SWIGPlus.html for details on the implementation.
23851
2385204/02/2002: cheetah (William Fulton)
23853 [Java] Sun has modified javac in jdk1.4 to no longer compile
23854 an import of an unnamed namespace. To fix this SWIG no longer
23855 generates the import for packageless classes.
23856 http://developer.java.sun.com/developer/bugParade/bugs/4361575.html
23857 As reported SF #538415.
23858
2385903/27/2002: ljohnson (Lyle Johnson)
23860 [Ruby] Added support for pointer-to-member, similar to that
23861 for the Python module. Remarkably similar. Also added a new
23862 example for this (Examples/ruby/mpointer), which is remarkably
23863 similar to the Python example of the same name.
23864
2386503/26/2002: ljohnson (Lyle Johnson)
23866 [Ruby] Made a few minor edits to the "Advanced Topics"
23867 chapter of the SWIG manual and added a new major section
23868 about how to create multi-module Ruby packages with SWIG.
23869
2387003/26/2002: ljohnson (Lyle Johnson)
23871 [Ruby] Removed all of the old Ruby pragmas. If any of this
23872 functionality is truly missed we can resurrect it, preferably
23873 with some kind of feature-based directive.
23874
2387503/25/2002: ljohnson (Lyle Johnson)
23876 [Ruby] Fixed SWIG exception library support for Ruby, which
23877 has apparently been broken for some time. Luckily, no one seems
23878 to have noticed.
23879
2388003/23/2002: beazley
23881 C++-namespace support in SWIG directives.
23882
23883 %addmethods:
23884
23885 The %addmethods directive now accepts a fully qualified classname
23886 and can be used inside C++ namespace declarations. For example:
23887
23888 // Attaches to the class Foo::Bar below
23889 %addmethods Foo::Bar {
23890 int somemethod() { ... }
23891 };
23892
23893 namespace Foo {
23894 class Bar {
23895 public:
23896 ...
23897 };
23898
23899 // Attaches to the class Bar above
23900 %addmethods Bar {
23901 int othermethod() { ... };
23902 }
23903 }
23904
23905 %feature, %rename, %ignore, %exception, and related directives:
23906
Sylvestre Ledru7dac1bc2012-08-08 09:19:26 +000023907 Namespaces are fully integrated into the renaming and declaration
Dave Beazley74a64552002-06-02 21:00:22 +000023908 matcher. For example:
23909
23910 %rename(display) Foo::print; // Rename in namespace Foo
23911 %ignore Foo::Bar::blah; // Ignore a declaration
23912
23913 %rename directives can be placed inside namespace blocks as well. For
23914 example:
23915
23916 namespace Foo {
23917 %rename(display) print; // Applies to print below
23918
23919 void print();
23920 };
23921
23922 Most other SWIG directives should work properly inside namespaces.
23923 No other changes are needed.
23924
2392503/22/2002: beazley
23926 Some changes to internal symbol table handling. SWIG no longer
23927 manages structures and unions in a separate namespace than normal
23928 declarations like ANSI C. This means you can't have a structure
23929 with the same name as a function. For example:
23930
23931 struct Foo {
23932 ...
23933 }
23934
23935 int Foo() { ... }
23936
23937 This approach is more like C++. It's not clear that SWIG ever
23938 really supported the ANSI C anyways---using the same name would
23939 almost certainly generate a name-clash in the target language.
23940
2394103/22/2002: ljohnson (Lyle Johnson)
23942 [Ruby] Fixed [ 517302 ] for handling of renamed overloaded
23943 constructors. Now, renamed overloaded constructors are converted
23944 into class singleton methods (basically acting as "factory"
23945 methods).
23946
2394703/21/2002: beazley
23948 Fixed [ 532957 ] %ignore parse error and casting operator.
23949 Reported by William Fulton.
23950
2395103/18/2002: beazley (** ADVANCED USERS ONLY **)
23952 Added support for dynamic casting in return values. A somewhat
23953 common problem in certain C++ programs is functions that hide
23954 the identity of underlying objects when they are returned
23955 from methods and functions. For example, a program might include
23956 some generic method like this:
23957
23958 Node *getNode();
23959
23960 However, Node * may just be base class to a whole hierarchy
23961 of different objects. Instead of returning this generic Node *,
23962 it might be nice to automatically downcast the object into the
23963 appropriate type using some kind dynamic cast.
23964
23965 Assuming you understand the peril involved, a downcast can now
23966 be performed using the following function in the run-time type
23967 checker:
23968
23969 swig_type_info *SWIG_TypeDynamicCast(swig_type_info *, void **ptr);
23970
23971 This function checks to see if the type can be converted to another
23972 type. If so, a different type descriptor (for the converted type)
23973 is returned. This type descriptor would then be used to create
23974 a pointer in the target language.
23975
23976 To use this, you would write a typemap similar to this:
23977
23978 %typemap(out) Node * {
23979 swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1);
23980 $result = SWIG_NewPointerObj($1, ty);
23981 }
23982
23983 Alternatively,
23984
23985 %typemap(out) Node * = SWIGTYPE *DYNAMIC;
23986
23987 To make the typemap have any effect, you have to write a supporting
23988 function that knows how to perform downcasting. For example:
23989
23990 %{
23991 static swig_type_info *
23992 Node_dynamic_cast(void **ptr) {
23993 Node **nptr = (Node **) ptr;
23994 Element *e = dynamic_cast<Element *>(*nptr);
23995 if (e) {
23996 *ptr = (void *) e;
23997 return SWIGTYPE_p_Element;
23998 }
23999 Data *d = dynamic_cast<Data *>(*nptr);
24000 if (d) {
24001 *ptr = (void *) d;
24002 return SWIGTYPE_p_Data;
24003 }
24004 return 0;
24005 }
24006 %}
24007
24008 There is no restriction on how types are determined. dynamic_cast<>
24009 uses C++ RTTI. However, if you had some other mechanism for determining
24010 the type, you could use that here. Note: it is important to save
24011 the new pointer value back into the argument as shown. When downcasting,
24012 the value of the pointer could change.
24013
24014 Finally, to make the casting function available, you have to register
24015 it with the run-time type checker. Put this macro in your interface file.
24016
24017 DYNAMIC_CAST(SWIGTYPE_p_Node, Node_dynamic_cast);
24018
24019 Note: this feature does not introduce a performance penalty on
24020 normal SWIG operation. The feature is only enabled by writing
24021 a new typemap that explicitly calls SWIG_TypeDynamicCast() to
24022 make a conversion.
24023
24024 Examples/test-suite/dynamic_cast.i contains a simple example.
24025 This feature is not supported in the Java module due to differences
24026 in the type-checking implementation.
24027
24028 *** EXPERIMENTAL FEATURE ***
24029
2403003/17/2002: beazley
24031 Small change to type-name handling of unnamed structures and
24032 typedef. If a structure of this form appears:
24033
24034 typedef struct {
24035 ...
24036 } Foo;
24037
24038 Then 'Foo' is used as the proper typename for the structure.
24039 Furthermore, Foo can now be used as a name in C++ inheritance.
24040 SWIG was already kind of doing this, but this modification refines
24041 the implementation to more closely follow the C++ ARM, section
24042 7.1.3, p. 106. This fixes a couple of obscure corner cases.
24043
2404403/16/2002: beazley
24045 Modified C++ inheritance with a few enhancements. First, type information
24046 needed for casting and type-equivalence is generated even when base-classes
24047 aren't defined in the interface. For example:
24048
24049 class Foo : public Bar { /* Bar unspecified */
24050 public:
24051 ...
24052 };
24053
24054 void blah(Bar *b);
24055
24056 In this case, the blah() function still accepts Foo * even though nothing
24057 is really known about Bar. Previous SWIG versions would just generate
24058 a type error.
24059
24060 Inheritance has also been modified to work through typedef. For example:
24061
24062 class Bar {
24063 };
24064
24065 typedef Bar OtherBar;
24066 class Foo: public OtherBar {
24067 }
24068
24069 In this case, the base class of OtherBar is correctly resolved back to
24070 Bar. The use of the name OtherBar is lost in this resolution (the wrappers
24071 will simply use Bar instead of the typedef name OtherBar).
24072
2407303/13/2002: beazley
24074 %typemap, %apply, and related directives can now appear inside
24075 class definitions.
24076
2407703/13/2002: beazley
24078 Fixed a variety of problems related to compiling SWIG on 64-bit
24079 platforms.
24080
2408103/12/2002: beazley
24082 Fixed problem with "ignore" and "in" typemaps. Local variables
24083 associated with "in" were being added to the wrapper function even
24084 though they were never used. Mostly harmless, but it would lead
24085 to a variety of compilation warnings.
24086
2408703/12/2002: beazley
24088 Some changes to the internal type system and handling of nested C++
24089 types. In previous versions of SWIG, if you had the following:
24090
24091 class Foo {
24092 public:
24093 typedef int Blah;
24094 };
24095 class Bar : public Foo {
24096 public:
24097 void somemethod(Blah x);
24098 };
24099
24100 The argument type in somemethod() would implicitly be set to Bar::Blah.
24101 Although this is technically allowed, it breaks typemaps. For example:
24102
24103 %typemap(in) Foo::Blah { ... }
24104
24105 doesn't match like you expect. This has been changed in SWIG-1.3.12.
24106 Now, types are expanded using the class in which they were defined.
24107 So, the argument type in somemethod() will be Foo::Blah---since the
24108 type Blah was defined in Foo.
24109
2411003/10/2002: beazley
24111 Fixed some subtle type scoping problems with typedef and C++ classes.
24112 For example:
24113
24114 typedef int Blah;
24115 class Bar {
24116 public:
24117 typedef double Blah;
24118 void foo(Blah x, ::Blah y);
24119 ...
24120 }
24121
2412203/10/2002: beazley
24123 Highly experimental change to handle variable length arguments.
24124 First, there is no portable or reliable way to wrap
24125 a varargs function in full generality. However, you *can* change
24126 the function signature using %varargs.
24127
24128 %varargs(char *) fprintf;
24129 ...
24130 void fprintf(FILE *f, char *fmt, ...);
24131
24132 In this case, the variable length parameter "..." is
24133 simply replaced by the parameters given in %varargs. This
24134 results in a function like this:
24135
24136 void fprintf(FILE *f, char *fmt, char *s);
24137
24138 More than one argument can be used and default values
24139 can be defined. For example, this code specifies a
24140 maximum of four arguments.
24141
24142 %varargs(char *x1 = 0, char *x2 = 0, char *x3 = 0, char *x4 = 0) fprintf;
24143
24144 *** EXPERIMENTAL NEW FEATURE ***
24145
2414603/10/2002: beazley
24147 Change to handling of variable length arguments. varargs
24148 is now handled as a proper parameter and is passed to the
24149 code generator. However, it still can't be handled correctly
24150 (and will generate a typemap warning). This change has been
24151 made to better incorporate variable length arguments with other
24152 directives such as %ignore, %rename, %feature, and so forth.
24153
2415403/10/2002: beazley
24155 Fixed [ 522555 ] Syntax error parsing "define" construct. SWIG
24156 is a little more restrictive in determining #define statements
24157 that will be wrapped as constants. Also added a better parser
24158 error rule for handling bad constants.
24159
2416003/08/2002: cheetah (William Fulton)
24161 [Java] Bug fix: Classes renamed with %rename that are derived from
24162 another class generate more appropriate shadow class code.
24163
2416403/08/2002: cheetah (William Fulton)
24165 [Java] Fixed SF [ #523632 ] and [ #513335 ] both reported by Israel
24166 Tanner. Support for types that are used which are in a typedef. The
24167 appropriate shadow class name is generated. Also generated correct
24168 shadow classname when a templated class is used within another
24169 templated class. See the cpp_typedef.i testcase.
24170
2417103/08/2002: cheetah (William Fulton)
24172 [Java] Bug fix: No type was generated in shadow classes for types
24173 that weren't wrapped by SWIG. The type is treated as a raw
24174 pointer, ie no shadow class.
24175
2417602/22/2002: beazley
24177 Refined the matching algorithm used by %rename, %ignore, and
24178 %feature. If a type signature is supplied, it must exactly
24179 match that used in the declaration---including any use of
24180 const. For example:
24181
24182 %rename(foo1) foo(int);
24183 %rename(bar1) bar(int) const;
24184
24185 class Blah {
24186 public:
24187 void foo(int); // Matched --> foo1
24188 void foo(int) const; // Not matched
24189 void bar(int); // Not matched
24190 void bar(int) const; // Matched --> bar1
24191 }
24192
24193 In previous versions, a non-const specification would match
24194 both the non-const and const declarations. However, the whole
24195 point of %rename and related directives is that they be able
24196 to precisely pinpoint exact declarations in an interface. This
24197 fixes the problem.
24198
2419902/21/2002: beazley
24200 Reworked the handling of default constructor and destructors.
24201 SWIG now makes a preliminary pass over the parse tree to discover
24202 which classes support default allocation. This fixes a number
24203 of very subtle issues in code generation and call/return by value.
24204
2420502/18/2002: cheetah (William Fulton)
24206 Improved support on Cygwin: Perl, Python, Tcl, Ruby and Java should
24207 work out of the box, barring the runtime library. Removed dllwrap
24208 and replaced with newly working gcc -shared instead for Cygwin.
24209 All this will require the new improved binutils 20010802 and later,
24210 but the latest Cygwin is usually the best recommendation.
24211
2421202/15/2002: beazley
24213 Fixed some problems related to wrapping of global variables
24214 and Perl shadow classes. Reported by Chia-liang Kao.
24215
2421602/15/2002: ljohnson (Lyle Johnson)
24217 [Ruby] Made a fix to the code generation for C++ class
24218 constructors so that we get both a "new" singleton method
24219 and an "initialize" instance method for each class. This
24220 change enables developers to derive new Ruby classes from
24221 SWIG-wrapped C++ classes and then override their initialize
24222 methods to provide subclass-specific instance initialization.
24223
2422402/15/2002: ljohnson (Lyle Johnson)
24225 [Ruby] Massive documentation update for the Ruby module,
24226 contributed by Craig Files.
24227
2422802/14/2002: ljohnson (Lyle Johnson)
24229 [Ruby] Bug fix: An error in the SWIG runtime support for Ruby
24230 was causing several of the examples to fail. Reported by
24231 William Fulton.
24232
2423302/14/2002: ljohnson (Lyle Johnson)
24234 [Ruby] Bug fix: Enumerations defined within a class (such
24235 as those seen in the Examples/ruby/enum example) were not
24236 being exported with the correct names. Reported by William
24237 Fulton.
24238
2423902/13/2002: ljohnson (Lyle Johnson)
24240 [Ruby] Added a warning message when we run across overloaded
24241 class constructors for C++ code, that this is currently not
24242 supported (even if the overloads have been %renamed). For an
24243 example of where this doesn't work, see Examples/ruby/operator.
24244
2424502/13/2002: ljohnson (Lyle Johnson)
24246 [Ruby] Added an "ignored" warning message when the parser runs
24247 across an operator!=() declaration for C++ code.
24248
2424902/11/2002: ljohnson (Lyle Johnson)
24250 [Ruby] Added the "import", "import_template", "operator" and
24251 "template" examples.
24252
2425302/11/2002: ljohnson (Lyle Johnson)
24254 [Ruby] Added multi-module support.
24255
2425602/09/2002: ljohnson (Lyle Johnson)
24257 [Ruby] Added the missing "#define SWIG_NOINCLUDE" at the top of
24258 the wrapper code when the '-c' option is used.
24259
2426002/09/2002: ljohnson (Lyle Johnson)
24261 Corrected a minor off-by-one error for the size of the
24262 swig_types[] array that's generated in the wrapper code.
24263
2426402/08/2002: beazley
24265 Fixed SF [ #515058 ] Wrong code for C++ templates.
24266 Reported by Israel Taller.
24267
William S Fultona0485362002-02-09 12:10:55 +000024268Version 1.3.11 (January 31, 2002)
24269=================================
24270
2427101/30/2002: beazley
24272 Fix to pass/return by value for C++ objects that define
24273 no default constructor. Changes to the typemap system
24274 made it impossible to wrap C++ objects with no default
24275 constructor. This has been fixed, but the solution
24276 involves some clever template magic contributed by
24277 William Fulton. Please see the comments in the file
24278 Lib/swig.swg for further details. This solution is
24279 experimental and may be refined in a future release.
24280
2428101/30/2002: beazley
24282 Global variables and member data of type "const char *"
24283 can be set, but the old value is silently discarded without
24284 any garbage collection. This may generate a memory leak.
24285 This change is needed to more safely handle variables
24286 like this:
24287
24288 const char *foo = "Hello World\n";
24289
24290 In this case, it's not safe to free the old value. However,
24291 SWIG can dynamically allocate a new value and make foo point
24292 to it. To fix this memory leak, you can probably do this:
24293
24294 %clear const char *foo;
24295 %apply char * {const char *foo};
24296
24297 *** POTENTIAL INCOMPATIBILITY ***
24298
2429901/30/2002: beazley
24300 Two minor typemap enhancements have been added. First,
24301 typemaps can issue a warning message by including a special
24302 warning attribute. For example:
24303
24304 %typemap(in,warning="I'm going to do something dangerous") ...
24305
24306 The warning message will show up whenever the typemap is
24307 applied.
24308
24309 Second, a typemap can force a no-match by defining
24310
William S Fultonc10a84c2022-08-20 22:14:58 +010024311 %typemap(in) sometype "pass"
William S Fultona0485362002-02-09 12:10:55 +000024312
24313 If this is used, the typemap system will *not* record a
24314 typemap match for "sometype". This can be used to block
24315 selected typemaps. For example, if you wanted to disable
24316 a typemap feature for some type, you could do this.
24317
24318 // Do not allow global variables of type 'const char *' to be set.
William S Fultonc10a84c2022-08-20 22:14:58 +010024319 %typemap(varin) const char * "pass"
William S Fultona0485362002-02-09 12:10:55 +000024320
24321 It might also be possible to use this to do subtle and
24322 strange things with typemaps. For example, if you wanted to
24323 make 'blah *' an output value and 'const blah *' an input
24324 parameter, you might do this:
24325
24326 %typemap(ignore) blah *(blah temp) {
24327 $1 = &temp;
24328 }
24329 %typemap(argout) blah * {
24330 ... return a value ...
24331 }
24332 /* Block unqualified typemaps defined above */
William S Fultonc10a84c2022-08-20 22:14:58 +010024333 %typemap(ignore) const blah * "pass"
24334 %typemap(argout) const blah * "pass"
William S Fultona0485362002-02-09 12:10:55 +000024335 %typemap(in) const blah * {
24336 ... get input value ...
24337 }
24338
24339 (This potential applications of typemaps suggested by Greg Stein).
24340 *** NEW FEATURE ***
24341
2434201/29/2002: cheetah (william fulton)
24343 [Java] Bug fix: No enumerations were wrapped when the -shadow
24344 commandline option was not specified. Reported by Israel Taller.
24345
2434601/28/2002: cheetah (william fulton)
24347 [Java] Global arrays are successfully wrapped. In fact they started
24348 mostly working in SWIG-1.3.10.
24349
2435001/28/2002:richardp
24351 Added first attempt at C++ and -shadow support for PHP4 module,
24352 please test and mail me if any problems/ideas on improving it.
24353
24354 There is a known problem with uninitialized member variables,
24355 please see Examples/php4/sync/README for details.
24356
24357 Also more PHP documentation added to Doc/Manual/Php.html
24358
2435901/27/2002:beazley
24360 The ANSI C size_t type is now recognized as an integer by default.
24361
2436201/26/2002:beazley
24363 long long and unsigned long long support added to many language modules.
24364 This is not a portable feature and will require compiler support
24365 for the long long type. In target languages that do not support
24366 long long (e.g., Tcl and Perl), numbers are converted to a string
24367 of digits. This prevents their use in arithmetic calculations, but
24368 still allows values to be set from a string.
24369
24370 long long support requires the use of the strtoll() and strtoull()
24371 functions as well as the 'lld' and 'llu' format specifiers
24372 of sprintf().
24373
2437401/26/2002:beazley
24375 Fixed [ #501827 ] Delete method is not called. The Tcl
24376 module wasn't correctly calling destructors when they
24377 were defined using %addmethods. This has been fixed.
24378 Reported by Reinhard Fobbe.
24379
2438001/26/2002: beazley
24381 Better support for long long and unsigned long long. Typemaps
24382 have been included in a number of modules for handling these types.
24383 In addition, the parser has been modified to accept long long
24384 literals such as 1234LL and 1234ULL.
24385
2438601/27/2002: cheetah (william fulton)
24387 [Java] A C char[] is mapped to a Java String which is the default
24388 SWIG handling of char[] and char*. It used to be mapped to byte[].
24389 Note that a C signed char[] array is mapped to byte[].
24390
24391 *** POTENTIAL INCOMPATIBILITY ***
24392
2439301/25/2002: beazley
24394 Fixed a problem with return-by-value, C++, and
24395 objects that define no default constructor.
24396 Reported by Joel Reed.
24397
2439801/25/2002: cheetah (william fulton)
24399 [Java] Overhaul of the Java module. The C code generation is now
24400 done from typemaps.
24401
2440201/24/2002: cheetah (william fulton)
24403 [Java] Support for arrays of enum pointers
24404
2440501/20/2002: cheetah (william fulton)
24406 [Java] Error checking for null Java objects being passed to native
24407 functions. Exception thrown now whereas before the JVM crashed.
24408
2440901/18/2002: cheetah (william fulton)
24410 [Java] Corrected behaviour for functions that take arrays. For
24411 example, when this c function:
24412
24413 void arrayfn(int array[]);
24414
24415 is wrapped the corresponding native function
24416
24417 public final static native void arrayfn(int[] array);
24418
24419 is produced. Previously if the C function made any changes to the
24420 array elements, these were not reflected back into the Java array.
24421 This has now been corrected so that the changes are propogated back
24422 to Java and the calling function will see these changes. This is
24423 how pure Java functions work, ie arrays are passed by reference.
24424
2442501/15/2002:mkoeppe
24426 [Guile] New file cplusplus.i with C++ typemaps contributed
24427 by Marcio Luis Teixeira <[email protected]>.
24428
2442901/11/2002: cheetah (william fulton)
24430 [Java] Changed mapping of C long to Java type. Was mapped to Java
24431 long, now mapped to Java int. If you want the previous mapping to
24432 Java long use this approach in your interface file:
24433
24434 %clear long;
24435 %typemap(jni) long "jlong"
24436 %typemap(jtype) long "long"
24437 %typemap(jstype) long "long"
24438
24439 %clear long[ANY];
24440 %typemap(jni) long[ANY] "jlongArray"
24441 %typemap(jtype) long[ANY] "long[]"
24442 %typemap(jstype) long[ANY] "long[]"
24443 %typemap(in) long[ANY] {write me for array support}
24444 %typemap(out) long[ANY] {write me for array support}
24445 %typemap(argout) long[ANY] {write me for array support}
24446 %typemap(freearg) long[ANY] {write me for array support}
24447
24448 *** POTENTIAL INCOMPATIBILITY ***
24449
24450 This new mapping is more appropriate when interfacing to 32 bit
24451 applications which are used in the current 32-bit JVMs. For future
24452 64-bit JVMs you may have to change these mappings - eg on Unix LP64
24453 systems, but not on Microsoft 64bit Windows which will be using a
24454 P64 IL32 model. This may be automated in a future version of SWIG.
24455
2445601/10/2002:beazley
24457 Fixed [ 501677 ] %init block in wrong place. Reported
24458 by Luigi Ballabio.
24459
2446001/09/2002: cheetah (william fulton)
24461 [Java] Default support for the long long type. signed long long is
24462 mapped to a Java long. unsigned long long is mapped to BigInteger.
24463
2446401/09/2002:beazley
24465 Experimental change to parser to better support mixing of
24466 int, long, short, unsigned, float, and double. The parser
24467 should now support types like this:
24468
24469 short unsigned int
24470 int unsigned short
24471 unsigned short int
24472 unsigned int short
24473
24474 This change also enables a type of 'long double' (previously
24475 unsupported) to be used.
24476 *** NEW FEATURE ***
24477
2447801/05/2002: cheetah (william fulton)
24479 [Java] Casting fix for when function return type is a pointer as
24480 reported by Gary Pennington 2002-01-05. The upper 32bits of the
24481 64 bit jlong will have contained junk for 32bit pointers.
24482
2448301/05/2002: cheetah (william fulton)
24484 [Java] Better pointer handling in Java is possible as the
24485 INPUT, OUTPUT and INOUT typemaps have been added into typemaps.i.
24486
2448701/05/2002: cheetah (william fulton)
24488 [Java] $null can be used in input typemaps to return early from JNI
24489 functions that have either void or a non-void return type. Example:
24490
24491 %typemap(check) int * %{
24492 if (error) {
24493 SWIG_exception(SWIG_IndexError, "Array element error");
24494 return $null;
24495 }
24496 %}
24497
24498 If the typemap gets put into a function with void as return, $null
24499 will expand to nothing:
24500
24501 void jni_fn(...) {
24502 if (error) {
24503 SWIG_exception(SWIG_IndexError, "Array element error");
24504 return ;
24505 }
24506 ...
24507 }
24508
24509 otherwise $null expands to zero, where javareturntype is either a
24510 pointer or a primitive type:
24511
24512 javareturntype jni_fn(...) {
24513 if (error) {
24514 SWIG_exception(SWIG_IndexError, "Array element error");
24515 return 0;
24516 }
24517 ...
24518 }
24519
2452001/02/2002: cheetah (william fulton)
24521 [Java] The Java module incorrectly used argout typemaps for
24522 strings. This is now corrected and the code now resides
24523 in the freearg typemap. The argout array typemaps have been split into
24524 argout and freearg typemaps. This correction may require some user
24525 written typemaps to be modified.
24526 *** POTENTIAL INCOMPATIBILITY ***
24527
2452812/28/2001: cheetah (william fulton)
24529 [Java] Multi typemaps now working for Java see multimap example.
24530 [Java] Fix for recently introduced bug - freearg typemap code was appearing
24531 before the function call.
24532
2453312/28/2001: cheetah (william fulton)
24534 [Java] JCALL macro for JNI calls that work in both C and C++ typemaps
24535 have been replaced with JCALL0, JCALL1, JCALL2, JCALL3 and JCALL4
24536 macros.
24537 *** POTENTIAL INCOMPATIBILITY ***
24538
2453912/22/2001:beazley
24540 Resolved some inconsistent behavior with %rename and class renaming.
24541 If you specify the following:
24542
24543 %rename(Foo) Bar;
24544
24545 class Bar {
24546 public:
24547 Bar();
24548 ~Bar();
24549 }
24550
24551 Then the %rename directive applies to the class itself, the constructor,
24552 and the destructor (all will be renamed to Foo).
24553
24554 If a class defines more than one constructor, the overloaded variants
24555 can still be renamed by specifying parameters to %rename. For example:
24556
24557 %rename(Bar_copy) Bar(Bar &);
24558 class Bar {
24559 public:
24560 Bar();
24561 Bar(Bar &);
24562 ~Bar();
24563 };
24564
24565 There are still some odd corner cases. If you specify
24566
24567 %rename(Foo) ::Bar;
24568
24569 then only the name of the class is changed and the constructor/destructor
24570 names are left unmodified. If you specify
24571
24572 %rename(Foo) *::Bar;
24573
24574 then the names of the constructor/destructor functions are modified but
24575 the name of the class is not.
24576
2457712/21/2001: cheetah (william fulton)
24578 [Java] jni, jtype and jstype typemaps no longer hardcoded but real
24579 typemaps. New variable substitution, $javaclassname, can be used in
24580 the jstype typemaps. It is replaced with the Java shadow class name
24581 where applicable.
24582 [Java] Fix for recently introduced bug to do with inheritance when
24583 using %import.
24584 [Java] A few more bug fixes, todo with %rename and using the kind
24585 with the type, eg
24586 void fn(union uni myuni, struct str mystr, class cl mycl);
24587
2458812/20/2001:beazley
24589 Fixed [ #494524 ] Preprocessor bug - apostrophe and #subst.
24590
2459112/20/2001:beazley
24592 Added SWIG_VERSION preprocessor symbol. This is a hexadecimal
24593 integer such as 0x010311 (corresponding to SWIG-1.3.11). This can
24594 be used in the interface as follows:
24595
24596 #if SWIG_VERSION >= 0x010311
24597 /* Use some fancy new feature */
24598 #endif
24599
24600 Note: The version symbol is not defined in the generated SWIG
24601 wrapper file.
24602
24603 *** NEW FEATURE ***
24604
2460512/20/2001:mkoeppe
24606 [MzScheme]: Renamed mzswig_make_boolean to
24607 swig_make_boolean, as the latter is used in the typemaps.
24608 Reported by Luigi Ballabio.
24609
2461012/17/2001:mkoeppe
24611 [Guile]: Rewrote list-vector.i using multi-dispatch
24612 typemaps. Updated pointer-in-out.i. Make the
24613 deprecated typemap-substitution of "$source" in "argout"
24614 work as before.
24615
2461612/16/2001:mkoeppe
24617 [Guile]: Fixed macros %values_as_list, %values_as_vector,
24618 %multiple_values to use the proper %pragma syntax. New
24619 Guile example/test "multivalue"; new Guile run-test for
24620 test-suite item "list-vector" (currently broken).
24621
2462212/14/2001:mkoeppe
24623 [Guile]: Fixed typemap-substition bug for "varin". Relaxed
24624 valid-identifier check to allow all R5RS identifiers.
24625
24626
William S Fultonb1641332001-12-15 16:16:30 +000024627Version 1.3.10 (December 10, 2001)
24628==================================
24629
2463012/08/2001:beazley
24631 Modified %typemap so that %{ ... %} can also be used as a
24632 code block (mostly for completeness). For example:
24633
24634 %typemap(in) blah %{
24635 ...
24636 %}
24637
24638 This form does not introduce a new block scope. Also, the
24639 code enclosed in %{ ... %} is not processed by the preprocessor.
24640
2464112/08/2001:beazley
24642 Fixed [ #459614 ] SWIG with multiple TCL interpreters.
24643
2464412/08/2001:beazley
24645 Fixed [ #417141 ] rubydec.swg is wrong
24646 Reported by Paul Brannan.
24647
2464812/08/2001:beazley
24649 Fixed [ #410557 ] Problem with %addmethods on NT.
24650 Reported by Magnus Ljung.
24651
2465212/08/2001:beazley
24653 Fixed [ #445233 ] Enhancement: handle access change.
24654 SWIG now parses (but ignores) C++ access changes for the
24655 the following:
24656
24657 class A {
24658 protected:
24659 void something() { }
24660 public:
24661 A() {}
24662 };
24663
24664 class B : private A {
24665 public:
24666 B() : A() { }
24667 protected:
24668 A::something; <---- Parsed, but ignored
24669 };
24670
24671 Suggested by Krzysztof Kozminski.
24672
2467312/08/2001: cheetah (william fulton)
24674 Fix for Ruby to work using Visual C++.
24675
2467612/06/2001:beazley
24677 Fixed [ #465687 ] unsigned short parameters fail.
24678 Reported by Gerald Williams.
24679
2468012/06/2001:beazley
24681 Fixed SF [ #489594 ] PyString_FromString can't take NULL arg.
24682 Reported by John Merritt. SWIG now converts string values
24683 to Python using code like this:
24684
24685 resultobj = result ? PyString_FromString(result) : Py_BuildValue("");
24686
2468712/06/2001:beazley
24688 Fixed SF [ #463561 ] Type conversions not generated.
24689 Reported by Gerald Williams.
24690
2469112/04/2001:beazley
24692 Fixed SF [ #470217 ] Tcl default argument handling.
24693 Reported by Shaun Lowry.
24694
2469512/04/2001:beazley
24696 Fixed SF [ #472088 ] defined(MACRO) expanded everywhere.
24697 Embedded preprocessor directives such as
24698
24699 %#if defined(FOO)
24700
24701 are not expanded by the SWIG preprocessor.
24702 Reported by Gerald Williams.
24703
2470412/04/2001:beazley
24705 Fixed SF [ #476467 ] Problems with #define & commas.
24706
2470712/04/2001:beazley
24708 Fixed SF [ #477547 ] wrong declaration of pointer functions.
24709 Bad prototypes in Lib/tcl/ptrlang.i.
24710
2471112/04/2001:beazley
24712 Fixed SF [ #483182 ] Constants can take args by mistake.
24713 When swig -perl5 -const is used, constants are declared
24714 with a void prototype. For example:
24715
24716 sub ICONST () { $examplec::ICONST }
24717
24718 Patch submitted by Rich Wales.
24719
2472012/03/2001:beazley
24721 New %exception directive. This is intended to replace %except.
24722 It works in exactly the same manner except it does not accept a
24723 language specifier. For example:
24724
24725 %exception {
24726 try {
24727 $action
24728 }
24729 catch(SomeError) {
24730 error
24731 }
24732 }
24733
24734 %exception is also name aware---allowing it to be applied to
24735 specific declarations in an interface. For example:
24736
24737 %exception foo {
24738 ...
24739 exception for any function/method foo
24740 ...
24741 }
24742
24743 %exception Foo::bar {
24744 ...
24745 exception for method bar in class Foo
24746 ...
24747 }
24748
24749 %exception Foo::bar(double) {
24750 ...
24751 exception for method bar(double) in class Foo
24752 ...
24753 }
24754
24755 The semantics of this name matching is exactly the same as for %rename.
24756 *** NEW FEATURE ***
24757
2475812/03/2001:beazley
24759 Substantial cleanup of the Python shadow class code. Shadow classes
24760 used to be created in this rather complicated manner involving about
24761 a half-dozen strings created in bits and pieces. Shadow classes
24762 are now generated in a more straightforward manner--in the same
24763 order that appears in the interface file.
24764
24765 *** POTENTIAL INCOMPATIBILITY ***
24766 The order in which declarations appear in the shadow file may differ.
24767
2476812/03/2001:beazley
24769 The %insert directive (%{ ... %}, %runtime, %header, %wrapper, etc.)
24770 can now be used inside of a class definition. This has potential
24771 uses when generating shadow class code. For example:
24772
24773 class Foo {
24774 ...
24775 %insert("shadow") %{
24776 # Some python code
24777 def blah(self):
24778 print "I'm blah!"
24779 %}
24780 ...
24781 };
24782
24783 The support for class code insertion depends on the language module.
24784 However, the intent of this feature is to simplify the task of extending
24785 shadow class code. In the Python module, this inserts code with the
24786 proper level of indendation (regardless of what was used in the SWIG
24787 interface).
24788 *** NEW FEATURE ***
24789
2479011/29/2001: cheetah (william fulton)
24791 Modifications for Java and Python modules to work on cygwin.
24792 Unfortunately a lot of the python module has started to produces code
24793 which cannot be auto-imported using cygwin libtools so most of it is
24794 still broken.
24795
2479611/28/2001:beazley
24797 The %rename and %feature directive can now be used inside
24798 of a class definition. For example:
24799
24800 class Foo {
24801 %rename(foo_i) foo(int);
24802 %rename(foo_d) foo(double);
24803 public:
24804 ...
24805 void foo(int);
24806 void foo(double);
24807 ...
24808 };
24809
24810 When used in this manner, the %rename directive only applies
24811 to members of the class in which it appears as well as all
24812 derived classes. In fact, this is really just the same
24813 as saying:
24814
24815 %rename(foo_i) Foo::foo(int);
24816 %rename(foo_d) Foo::foo(double);
24817 class Foo {
24818 ...
24819 };
24820
24821 *** NEW FEATURE ***
24822
2482311/26/2001:beazley
24824 Added the experimental %feature directive. %feature can be
24825 used to attach arbitrary string attributes to parse tree nodes.
24826 For example:
24827
24828 %feature("except") blah {
24829 try {
24830 $function
24831 } catch (Error) {
24832 whatever;
24833 }
24834 }
24835
24836 or
24837
24838 %feature("set") *::x_set "x";
24839
24840 or
24841
24842 %feature("blah") Foo::bar(int,double) const "spam";
24843
24844 The syntax is borrowed from the %rename directive. In fact, the
24845 exact same semantics apply (inheritance, matching, etc.).
24846
24847 %feature is a very powerful low-level primitive that can be used to
24848 customize individual language modules and to provide hints to
24849 any stage of code generation. Features are attached to
24850 parse tree nodes as attributes with names like "feature:*" where *
24851 is replaced by the feature name (e.g., "feature:except", "feature:set",
24852 etc.). Language modules can then look for the features using
24853 a simple attribute lookup.
24854
24855 %feature is intended to be a replacement for a number of
24856 older SWIG directives including %except and specialized
24857 pragmas. It is more powerful (due to its parameterized
24858 name matching) and it provides very precise control over
24859 how customization features are attached to individual
24860 declarations. There are future expansion plans that will
24861 build upon this capability as well.
24862
24863 It's not certain that %feature will ever be used directly
24864 by SWIG users. Instead, it may be a low-level primitive
24865 that is used in high-level macro definitions. For instance,
24866 to support properties, you might define a macro like this:
24867
24868 %define %property(name, setf, getf)
24869 %feature("set") setf #name;
24870 %feature("get") getf #name;
24871 %enddef
24872
24873 Which allows a user to specify things like this:
24874
24875 %property(p, get_p, set_p);
24876
24877 class Blah {
24878 public:
24879 int get_p();
24880 void set_p(int);
24881 };
24882
24883 *** EXPERIMENTAL NEW FEATURE ***
24884
2488511/24/2001:beazley
24886 The Tcl module has been expanded with some new features for
24887 managing object ownership. For example:
24888
24889 set c [Circle -args 20]
24890 $c area # Invoke a method
24891 $c -disown # Releases ownership of the object
24892 $c -acquire # Acquires ownership of the object
24893
24894 If Tcl owns the object, its destructor is invoked when the
24895 corresponding object command is deleted in Tcl.
24896
24897 To simplify the destruction of objects, the following syntax
24898 can be used:
24899
24900 $c -delete # Delete an object
24901
24902 This is an alternative for the more obscure variant of
24903
24904 rename $c {}
24905
24906 These features also add functionality at the C API level.
24907 The following functions manage ownership from C and
24908 can be used in typemaps.
24909
24910 SWIG_Acquire(void *ptr);
24911 SWIG_Disown(void *ptr);
24912
24913 A new function for constructing instances is also available:
24914
24915 Tcl_Obj *
24916 SWIG_NewInstanceObj(Tcl_Interp *interp, void *ptr,
24917 swig_type_info *type, int own);
24918
24919 When used in a typemap, this creates a pointer object and
24920 an interpreter command that can be used to issue methods and
24921 access attributes as shown above.
24922 *** NEW FEATURE ***
24923
2492411/23/2001:beazley
24925 All Python-related %pragma operations have been eliminated.
24926 Most of these were written for older SWIG versions in order to
24927 compensate for limitations in earlier releases. In an effort
24928 to reduce the amount of code-clutter and potential for errors,
24929 it is easier to simply eliminate the pragmas and to start over
24930 (if needed). To be honest, I'm not even sure the pragmas
24931 worked in 1.3.9 and recent releases.
24932
24933 Note: If you need to insert code into the shadow class file
24934 created by SWIG, simply use the %shadow directive like this:
24935
24936 %shadow %{
24937 def some_python_code():
24938 print "blah!"
24939 %}
24940
24941 *** POTENTIAL INCOMPATIBILITY ***
24942
2494311/22/2001:beazley
24944 Sweeping changes to the way in which the Python module handles
24945 shadow classes. In early implementations, shadow classes were
24946 merely Python wrappers around typed pointer objects. However,
24947 some users actually wanted to receive the shadow class object in C.
Olly Bettsf9566ad2013-01-08 18:47:40 +130024948 To accommodate this, the dereferencing of the "this" pointer in
William S Fultonb1641332001-12-15 16:16:30 +000024949 a shadow class was moved to C as described in CHANGES [8/8/99].
24950 However, the process of returning pointers to Python was still
24951 somewhat problematic. Specifically, shadow classes never worked
24952 in situations such as these:
24953
24954 - Use of any kind of output typemap ('out' or 'argout')
24955 - Global variables (broken as far as I can tell).
24956
24957 In the past, some users have dealt with this by manually trying
24958 to create shadow class objects themselves from C/C++. However,
24959 this was difficult because the C wrappers don't really know how
24960 to get access to the corresponding Python class.
24961
24962 The Python module has now been modified to automatically attach
24963 shadow class objects to pointers when they are returned to
24964 Python. This process occurs in the function SWIG_NewPointerObj()
24965 so the process is completely transparent to users. As a result,
24966 shadow classes are now more seamlessly integrated with typemaps
24967 and other features of SWIG.
24968
24969 This change may introduce a number of incompatibilities. The
24970 SWIG_NewPointerObj() now takes an extra parameter "own" to
24971 indicate object ownership. This can be used to return a pointer
24972 to Python that Python should destroy. In addition, older code
24973 that tries to manually construct shadow class objects or which
24974 expects bare pointers may break---such pointers may already be
24975 encapsulated by a shadow class.
24976 *** POTENTIAL INCOMPATIBILITY ***
24977
2497811/20/2001:beazley
24979 Modified the %insert directive to accept single braces { ... }.
24980 For example:
24981
24982 %insert("header") {
24983 ... some code ...
24984 }
24985
24986 This works exactly like %{ ... %} except that the code in the
24987 braces is processed using the preprocessor. This can be useful
24988 in certain contexts such as low-level code generation in
24989 language modules.
24990 *** NEW FEATURE ***
24991
2499211/20/2001:beazley
24993 Command line options are now translated into preprocessor
24994 symbols. For example:
24995
24996 ./swig -python -shadow -module blah interface.i
24997
24998 Creates the symbols:
24999
25000 SWIGOPT_PYTHON 1
25001 SWIGOPT_SHADOW 1
25002 SWIGOPT_MODULE blah
25003
25004 Modules can look for these symbols to alter their code generation
25005 if needed.
25006 *** NEW FEATURE ***
25007
2500811/20/2001:beazley
25009 Massive overhaul of the Perl5 module. A lot of code generation is
25010 now driven by tables and typemaps. The generated wrapper code
25011 also makes use of tables to install constants, variables, and
25012 functions instead of inlining a bunch of procedure calls. The
25013 separate variable initialization function is gone. Most
25014 code generation is controlled via the perl5.swg file in the
25015 library.
25016 *** POTENTIAL INCOMPATIBILITY ***
25017
2501811/13/2001:beazley
25019 Added parsing support for the C++ typename keyword. Primarily this
25020 is added to better support templates. For example:
25021
25022 template<typename T> void blah(C& v) {
25023 typename C::iterator i = v.begin();
25024 }
25025
25026 Note: typename is supported in the parser in the same way as 'struct'
25027 or 'class'. You probably shouldn't use it anywhere except in templates.
25028 *** NEW FEATURE ***
25029
2503011/11/2001:beazley
25031 Massive overhaul of the language module API. Most functions now
25032 use a common, very simple, API. There are also a number of
25033 interesting semantic side-effects of how code is actually generated.
25034 Details will be forthcoming in Doc/Manual/Extending.html.
25035
25036 *** POTENTIAL INCOMPATIBILITY *** Language modules written for
25037 previous versions of SWIG will no longer work,
25038
2503911/10/2001:beazley
25040 Fixed a very subtle bug due to unnamed class wrapping. For example, if
25041 you did this
25042
25043 typedef struct {
25044 int x,y;
25045 } gdPoint, *gdPointPtr;
25046
25047 void foo(gdPointPtr x);
25048
25049 Then the foo function would get a type-error. The problem has
25050 to do with internal typedef handling and the fact that the typedef
25051 declarations after the struct appear later in the parse tree.
25052 It should work now. Problem reported by Vin Jovanovic.
25053
2505411/09/2001:beazley
25055 Subtle change to "out" typemaps (and related variations). The name
25056 that is attached to the typemap is now the raw C identifier that
25057 appears on a declaration. This changes the behavior of
25058 member functions. For example:
25059
25060 %typemap(out) int foo {
25061 ...
25062 }
25063
25064 class Blah {
25065 public:
25066 int foo(); // typemap gets applied
25067 }
25068
25069 Previous versions never really specified how this was supposed to
25070 work. In SWIG1.1, you could probably write a typemap for the
25071 wrapper name like this:
25072
25073 %typemap(out) int Blah_foo { ... }
25074
25075 However, this old behavior is now withdrawn and not supported.
25076 Just use the member name without any sort of special prefix.
25077 *** POTENTIAL INCOMPATIBILITY ***
25078
2507911/06/2001:beazley
25080 Changes to Tcl module initialization:
25081
25082 (1) SWIG now automatically includes the code needed to work with
25083 Tcl stubs. Simply compile with -DUSE_TCL_STUBS.
25084
25085 (2) SWIG now automatically calls Tcl_PkgProvide to register
25086 a package name. The package name is the same as the name
25087 specified with the %module directive. The version number is
25088 set to "0.0" by default. To change the version number, use
25089 swig -pkgversion 1.2 interface.i.
25090
25091 *** POTENTIAL INCOMPATIBILITY ***
25092 Modules that provided stubs and Tcl_PkgProvide on their own might
25093 break. Simply remove that code.
25094
2509511/05/2001:beazley
25096 Changed code generation of constants in the Tcl module. Constants
25097 are now stored in a large table that get installed at module startup.
25098 There are also no longer any static variables so it should generate
25099 somewhat less code.
25100
2510111/04/2001:beazley
25102 The "const" typemap has been renamed to "constant" in many language
25103 modules. "const" is a C keyword which made the handling of the typemap
25104 directive somewhat awkward in the parser.
25105 *** POTENTIAL INCOMPATIBILITY ***
25106
2510711/04/2001:beazley
25108 %typemap directive can now accept nearly arbitrary keyword parameters.
25109 For example:
25110
William S Fultonc10a84c2022-08-20 22:14:58 +010025111 %typemap(in,parse="i",doc="integer") int "..."
William S Fultonb1641332001-12-15 16:16:30 +000025112
25113 The purpose of the keyword parameters is to supply code generation
25114 hints to the target language module. The intepretation of the
25115 parameters is language specific.
25116 *** NEW FEATURE ***
25117
2511811/04/2001:beazley
25119 Slight semantic change to internal call/return by value handling.
25120 In previous versions of SWIG, call-by-value was translated
25121 into pointers. For example:
25122
25123 double dot_product(Vector a, Vector b);
25124
25125 turned into this:
25126
25127 double wrap_dot_product(Vector *a, Vector *b) {
25128 return dot_product(*a,*b);
25129 }
25130
25131 This translation was normally performed by the SWIG core, outside
25132 of the control of language modules. However, a side effect
25133 of this was a lot of bizarre typemap behavior. For example,
25134 if you did something like this:
25135
25136 %typemap(in) int32 {
25137 ...
25138 }
25139
25140 You would find that int32 was transformed into a pointer everywhere!
25141 (needless to say, such behavior is unexpected and quite awkward to
25142 deal with). To make matters worse, if a typedef was also used,
25143 the pointer behavior suddenly disappeared.
25144
25145 To fix this, the pointer transformation is now pushed to the
25146 language modules. This produces wrappers that look roughly
25147 like this:
25148
25149 double wrap_dot_product(Vector *a, Vector *b) {
25150 Vector arg1 = *a;
25151 Vector arg2 = *b;
25152 return dot_product(arg1,arg2);
25153 }
25154
25155 This change also makes it easy to define typemaps for
25156 arbitrary undefined types. For example, you can do this (and it
25157 will work regardless what int32 is):
25158
25159 %typemap(in) int32 {
25160 $1 = (int32) PyInt_AsLong($input);
25161 }
25162
25163 *** POTENTIAL IMCOMPATIBILITY ***
25164 This change may break call/return by value code generation in
25165 some language modules.
25166
2516711/03/2001:beazley
25168 Changed the name of the default typemaps to the following:
25169
25170 %typemap() SWIGTYPE {
25171 ... an object ...
25172 }
25173 %typemap() SWIGTYPE * {
25174 ... a pointer ...
25175 }
25176 %typemap() SWIGTYPE & {
25177 ... a reference ...
25178 }
25179 %typemap() SWIGTYPE [] {
25180 ... an array ...
25181 }
25182 %typemap() enum SWIGTYPE {
25183 ... an enum value ...
25184 }
25185 %typemap() SWIGTYPE (CLASS::*) {
25186 ... pointer to member ...
25187 }
25188
25189
25190 These types are used as the default for all types that don't match
25191 anything else. See CHANGES log entry for 8/27/2000 for the
25192 old behavior. The role of these types is also described in
25193 Doc/Manual/Typemaps.html
25194
25195 *** POTENTIAL INCOMPATIBILITY ***
25196
2519710/25/2001:beazley
25198 Modified Guile and Mzscheme modules to support
25199 multi-argument typemaps.
25200
2520110/25/2001: cheetah (william fulton)
25202 [Java] Fix to handle pointers to arrays.
25203
2520410/24/2001:beazley
25205 Defining a typemap rule for enum SWIGENUM can now be used
25206 to define default behavior for enum variables.
25207
2520810/22/2001:beazley
25209 Ruby module modified to support multi-argument typemaps.
25210
2521110/22/2001:beazley
25212 The Ruby module can now handle functions with an arbitrary
25213 number of arguments. Previous versions were limited to
25214 to functions with only 9 or 16 arguments depending on
25215 the use of default arguments. Note: from some inspection
25216 of the Ruby interpreter source, the new approach might be
25217 a little faster as well.
25218
2521910/18/2001:beazley
25220 Fixed a bug with forward class declarations and
25221 templates.
25222
25223 class Foo <S,T>;
25224
25225 Bug reported by Irina Kotlova.
25226
2522710/16/2001:beazley
25228 Support for multivalued typemaps added. The typemaps
25229 are specified using the syntax below. Within each
25230 typemap, variable substitution is handled as follows:
25231
25232 %typemap(in) (int argc, char *argv[]) {
25233 $arg; // The input object in the target language
25234 $1; // C local variable for first argument
25235 $2; // C local variable for second argument
25236
25237 // These variables refer to either argument
25238 $1_type, $1_ltype, $1_basetype, etc... (argc)
25239 $2_type, $2_ltype, $2_basetype, etc... (argv[])
25240
25241 // Array dimension of argv
25242 $2_dim0
25243 }
25244
25245 Basically any variable that was available in normal typemaps
25246 is available for either argument by prefacing the variable
25247 name by '$n_' where n is the argument position.
25248
25249 Notes:
25250 (1) Multi-valued typemaps can only be applied to a single
25251 object in the target scripting language. For example,
25252 you can split a string into a (char *, int) pair or
25253 split a list into a (int, char []) pair. It is not
25254 possible to map multiple objects to multiple arguments.
25255
25256 (2) To maintain compatibility with older SWIG versions, the
25257 variables such as $target and $type are preserved and
25258 are mapped onto the first argument only.
25259
25260 (3) This should not affect compatibility with older code.
25261 Multi-valued typemaps are an extension to typemap handling.
25262 Single valued typemaps can be specified in the usual
25263 way.
25264
25265 The old $source and $target variables are officially
25266 deprecated. Input variables are referenced through
25267 $arg$ and output values are reference through $result$.
25268
25269 *** NEW FEATURE ***
25270
2527110/16/2001:beazley
25272 Added parsing support for multivalued typemaps. The syntax
25273 is a little funky, but here goes:
25274
25275 // Define a multivalued typemap
25276 %typemap(in) (int argc, char *argv[]) {
25277 ... typemap code ...
25278 }
25279
25280 // Multivalued typemap with locals
25281 %typemap(in) (int argc, char *argv[])(int temp) {
25282 ... typemap code ...
25283 }
25284
25285 // Copy a multivalued typemap
25286 %typemap(in) (int argcount, char **argv) = (int argc, char *argv[]);
25287
25288 // Apply a multivalued typemap
25289 %apply (int argc, char *argv[]) { (int argcount, char **argv) };
25290
25291 Note: this extra parsing support is added for future extension.
25292 No language modules currently support multi-valued typemaps.
25293
2529410/11/2001:beazley
25295 Modified the typemap matching code to discard qualifiers when
25296 checking for a match. For example, if you have a declaration
25297 like this:
25298
25299 void blah(const char *x);
25300
25301 The typemap checker checks for a match in the following order:
25302
25303 const char *x
25304 const char *
25305 char *x
25306 char *
25307
25308 If typedef's are involved, qualifier stripping occurs before
25309 typedef resolution. So if you had this,
25310
25311 typedef char *string;
25312 void blah(const string x);
25313
25314 typemap checking would be as follows:
25315
25316 const string x
25317 const string
25318 string x
25319 string
25320 const char *x
25321 const char *
25322 char *x
25323 char *
25324
25325 The primary reason for this change is to simplify the implementation
25326 of language modules. Without qualifier stripping, one has to write
25327 seperate typemaps for all variations of const and volatile (which
25328 is a pain).
25329
25330 *** POTENTIAL INCOMPATIBILITY *** Typemaps might be applied in
25331 places where they weren't before.
25332
25333
2533410/9/2001: beazley
25335 SWIG now generates wrappers that properly disambiguate
25336 overloaded methods that only vary in constness. For
25337 example:
25338
25339 class Foo {
25340 ...
25341 void blah();
25342 void blah() const;
25343 ...
25344 };
25345
25346 To handle this, the %rename directive can be used normally.
25347
25348 %rename(blah_const) blah() const;
25349
25350 In the resulting wrapper code, method calls like this
25351 are now generated:
25352
25353 (obj)->blah() // Non-const version
25354 ((Foo const *)obj)->blah() // const version
25355
25356 This should force the right method to be invoked.
25357 Admittedly, this is probably obscure, but we might
25358 as well get it right.
25359
2536010/8/2001: beazley
25361 The preprocessor now ignores '\r' in the input.
25362 This should fix the following bug:
25363 [ #468416 ] SWIG thinks macro defs are declarations?
25364
2536510/8/2001: beazley
25366 Added support for ||, &&, and ! in constants. This
25367 fixes SF [ #468988 ] Logical ops break preprocessor.
25368 However, at this time, constants using these operators
25369 are not supported (the parser will issue a warning).
25370
2537110/4/2001: beazley
25372 Added -show_templates command line option. This makes
25373 SWIG display the code it actually parses to generate
25374 template wrappers. Mostly useful for debugging.
25375 *** NEW FEATURE ***
25376
2537710/4/2001: beazley
25378 Change to semantics of %template directive. When
25379 using %template, the template arguments are handled
25380 as types by default. For example:
25381
25382 %template(vecint) vector<int>;
25383 %template(vecdouble) vector<double>;
25384
25385 To specify a template argument that is *not* a type, you
25386 need to use default-value syntax. For example:
25387
25388 %template(vecint) vector<int,int=50>;
25389 %template(vecdouble) vector<int,size=100>;
25390
25391 In this case, the type name doesn't really matter--only
25392 the default value (e.g., 50, 100) is used during
25393 expansion. This differs from normal C++, but I couldn't
25394 figure out a better way to do it in the parser. Might
25395 implement an alternative later.
25396 *** POTENTIAL INCOMPATIBILITY ***
25397
2539810/4/2001: beazley
25399 Major changes to template handling in order to provide
25400 better integration with the C++ type-system. The main
25401 problem is as follows:
25402
25403 Suppose you have a template like this:
25404
25405 template<class T> void blah(const T x) { stuff };
25406
25407 Now suppose, that you instantiate the template on a
25408 type like this in SWIG:
25409
25410 %template(blahint) blah<int *>;
25411
25412 In C++, this is *supposed* to generate code like this:
25413
25414 void blah(int *const x) { stuff };
25415
25416 However, in SWIG-1.3.9, the template substitution gets it wrong
25417 and produces
25418
25419 void blah(const int *x) { stuff };
25420
25421 (notice the bad placement of the 'const' qualifier).
25422
25423 To fix this, the SWIG parser now generates implicit typedefs
25424 for template type arguments that produces code roughly
25425 equivalent to doing this:
25426
25427 typedef int *__swigtmpl1;
25428 %template(blahint) blah<__swigtmpl1>;
25429
25430 which generates code like this:
25431
25432 void blah(const __swigtmpl1 x) { stuff };
25433
25434 Since this is correct in both C++ and SWIG, it provides the right
25435 semantics and allows everything to compile properly. However,
25436 to clean up the generated code a little bit, the parser keeps
25437 track of the template types and performs back-substitution to
25438 the original type when building the parse tree. Thus, even
25439 though the implicit typedef is used in the input and may appear
25440 in the generated wrapper file (for proper compilation), the parse
25441 tree will hide a lot of these details. For example:
25442
25443 void blah(const __swigtmpl1 x) { stuff };
25444
25445 will look like it was declared as follows (which is what
25446 you want):
25447
25448 void blah(int *const x) { stuff }
25449
25450 The only place you are likely to notice the typedef hack
25451 is in bodies of template functions. For example, if you
25452 did this,
25453
25454 template<class T> class blah {
25455 ...
25456 %addmethods {
25457 void spam() {
25458 T tempvalue;
25459 ...
25460 }
25461 }
25462 }
25463
25464 you will find that 'T tempvalue' got expanded into some
25465 strange typedef type. This *still* compiles correctly
25466 so it's not a big deal (other than looking kind of ugly
25467 in the wrapper file).
25468
2546910/4/2001: beazley
25470 Fixed some inheritance problems in Tcl Object interface.
25471
2547210/1/2001: beazley
25473 Tcl module has changed to use byte-backed pointer strings. This
25474 implementation should be safe on 64-bit platforms. However,
25475 the order in which digits appear in pointer values no longer
25476 directly corresponds to the actual numerical value of a
25477 pointer (on little-endian machines, pairs of digits appear
25478 in reverse order).
25479
2548010/1/2001: beazley
25481 Perl5 module is now driven by a configuration file 'perl5.swg'
25482 in the SWIG library.
25483
2548410/1/2001: beazley
25485 The perl5 module no longer tries to apply the "out" typemap
25486 in code generated for magic variables. I'm surprised that
25487 this ever worked at all (since all of the code that was there
25488 was wrong anyways). Use the "varout" typemap to handle
25489 global variables.
25490
2549110/1/2001: beazley
25492 Fixed a bug related to character array members of structures.
25493 For example:
25494
25495 struct Foo {
25496 char name[32];
25497 };
25498
25499 SWIG is normally supposed to return a string, but this was
25500 broken in 1.3.9. The reason it was broken was actually
25501 due to a subtle new feature of typemaps. When a data member
25502 is set to an array like this, the return type of the related
25503 accessor function is actually set to an array. This means
25504 that you can now write typemaps like this:
25505
25506 %typemap(python,out) char [ANY] {
25507 $target = PyString_FromStringAndSize($source,$dim0);
25508 }
25509
25510 This functionality can be used to replace the defunct
25511 memberout typemap in a more elegant manner.
25512
255139/29/2001: beazley
25514 Some further refinement of qualified C++ member functions.
25515 For example:
25516
25517 class Foo {
25518 ...
25519 void foo() const;
25520 ...
25521 };
25522
25523 (i) The SWIG parser was extended slightly to allow 'volatile'
25524 and combinations of 'const' and 'volatile' to be used. This
25525 is probably rare, but technically legal. Only added for
25526 completeness.
25527
25528 (ii) For the purposes of overloading, qualified and non-qualified
25529 functions are different. Thus, when a class has methods like this:
25530
25531 void foo();
25532 void foo() const;
25533
25534 Two distinct methods are declared. To deal with this, %rename
25535 and similar directives have been extended to recognize const.
25536 Thus, one can disambiguate the two functions like this:
25537
25538 %rename(fooconst) Foo::foo() const;
25539
25540 or simply ignore the const variant like this:
25541
25542 %ignore Foo::foo() const;
25543
25544 Note: SWIG currently has no way to actually invoke the const
25545 member since the 'const' is discarded when generating wrappers
25546 for objects.
25547
255489/27/2001: beazley
25549 New directive. %namewarn can be used to issue warning
25550 messages for certain declaration names. The name
25551 matching is the same as for the %rename directive.
25552 The intent of this directive is to issue warnings for
25553 possible namespace conflicts. For example:
25554
25555 %namewarn("print is a python keyword") print;
25556
25557 The name matching algorithm is performed after a name
25558 has been resolved using %rename. Therefore, a
25559 declaration like this will not generate a warning:
25560
25561 %rename("Print") print;
25562 ...
25563 void print(); /* No warning generated */
25564
25565 Since the warning mechanism follows %rename semantics, it is
25566 also to issue warnings for specific classes or just for
25567 certain member function names.
25568
25569 (Dave - I've been thinking about adding something like this
25570 for quite some time. Just never got around to it)
25571 *** NEW FEATURE ***
25572
25573
255749/27/2001: beazley
25575 Enhanced the %ignore directive so that warning messages
25576 can be issued to users. This is done using %ignorewarn
25577 like this:
25578
25579 %ignorewarn("operator new ignored") operator new;
25580
25581 The names and semantics of %ignorewarn is exactly the
25582 same as %ignore. The primary purpose of this directive
25583 is for module writers who want to ignore certain types
25584 of declarations, but who also want to alert users about it.
25585 A user might also use this for debugging (since messages
25586 will appear whenever an ignored declaration appears).
25587 *** NEW FEATURE ***
25588
255899/26/2001: beazley
25590 Super-experimental support for overloaded operators.
25591 This implementation consists of a few different parts.
25592
25593 (i) Operator names such as 'operator+' are now allowed
25594 as valid declarator names. Thus the 'operator' syntax
25595 can appear *anyplace* a normal declarator name was used
25596 before. On the surface, this means that operators can
25597 be parsed just like normal functions and methods.
25598 However, it also means that operator names can be used
25599 in many other SWIG directives like %rename. For example:
25600
25601 %rename(__add__) Complex::operator+(const Complex &);
25602
25603 (ii) Operators are wrapped *exactly* like normal functions
25604 and methods. Internally, the operator name is used
25605 directly meaning that the wrapper code might contain
25606 statements like this:
25607
25608 arg0->operator*((Complex const &)*arg1);
25609
25610 This all seems to parse and compile correctly (at least
25611 on my machine).
25612
25613 (iii) SWIG will no longer wrap a declaration if its symbol
25614 table name contains illegal identifier characters. If
25615 illegal characters are detected, you will see an error
25616 like this:
25617
25618 Warning. Can't wrap operator* unless renamed to a valid identifier.
25619
25620 The only way to fix this is to use %rename or %name to bind
25621 the operator to a nice name like "add" or something. Note:
25622 the legal identifier characters are determined by the target
25623 language.
25624
25625 There are certain issues with friend functions and operators.
25626 Sometimes, friends are used to define mixed operators such
25627 as adding a Complex and a double together. Currently, SWIG
25628 ignores all friend declarations in a class. A global operator
25629 declaration can probably be made to work, but you'll have to
25630 rename it and it probably won't work very cleanly in the
25631 target language since it's not a class member.
25632
25633 SWIG doesn't know how to handle operator specifications
25634 sometimes used for automatic type conversion. For example:
25635
25636 class String {
25637 ...
25638 operator const char*();
25639 ...
25640 };
25641
25642 (this doesn't parse correctly and generates a syntax error).
25643
25644 Also: operators no longer show up as separate parse-tree
25645 nodes (instead they are normal 'cdecl' nodes). I may
25646 separate them as a special case later.
25647
25648 See Examples/python/operator for an example.
25649
25650 *** SUPER-EXPERIMENTAL NEW FEATURE ***
25651
25652Version 1.3.9 (September 25, 2001)
25653==================================
Olly Bettsfdcea432009-02-26 05:53:37 +000025654
William S Fultonb1641332001-12-15 16:16:30 +0000256559/25/2001: beazley
25656 Fixed parsing problem with type declarations like
25657 'char ** const'. SWIG parsed this correctly, but the
25658 internal type was represented incorrectly (the pointers
25659 and qualifiers were in the wrong order).
25660
256619/25/2001: beazley
25662 Withdrew experimental feature (noted below) that was
25663 causing serious parsing problems.
25664
25665Version 1.3.8 (September 23, 2001)
25666==================================
Olly Bettsfdcea432009-02-26 05:53:37 +000025667
William S Fultonb1641332001-12-15 16:16:30 +0000256689/23/2001: beazley
25669 Included improved distutils setup.py file in the Tools
25670 directory (look for the setup.py.tmpl file). Contributed by
25671 Tony Seward.
25672
256739/23/2001: beazley
25674 Included two new RPM spec files in the Tools directory. Contributed
25675 by Tony Seward and Uwe Steinmann.
25676
256779/21/2001: beazley
25678 Fixed SF Bug [ #463635 ] Perl5.swg does not compile in Visual C++
25679
256809/21/2001: beazley
25681 Two new directives control the creation of default
25682 constructors and destructors:
25683
Dave Beazley74a64552002-06-02 21:00:22 +000025684 %nodefault
William S Fultonb1641332001-12-15 16:16:30 +000025685 %makedefault
25686
25687 These replace %pragma nodefault and %pragma makedefault.
25688 (old code will still work, but documentation will only
25689 describe the new directives).
25690
256919/21/2001: beazley
25692 Fixed SF Bug [ #462354 ] %import broken in 1.3.7.
25693
256949/20/2001: beazley
25695
William S Fultonb1641332001-12-15 16:16:30 +000025696 Parser modified to ignore out-of-class constructor
25697 and destructor declarations. For example:
25698
25699 inline Foo::Foo() :
25700 Bar("foo")
25701 {
25702 }
25703
25704 inline Foo::~Foo() {
25705 }
25706
25707 Suggested by Jason Stewart.
25708 *** EXPERIMENTAL FEATURE ***
25709
257109/20/2001: beazley
25711 Modified the parser to ignore forward template class
25712 declarations. For example:
25713
25714 template <class V, long S> class MapIter;
25715
25716 Suggested by an email example from Irina Kotlova.
25717
257189/20/2001: beazley
25719 Fixed problem with undeclared tcl_result variable in
25720 the "out" typemap for Tcl. Reported by Shaun Lowry.
25721
257229/20/2001: beazley
25723 Incorporated changes to make SWIG work with ActivePerl.
25724 Contributed by Joel Reed.
25725
257269/20/2001: beazley
25727 Slight change to the parsing of C++ constructor initializers.
25728 For example:
25729
25730 class Foo : public Bar {
25731 public:
25732 Foo() : Bar(...) {...}
25733 };
25734
25735 SWIG now discards the contents of the (...) regardless of
25736 what might enclosed (even if syntactically wrong). SWIG
25737 doesn't need this information and there is no reason to
25738 needless add syntax rules to handle all of the possibilities
25739 here.
25740
257419/20/2001: beazley
25742 Change to typemaps for structure members. If you have a
25743 structure like this:
25744
25745 struct Vector {
25746 int *bar;
25747 };
25748
25749 The member name 'bar' is now used in any accessor functions.
25750 This allows the "in" typemap to be used when setting the value.
25751 For example, this typemap
25752
25753 %typemap(python,in) int *bar {
25754 ...
25755 }
25756
25757 now matches Vector::bar. It should be noted that this will also
25758 match any function with an argument of "int *bar" (so you should
25759 be careful).
25760 *** NEW FEATURE. POTENTIAL INCOMPATIBILITY ***
25761
257629/20/2001: beazley
25763 Fixed SF bug #462642 setting string values in structures
25764
257659/20/2001: beazley
25766 Fixed SF bug #462398 problem with nested templates.
25767
257689/20/2001: beazley
25769 Fixed SF bug #461626 problem with formatting and C++ comments.
25770
257719/20/2001: beazley
25772 Fixed SF bug #462845 Wrong ownership of returned objects.
25773
257749/19/2001: beazley
25775 Fixed SF bug #459367. Default constructors for classes
25776 with pure virtual methods.
25777
257789/19/2001: beazley
25779 Fixed problem with default arguments and class scope. For
25780 example:
25781
25782 class Foo {
25783 public:
25784 enum bar { FOO, BAR };
25785 void blah(bar b = FOO);
25786 ...
25787 }
25788
25789 SWIG now correctly generates a default value of "Foo::FOO" for
25790 the blah() method above. This used to work in 1.1, but was
25791 broken in 1.3.7. Bug reported by Mike Romberg.
William S Fulton682783b2001-09-04 10:04:48 +000025792
25793Version 1.3.7 (September 3, 2001)
25794==================================
25795
257969/02/2001: beazley
25797 Added special %ignore directive to ignore declarations. This
25798 feature works exactly like %rename. For example:
25799
25800 %ignore foo; // Ignore all declarations foo
25801 %ignore ::foo; // Only ignore foo in global scope
25802 %ignore Spam::foo; // Only ignore in class Spam
25803 %ignore *::foo; // Ignore in all classes
25804
25805 %ignore can also be parameterized. For example:
25806
25807 %ignore foo(int);
25808 %ignore ::foo(int);
25809 %ignore Spam::foo(int);
25810 %ignore *::foo(int);
25811
25812 *** NEW FEATURE ***
25813
25814
258159/02/2001: cheetah (william fulton)
25816 [Java] shadowcode pragma modified so that the code that is output
25817 in the shadow file is placed relative to where it is placed in the
25818 c/c++ code. This allows support for JavaDoc function comments.
25819
258209/01/2001: beazley
25821 Fixed SF Patch [ #447791 ] Fix for python -interface option.
25822 Submitted by Tarn Weisner Burton.
25823
258249/01/2001: beazley
25825 SWIG no longer generates default constructors/destructors
25826 for a class if it only defines a private/protected constructor
25827 or destructor or if any one of its base classes only has
25828 private constructors/destructors. This was reported in
25829 SF Patch [ #444281 ] nonpublic/default/inhereted ctor/dtor
25830 by Marcelo Matus.
25831
258329/01/2001: beazley
25833 Added patch to Perl5 module that allows constants to be
25834 wrapped as constants that don't require the leading $.
25835 This feature is enabled using the -const option.
25836 Patch contributed by Rich Wales.
25837 *** NEW FEATURE ***
25838
258398/31/2001: beazley
25840 Added parsing support for the 'volatile' type qualifier.
25841 volatile doesn't mean anything to SWIG, but it is
25842 needed to properly generate prototypes for declarations
25843 that use it. It's also been added to make the SWIG type
25844 system more complete.
25845 *** NEW FEATURE ***
25846
258478/30/2001: beazley
25848 Added support for parameterized %rename directive. *** This
25849 new feature can be used to greatly simplify the task of
25850 resolving overloaded methods and functions. ***
25851
25852 In prior versions of SWIG, the %rename directive was
25853 used to consistently apply an identifier renaming. For
25854 example, if you said this:
25855
25856 %rename foo bar;
25857
25858 Every occurrence of 'foo' would be renamed to 'bar'.
25859 Although this works fine for resolving a conflict with a
25860 target language reserved word, it is useless for
25861 for dealing with overloaded methods. This is because
25862 all methods are simply renamed to the same thing
25863 (generating the same conflict as before).
25864
25865 Therefore, the only way to deal with overloaded methods
25866 was to go through and individually rename them all using
25867 %name. For example:
25868
25869 class Foo {
25870 public:
25871 virtual void bar(void);
25872 %name(bar_i) virtual void bar(int);
25873 ...
25874 };
25875
25876 To make matters worse, you had to do this for all
25877 derived classes too.
25878
25879 class Spam : public Foo {
25880 public:
25881 virtual void bar(void);
25882 %name(bar_i) virtual void bar(int);
25883 ...
25884 };
25885
25886 Needless to say, this makes it extremely hard to resolve
25887 overloading without a lot of work and makes it almost
25888 impossible to use SWIG on raw C++ .h files.
25889
25890 To fix this, %rename now accepts parameter declarators.
25891 The syntax has also been changed slightly. For example,
25892 the following declaration renames all occurrences of 'bar(int)'
25893 to 'bar_i', leaving any other occurrence of 'bar' alone.
25894
25895 %rename(bar_i) bar(int);
25896
25897 Using this feature, you can now selectively rename
25898 certain declarations in advance. For example:
25899
25900 %rename(bar_i) bar(int);
25901 %rename(bar_d) bar(double);
25902
25903 // Include raw C++ header
25904 %include "header.h"
25905
25906 When %rename is used in this manner, all occurrence of bar(int)
25907 are renamed wherever they might occur. More control is obtained
25908 through explicit qualification. For example,
25909
25910 %rename(bar_i) ::bar(int);
25911
25912 only applies the renaming if bar(int) is defined in the global scope.
25913 The declaration,
25914
25915 %rename(bar_i) Foo::bar(int);
25916
25917 applies the renaming if bar(int) is defined in a class Foo.
25918 This latter form also supports inheritance. Therefore, if you
25919 had a class like this:
25920
25921 class Spam : public Foo {
25922 public:
25923 void bar(int);
25924 }
25925
25926 The Spam::bar(int) method would also be renamed (since Spam
25927 is a subclass of Foo). This latter feature makes it easy
25928 for SWIG to apply a consistent renaming across an entire
25929 class hierarchy simply by specifying renaming rules for
25930 the base class.
25931
25932 A class wildcard of * can be used if you want to renaming
25933 all matching members of all classes. For example:
25934
25935 %rename(bar_i) *::bar(int);
25936
25937 will rename all members bar(int) that are defined in classes.
25938 It will not renamed definitions of bar(int) in the global
25939 scope.
25940
25941 The old use of %rename is still supported, but is somewhat
25942 enhanced.
25943
25944 %rename(foo) bar; // Renames all occurrences of 'bar'.
25945 %rename(foo) ::bar; // Rename all 'bar' in global scope only.
25946 %rename(foo) *::bar; // Rename all 'bar' in classes only.
25947 %rename(foo) Foo::bar; // Rename all 'bar' defined in class Foo.
25948
25949 *** NEW FEATURE ***
25950
259518/30/2001: beazley
25952 Added support for data-member to member-function
25953 transformation. For example, suppose you had a
25954 structure like this:
25955
25956 struct Vector {
25957 double x,y;
25958 };
25959
25960 Now suppose that you wanted to access x and y
25961 through a member function interface instead
25962 of the usual SWIG behavior. For example:
25963
25964 f.set_x(3.4) # instead of f.x = 3.4
25965 x = f.get_x() # instead of x = f.x
25966
25967 To do this, simply use the new %attributefunc
25968 directive. For example:
25969
25970 %attributefunc(get_%s,set_%s)
25971 struct Vector {
25972 double x,y;
25973 };
25974 %noattributefunc
25975
25976 The arguments to %attributefunc are C-style printf
25977 format strings that determine the naming convention
25978 to use. %s is replaced with the actual name of the
25979 data member. SWIG provides a number of printf
25980 extensions that might help. For example, if you
25981 wanted to title case all of the attributes, you
25982 could do this:
25983
25984 %attributefunc(get%(title)s,set%(title)s);
25985
25986 This will turn an attribute 'bar' to 'getBar()' and 'setBar()'.
25987
25988 (someone requested this long ago, but I finally figured
25989 how to implement it in a straightforward manner).
William S Fultonb1641332001-12-15 16:16:30 +000025990 *** EXPERIMENTAL NEW FEATURE ***
William S Fulton682783b2001-09-04 10:04:48 +000025991
259928/30/2001: beazley
25993 SWIG now automatically generates default constructors
25994 and destructors if none are defined. This used to be
25995 enabled with a command line switch -make_default, but
25996 most people want these functions anyways. To turn
25997 off this behavior use the -no_default option or include
25998 the following pragma in the interface file:
25999
26000 %pragma no_default;
26001
26002 This may break certain interfaces that defined their
26003 own constructors/destructors using the same naming
26004 convention as SWIG. If so, you will get duplicate
26005 symbols when compiling the SWIG wrapper file.
26006 *** POTENTIAL INCOMPATIBILITY ***
26007
260088/29/2001: beazley
26009 Changes to Perl5 shadow class code generation. Iterators
26010 are no longer supported (FIRSTKEY, NEXTKEY). Also, attribute
26011 access has been changed to rely on inheritance in order
26012 to provide better behavior across modules.
26013
260148/28/2001: beazley
26015 Various obscure improvements to the type system and classes.
26016 Strange declarations like this are now wrapped correctly
26017 (i.e., the generated wrapper code doesn't cause the C++
26018 compiler to die with a type error).
26019
26020 class Foo {
26021 public:
26022 typedef double Real;
26023 Real foo(Real (*op)(Real,Real), Real x, Real y);
26024 };
26025
26026 Inheritance of types is also handled correctly.
26027
260288/28/2001: beazley
26029 Changes to class wrappers. When SWIG sees two classes like this,
26030
26031 class X {
26032 public:
26033 void foo();
26034 ...
26035 }
26036
26037 class Y : public X {
26038 public:
26039 void bar();
26040 ...
26041 }
26042
26043 it now only generates two wrapper functions:
26044
26045 X_foo(X *x) { x->foo(); }
26046 Y_bar(Y *y) { y->bar(); }
26047
26048 Unlike SWIG1.15, the foo() method does *not* propagate to a wrapper
26049 function Y_foo(). Instead, the base class method X_foo() must be
26050 used.
26051
26052 This change should not affect modules that use shadow classes, but
26053 it might break modules that directly use the low-level C wrappers.
26054 This change is being made for a number of reasons:
26055
26056 - It greatly simplifies the implementation of SWIG--especially
26057 with anticipated future changes such as overloaded methods.
26058
26059 - It results in substantially less wrapper code--especially
26060 for big C++ class hierarchies (inherited declarations
26061 are no longer copied into every single derived class).
26062
26063 - It allows for better code generation across multiple
26064 SWIG generated modules (code isn't replicated in
26065 every single module).
26066
26067 *** POTENTIAL INCOMPATIBILITY ***
26068
260698/22/2001: cheetah (william fulton)
26070 Provided some Windows documentation in the Win directory and some
26071 Visual C++ project files for running examples on Windows.
26072
260738/28/2001: mkoeppe
26074 [Guile] Handle renamed overloaded functions properly;
26075 thanks to Marc Zonzon <[email protected]> for the
26076 patch. See the new test case name_cxx.
26077
260788/27/2001: mkoeppe
26079 [Tcl] Removed lots of warnings issued by the Sun Forte
26080 compilers, which were caused by mixing function pointers
26081 of different linkages (C++/C).
26082
260838/23/2001: mkoeppe
26084 Improved the MzScheme module by porting Guile's pointer
26085 type checking system and making type dispatch
26086 typemap-driven.
26087
260888/22/2001: beazley
26089 Entirely new symbol table processing. SWIG should be able to
26090 report much better error messages for multiple declarations.
26091 Also, the new symbol table allows for overloaded functions
26092 (although overloading isn't quite supported in the language
26093 modules yet).
26094
260958/22/2001: cheetah (william fulton)
26096 * [Java] %new support added.
26097 * [Java] Package JNI name refixed!
26098
260998/19/2001: beazley
26100 Python module modified to support pointers to C++ members. This
26101 is an experimental feature.
26102 *** NEW FEATURE ***
26103
261048/19/2001: beazley
26105 Added limited parsing and full type-system support for pointers to
26106 members. None of SWIG's language modules really know how to deal with
26107 this so this is really only provided for completeness and future
26108 expansion. Note: SWIG does not support pointers to members which
26109 are themselves pointers to members, references to pointers to members,
26110 or other complicated declarations like this.
26111 *** NEW FEATURE ***
26112
261138/19/2001: beazley
26114 SWIG is much better at parsing certain C++ declarations. Operators and
26115 friends generally don't cause anymore syntax errors. However, neither
26116 are really supported.
26117
261188/18/2001: beazley
26119 Added *highly* experimental support for wrapping of C++
26120 template declarations. Since C++ templates are essentially
26121 glorified macros and SWIG has a fully operational C
26122 preprocessor with macro support, the parser now converts
26123 template declarations to macros. For example, a function
26124 template like this
26125
26126 template<class T> T max(T a, T b);
26127
26128 is internally converted into a macro like this:
26129
26130 %define %_template_max(__name,T)
26131 %name(__name) T max(T a, T b);
26132 %enddef
26133
26134 To instantiate a version of the template, a special %template declaration
26135 is used like this:
26136
26137 %template(maxint) max<int>;
26138 %template(maxdouble) max<double>;
26139
26140 The parameter to the %template directive must be proper C identifier that's
26141 used to uniquely name the resulting instantiation. When used, the
26142 the expanded macro looks like this:
26143
26144 %name(maxint) int max(int a, int b);
26145 %name(maxdouble) double max(double a, double b);
26146
26147 A similar technique is used for template classes. For instance:
26148
26149 template<class T> class vector {
26150 T *data;
26151 int sz;
26152 public:
26153 vector(int nitems);
26154 T *get(int n);
26155 ...
26156 };
26157
26158 Gets converted into a macro like this:
26159
26160 %define %_template_vector(__name, T)
26161 %{
26162 typedef vector<T> __name;
26163 %}
26164 class __name {
26165 T *data;
26166 int sz;
26167 public:
26168 __name(int nitems);
26169 T *get(int n);
26170 ...
26171 };
26172 typedef __name vector<T>;
26173 %enddef
26174
Olly Betts90f91172017-08-13 18:04:33 +120026175 A specific instantiation is created in exactly the same way:
William S Fulton682783b2001-09-04 10:04:48 +000026176
26177 %template(intvec) vector<int>;
26178
26179 The resulting code parsed by SWIG is then:
26180
26181 %{
26182 typedef vector<int> intvec;
26183 %}
26184 class intvec {
26185 int *data;
26186 int sz;
26187 public:
26188 intvec(int nitems);
26189 int *get(int n);
26190 ...
26191 };
26192 typedef intvec vector<int>;
26193
26194 Note: the last typedef is non-standard C and is used by SWIG to provide
26195 an association between the name "intvec" and the template type
26196 "vector<int>".
26197
26198 CAUTION: This is an experimental feature and the first time SWIG has
26199 supported C++ templates. Error reporting is essential non-existent.
26200 It will probably break in certain cases.
26201 *** EXPERIMENTAL NEW FEATURE ****
26202
262038/15/2001: beazley
26204 Change to wrapping of multi-dimensional arrays. Arrays
26205 are now properly mapped to a pointer to an array of
26206 one less dimension. For example:
26207
26208 int [10]; --> int *
26209 int [10][20]; --> int (*)[20];
26210 int [10][20][30]; --> int (*)[20][30];
26211
26212 This change may break certain SWIG extensions because
26213 older versions simply mapped all arrays into a single
26214 pointer such as "int *". Although possibly unusual,
26215 the new version is correct in terms of the C type system.
26216 *** POTENTIAL INCOMPATIBILITY ***
26217
262188/06/2001: cheetah (william fulton)
26219 * [Java] Array setters generated for struct/class array members.
26220
262218/13/2001: beazley
26222 Many improvements to Tcl/Perl/Python modules to better
26223 work with multiple interface files and the %import directive.
26224
262258/13/2001: beazley
26226 Fixed up the behavior of %import in the Python module.
26227 SWIG no longer pollutes the module namespace by using
26228 'from module import *' to refer to the other module.
26229 Instead, it does a proper 'import module'. Also, SWIG
26230 may work a lot better when importing modules that include
26231 references to other imported modules.
26232
262338/13/2001: mkoeppe
26234 Added new typemap substitutions, generalizing those of the
26235 Guile-specific 5/27/2001 changes:
26236 * $descriptor is the same as SWIGTYPE$mangle, but also
26237 ensures that the type descriptor of this name gets
26238 defined.
26239 * $*type, $*ltype, $*mangle, $*descriptor are the same as
26240 the variants without star, but they REMOVE one level of
26241 pointers from the type. (This is only valid for pointer
26242 types.)
26243 * $&type, $&ltype, $&mangle, $&descriptor are the same as
26244 the variants without ampersand, but they ADD one level of
26245 pointers to the type.
26246 The Guile-specific substitution $basedescriptor was removed
26247 because it was useless.
26248
262498/12/2001: beazley
26250 The %extern directive is now deprecated and withdrawn. The
26251 purpose of this directive was to import selected definitions
26252 from other interface files and headers. However, the same
26253 functionality is better handled through %import. This
26254 leaves SWIG with two file inclusion directives:
26255
26256 %include filename - Inserts into current interface
26257 %import filename - Import types and classes from
26258 another module
26259
26260 *** POTENTIAL INCOMPATIBILITY ***
26261
262628/09/2001: beazley
26263 Added new support for wrapping C/C++ callback functions.
26264 A common problem with some C libraries is that many
26265 functions take a function pointer as an argument. For example:
26266
26267 int do_op(..., int (*op)(int,int), ...);
26268
26269 Unfortunately, the only way to call such a function is to
26270 pass it a function pointer of some compatible type. In
26271 previous versions of SWIG, you had to solve this problem
26272 with some really gross hacks. For example, if you wanted to
26273 use the following function as a callback,
26274
26275 int foo(int, int);
26276
26277 you had to install a pointer to it as a constant. For example:
26278
26279 %constant int (*FOO)(int,int) = foo;
26280
26281 or
26282
26283 const int (*FOO)(int,int) = foo;
26284
26285 or if you had a really old SWIG version:
26286
26287 typedef int (*OP_FUNC)(int,int);
26288 int do_op(..., OP_FUNC, ...);
26289 const OP_FUNC FOO = foo;
26290
26291
26292 Now, you can do one of two things:
26293
26294 %constant int foo(int,int);
26295
26296 This creates a constant 'foo' of type int (*)(int,int).
26297 Alternatively, you can do this:
26298
William S Fulton258e9d72007-08-02 23:23:05 +000026299 %callback("%s");
William S Fulton682783b2001-09-04 10:04:48 +000026300 int foo(int,int);
26301 int bar(int,int);
William S Fulton258e9d72007-08-02 23:23:05 +000026302 %nocallback;
William S Fulton682783b2001-09-04 10:04:48 +000026303
26304 In this case, the functions are installed as constants where
26305 the name is defined by the format string given to %callback().
26306 If the names generated by the format string differ from the
26307 actual function name, both a function wrapper and a callback
26308 constant are created. For example:
26309
William S Fulton258e9d72007-08-02 23:23:05 +000026310 %callback("%(upper)s");
William S Fulton682783b2001-09-04 10:04:48 +000026311 int foo(int,int);
26312 int bar(int,int);
William S Fulton258e9d72007-08-02 23:23:05 +000026313 %nocallback;
William S Fulton682783b2001-09-04 10:04:48 +000026314
26315 Creates two wrapper functions 'foo', 'bar' and additionally
26316 creates two callback constants 'FOO', 'BAR'.
26317
26318 Note: SWIG still does not provide automatic support for
26319 writing callback functions in the target language.
26320 *** NEW FEATURE ***
26321
263228/06/2001: cheetah (william fulton)
26323 * struct nesting fixes as per SF bug #447488.
26324
263258/03/2001: beazley
26326 The %name directive now applies to constants created with
26327 #define and %constant. However, most language modules
26328 were never written to support this and will have to be
26329 modified to make it work. Tcl, Python, and Perl modules
26330 are working now.
26331 *** NEW FEATURE ***
26332
263338/03/2001: beazley
26334 Massive changes and simplification of C declaration parsing.
26335 Although SWIG is still not a full C parser, its ability
26336 to handle complex datatypes including pointers to functions
26337 and pointers to arrays has been vastly improved.
26338
263398/03/2001: cheetah (william fulton)
26340 * Distribution fixes: autoconf no longer needed to install SWIG.
26341
263428/02/2001: beazley
26343 Removed two undocumented parsing features. SWIG no longer
26344 supports out-of-class static function or variable
26345 declarations. For example:
26346
26347 static int Foo::bar;
26348
26349 This feature may return if there is sufficient demand.
26350 However, since SWIG is most often used with header files,
26351 it is more likely for these definitions to be included
26352 in the class definition.
26353 *** POTENTIAL INCOMPATIBILITY ***
26354
263558/02/2001: cheetah (william fulton)
26356 * Cleanup of the GIFPlot examples. Upgraded Java GIFPlot example.
26357
263588/01/2001: cheetah (william fulton)
26359 * [Java] Efficiency changes: _cPtr used where possible rather than
26360 getCPtr(). Bug fixes for inheritance - derived class sometimes
26361 didn't delete the c memory when _delete() was called.
26362 * [Java] Abstract c++ classes are wrapped with a java abstract shadow
26363 class. Also a pure virtual function is mapped with an abstract method.
26364 * The default output file has always been <module>_wrap.c. It is now
26365 <module>_wrap.cxx if the -c++ commandline option is passed to swig.
26366 This has been done as otherwise c++ code would appear in a c file.
26367 *** POTENTIAL INCOMPATIBILITY ***
26368
263697/31/2001: beazley
26370 Modified the %constant directive to be more C-like in syntax.
26371 The syntax is now:
26372
26373 %constant NAME = VALUE;
26374 %constant TYPE NAME = VALUE;
26375
26376 For example:
26377
26378 %constant Foo *Bar = &Spam;
26379
26380 A more subtle case is as follows:
26381
26382 %constant int (*FOO)(int,int) = blah;
26383
26384 *** POTENTIAL INCOMPATIBILITY *** Modules that were using
26385 the %constant directive directly will need to be modified.
26386
263877/30/2001: beazley
26388 Removed obscure and undocumented form of the %inline directive:
26389
26390 %inline int blah(int a, int b) {
26391 ...
26392 }
26393
26394 *** POTENTIAL INCOMPATIBILITY ***
26395 (note: this feature was never documented and is withdrawn)
26396
263977/30/2001: beazley
26398 Removed support for functions with no explicitly declared
26399 return type. For example:
26400
26401 foo(int);
26402
26403 In C, such functions were implicitly assumed to return an 'int'.
26404 In C++, this is illegal. Either way, it's considered bad
26405 style. Removing support for this in SWIG will simplify
26406 certain issues in parsing.
26407 *** POTENTIAL INCOMPATIBILITY ***
26408
264097/30/2001: mkoeppe
26410 * Partial merge from the CVS trunk. The Source/DOH directory
26411 and most of the Source/Swig directory is up-to-date now.
26412 * [Guile] %scheme is now a macro for %insert("scheme").
26413 New syntax: %scheme "FILENAME";
26414 New syntax: %scheme %{ SCHEME-CODE %}
26415 New macros %multiple_values, %values_as_list,
26416 %values_as_vector.
26417
264187/29/2001: beazley
26419 %readonly and %readwrite have been turned into SWIG pragmas.
26420 %pragma(swig) readonly and %pragma(swig) readwrite. Macros
26421 are used to provide backwards compatibility.
26422
264237/29/2001: beazley
26424 Minor changes to %pragma directive. %pragma must always
26425 be directed to a specific language. For example:
26426
26427 %pragma(swig) make_default;
26428 %pragma(perl5) include = "blah.i";
26429
26430 Also extended the pragma directive to allow code blocks
26431
26432 %pragma(foo) code = %{
26433 ... some code ...
26434 %}
26435
26436 *** POTENTIAL INCOMPATIBILITY ***
26437
264387/29/2001: beazley
26439 Change to the way 'const' variables are wrapped. In
26440 previous versions of SWIG, a 'const' variable was
26441 wrapped as a constant. Now, 'const' variables are
26442 wrapped as read-only variables. There are several
26443 reasons for making this change, mostly pertaining to
26444 subtle details of how 'const' actually works.
26445
26446 This will probably break old interfaces that used 'const'
26447 to create constants. As a replacement, consider using this:
26448
Dave Beazley74a64552002-06-02 21:00:22 +000026449 const int a = 4; ===> %constant int a = 4;
William S Fulton682783b2001-09-04 10:04:48 +000026450 *** POTENTIAL INCOMPATIBILITY ***
26451
264527/29/2001: beazley
26453 Reorganization and simplification of type parsing.
26454 Types with 'const' should work correctly now.
26455
264567/29/2001: beazley
26457 Most swig directives related to the documentation system
26458 are now deprecated.
26459
264607/29/2001: beazley
26461 Removed support for Objective-C in order to simplify
26462 parser reconstruction. Will return if there is sufficient
26463 demand.
26464 *** POTENTIAL INCOMPATIBILITY ***
26465
264667/29/2001: beazley
26467 Code inclusion has been modified in the parser. A common
26468 directive %insert is now used for everything. This
26469 inserts a file into the output:
26470
26471 %insert(header) "foo.swg"
26472
26473 This inserts some inline code into the output
26474
26475 %insert(header) %{
26476 ... some code ...
26477 %}
26478
26479 There are five predefined targets for the insert directive:
26480
26481 "header" - Header section of wrapper file
26482 "runtime" - Runtime section of wrapper file
26483 "wrapper" - Wrapper section
26484 "init" - Initialization function
26485 "null" - Nothing. Discard.
26486
26487 The following directives are still supported, but are
26488 now defined in terms of macros:
26489
26490 %{ ... %} -> %insert(header) %{ ... %}
26491 %init %{ ... %} -> %insert(init) %{ ... %}
26492 %wrapper %{ ... %} -> %insert(wrapper) %{ ... %}
26493 %runtime %{ ... %} -> %insert(runtime) %{ ... %}
26494
26495 Language modules can define new named targets by using the
26496 C API function Swig_register_filebyname() (see main.cxx).
26497 For example, if you wanted to expose a shadow class file,
26498 you could do this:
26499
26500 Swig_register_filebyname("shadow", f_shadow);
26501
26502 Then in the interface file:
26503
26504 %insert(shadow) %{ ... %}
26505
26506 Note: this change should not affect any old interfaces, but
26507 does open up new possibilities for enhancements.
26508
265097/29/2001: beazley
26510 SWIG now always includes a standard library file 'swig.swg'.
26511 This file defines a large number of macro definitions
26512 that define the behavior of various SWIG directives.
26513 Previously, all SWIG directives were handled as special
26514 cases in the parser. This made the parser a large
26515 bloated mess. Now, the parser is stripped down to a few
26516 simple directives and macros are used to handle everything else.
26517
265187/26/2001: cheetah (william fulton)
26519 * Fixes for Sourceforge bug #444748 - new testcase cpp_static:
26520 [TCL] Class with just static member variable/function fix
26521 [Java] Fixed static variables support
26522 [Ruby] Static variables workaround removed
26523
265247/27/2001: mkoeppe
26525 * stype.c (SwigType_default): Strip qualifiers first. The
26526 default type of "int * const" is now "SWIGPOINTER *".
26527 * main.cxx: Define "__cplusplus" in SWIG's preprocessor if
26528 in C++ mode.
26529 * [Guile]: Added some support for arrays and C++
26530 references, fixing the "constant_pointers" test case.
26531 * Moved most tests from the old Guile-specific test-suite
26532 to the new test-suite. Also moved perl5/pointer-cxx
26533 example there.
26534
265357/26/2001: cheetah (william fulton)
26536 * Test-suite added.
26537 * Initial testcases: constant_pointers cpp_enum defines
26538 sizeof_pointers unions virtual_destructor
26539 * Make clean improvements.
26540
265417/24/2001: cheetah (william fulton)
26542 * [Java] Underscores in the package name and/or module name
26543 no longer give linking problems.
26544
265457/17/2001: cheetah (william fulton)
26546 * More parser bug fixes for constant pointers
26547
265487/19/2001: mkoeppe
26549 * [Guile] Aesthetic improvement in variable wrappers.
26550
265517/18/2001: beazley
26552 * Fixed core-dump problem in pointer library when
26553 freeing character arrays.
26554 SF Bug [ #415837 ] pointer lib core dump
26555
265567/18/2001: beazley
26557 * Fixed problem with default destructors and shadow
26558 classes. SF bug #221128.
26559
265607/18/2001: beazley
26561 * To provide better line-number tracking in interfaces
26562 with lots of macros, special locator comments are
26563 now generated by the SWIG preprocessor. For example:
26564
26565 /*@foo.i,42,BLAH@*/expanded macro/*@@*/
26566
26567 The first /*@...@*/ sequence sets the context
26568 to point to the macro code. The /*@@*/ comment
26569 terminates the context. The SWIG parser should
26570 ignore all of the locator comments as should
26571 the C compiler (should such comments end up
26572 in generated wrapper code).
26573
265747/18/2001: mkoeppe
26575 * The parser now handles severely constified types in
26576 typemaps. This introduced a new shift/reduce conflict, but
26577 only with a heuristic function-pointer catch-all rule.
26578 * [Guile]: Added typemaps for severely constified types.
26579 * Fixed the "template-whitespace" problem by canonicalizing
26580 whitespace, especially around angle brackets and commas.
26581
265827/17/2001: mkoeppe
26583 * [Guile]: A Scheme file is emitted if the -scmstub FILE.SCM
26584 command-line option is used. The %scheme directive
26585 (implemented as a macro for a pragma) allows to insert
26586 arbitrary code here. In "simple" and "passive" linkage,
26587 the file gets filled with define-module and export
26588 declarations.
26589
265907/17/2001: cheetah (william fulton)
26591 * Parser bug fix to support constant pointers, eg int* const ptr.
26592 Fixed everywhere - variables, parameters, return types etc. Note that
26593 when wrapping a constant pointer variable only the getter is generated.
26594
265957/17/2001: mkoeppe
26596 * Fixed SF bug #441470 (#define X "//" would not be parsed,
26597 see test-suite entry "preproc-1"), reported by T. W. Burton
26598 <[email protected]>.
26599 * Changed the type of character constants to "char", rather
26600 than "char *". Changed the individual language modules
26601 to keep the old behaviour, except for the Guile module,
26602 where it is desired to make them Scheme characters. This
26603 fixes SF bug #231409, test-suite entry "char-constant".
26604 * Applied patch for DOH/Doh/memory.c by Les Schaffer
26605 <[email protected]> (avoid required side effects in
26606 assert).
26607
266087/17/2001: cheetah (william fulton)
26609 * Bug fix in parser for virtual destructor with void as parameter
26610 * Bug fix in parser #defines embedded within classes/structs/unions
26611 Consequently %constant can now also be placed within a struct/class/union.
26612 * Bug fix in parser to allow sizeof(*I_am_a_pointer) within a #define
26613
266147/16/2001: mkoeppe
26615 * Added changes for the Macintosh contributed by Luigi
26616 Ballabio <[email protected]>.
26617 * Some "const" fixes in the code.
26618 * [Guile]: Made the constant-wrapper functions much shorter.
26619
266207/13/2001: mkoeppe
26621 * [Guile]: Some "const" fixes for Guile version 1.3.4.
26622 * Handle anonymous arguments with default values and static
26623 array members of classes. Both bugs reported by Annalisa Terracina
26624 <[email protected]>; see the files
26625 Examples/guile/test-suite/static-array-member.i and
26626 anonymous-arg.i.
Dave Beazleyd07b6612001-02-04 03:24:05 +000026627
William S Fulton76d99c72001-08-01 16:08:34 +000026628Version 1.3.6 (July 9, 2001)
26629=============================
Dave Beazleyd07b6612001-02-04 03:24:05 +000026630
William S Fulton76d99c72001-08-01 16:08:34 +0000266317/09/2001: cheetah (william fulton)
26632 * GIFPlot examples: FOREGROUND and BACKGROUND definition missing
26633 after TRANSPARENT #define fix in GIFPlot
Dave Beazley4a81f602000-12-24 04:06:48 +000026634
William S Fulton76d99c72001-08-01 16:08:34 +0000266357/03/2001: beazley
26636 Fixed up the version numbers so that the release is known
26637 as 1.3.6. All future releases should have a similar
26638 version format.
Thien-Thi Nguyen37d919d2001-01-17 02:25:33 +000026639
William S Fulton76d99c72001-08-01 16:08:34 +0000266407/02/2001: mkoeppe
26641 * [Python]: Prevent the problem of self.thisown not being
26642 defined if the C++ class constructor raised an exception.
26643 Thanks to Luigi Ballabio <[email protected]>.
Thien-Thi Nguyenb8384c52001-01-17 01:57:32 +000026644
William S Fulton76d99c72001-08-01 16:08:34 +0000266456/29/2001: mkoeppe
26646 * More portability fixes; fixed "gcc -Wall" warnings.
Dave Beazley4a81f602000-12-24 04:06:48 +000026647
William S Fulton76d99c72001-08-01 16:08:34 +0000266486/29/2001: cheetah (william fulton)
26649 * GIFPlot examples: TRANSPARENT #define multiple times on Solaris
26650 (clashes with stream.h).
26651 * Multiple definition bug fix for shadow classes. The perl and python
26652 modules had workarounds which have been replaced with fixes in
26653 the core. Many of the Language::cpp_xxxx functions now set a
26654 flag which the derived classes can access through
26655 is_multiple_definition() to see whether or not code should be
26656 generated. The code below would have produced varying degrees
26657 of incorrect shadow class code for the various modules:
26658 class TestClass
26659 {
26660 public:
Olly Bettse047d2e2014-11-05 10:17:22 +130026661 TestClass() {}
26662 TestClass(int a) {}
26663 ~TestClass() {}
26664 unsigned long xyz(short k) {}
26665 unsigned long xyz(int n) {}
26666 static void static_func() {}
26667 static void static_func(int a) {}
William S Fulton76d99c72001-08-01 16:08:34 +000026668 };
26669 void delete_TestClass(int a);
Dave Beazley4a81f602000-12-24 04:06:48 +000026670
William S Fulton76d99c72001-08-01 16:08:34 +0000266716/27/2001: mkoeppe
26672 * [Perl] Another const-related portability fix.
Dave Beazley4a81f602000-12-24 04:06:48 +000026673
William S Fulton76d99c72001-08-01 16:08:34 +0000266746/26/2001: cheetah (william fulton)
26675 * [Java] Added in cpp_pragma() support with a host of new pragmas - see
26676 jswig.html. These are designed for better mixing of Java and c++. It
26677 enables the user to specify pure Java classes as bases and/or interfaces
26678 for the wrapped c/c++.
26679 * [Java] Old pragmas renamed. Warning given for the moment if used.
26680 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
Dave Beazley4a81f602000-12-24 04:06:48 +000026681
William S Fulton76d99c72001-08-01 16:08:34 +0000266826/25/2001: mkoeppe
26683 * Incorporated more build changes contributed by Wyss Clemens
26684 <[email protected]> for swig/ruby on cygwin.
Dave Beazley4a81f602000-12-24 04:06:48 +000026685
William S Fulton76d99c72001-08-01 16:08:34 +0000266866/20/2001: cheetah (william fulton)
26687 * Makefile mods so that 'make check' uses the swig options in the makefiles
26688 * [Java] Removed Generating wrappers message
26689 * [Java] NULL pointer bug fix
26690 * [Java] Bug fix for Kaffe JVM
Dave Beazley4a81f602000-12-24 04:06:48 +000026691
William S Fulton76d99c72001-08-01 16:08:34 +0000266926/20/2001: mkoeppe
26693 * SWIG_TypeQuery from common.swg now returns a
26694 swig_type_info* rather than a void*. This fixes a problem
26695 when using pointer.i and C++, as illustrated by the new
26696 test-suite example perl5/pointer-cxx.
26697 * Portability fixes (const char *).
26698 * Incorporated build changes contributed by Wyss Clemens
26699 <[email protected]>, which make swig runnable on cygwin.
Dave Beazley4a81f602000-12-24 04:06:48 +000026700
William S Fulton76d99c72001-08-01 16:08:34 +0000267016/19/2001: cheetah (william fulton)
26702 * [Java] Bug fix for SF bug #211144. This fix is a workaround
26703 until fixed in the core.
Dave Beazley4a81f602000-12-24 04:06:48 +000026704
William S Fulton76d99c72001-08-01 16:08:34 +0000267056/19/2001: mkoeppe
26706 * [Guile]: Portability fixes for use with the Sun Forte
26707 compilers.
26708 * [Tcl]: Portability fix (const char *).
26709 * [Tcl]: Configure now first tries to find a tclConfig.sh
26710 file in order to find the Tcl include directory, library
26711 location and library name.
26712 * [Python]: Added a few possible library locations.
Dave Beazley4a81f602000-12-24 04:06:48 +000026713
William S Fulton76d99c72001-08-01 16:08:34 +0000267146/18/2001: mkoeppe
26715 * [Guile]: Don't call scm_c_export if nothing is to be
26716 exported. Don't warn on %module if module has been set
26717 already (this frequently occurs when %import is used).
Dave Beazley4a81f602000-12-24 04:06:48 +000026718
William S Fulton76d99c72001-08-01 16:08:34 +0000267196/16/2001: mkoeppe
26720 * [Guile]: New "passive" linkage, which is appropriate for
26721 multi-module extensions without Guile module magic.
Thien-Thi Nguyen37d919d2001-01-17 02:25:33 +000026722
William S Fulton76d99c72001-08-01 16:08:34 +0000267236/15/2001: mkoeppe
26724 * [Guile]: Fixed printing of smobs (space and angle were
26725 missing).
26726 * Properly generate type information for base classes
26727 imported with the %import directive. Thanks to Marcelo
26728 Matus <[email protected]> for the report and the
26729 patch; this closes SF bug #231619; see also
26730 Examples/guile/test-suite/import*.
26731 * [Guile]: Fix casting between class and base class; the
26732 runtime type system had it the wrong way around; see
26733 Examples/guile/test-suite/casts.i
26734 * Make typemaps for SWIGPOINTER * with arg name take
26735 precedence over those without arg name, to match normal
26736 typemap precedence rules.
26737 * Fixed the random-line-numbers problem reported as SF bug
26738 #217310; thanks to Michael Scharf <[email protected]>.
26739 * [Guile]: Handle the %name and %rename directives.
26740 * New syntax: %name and %rename now optionally take double
26741 quotes around the scripting name. This is to allow scripting
26742 names that aren't valid C identifiers.
Dave Beazley4a81f602000-12-24 04:06:48 +000026743
William S Fulton76d99c72001-08-01 16:08:34 +0000267446/14/2001: beazley
26745 Made a minor change to the way files are loaded in
26746 order to get file/line number reporting correct in
26747 the preprocessor.
Thien-Thi Nguyen37d919d2001-01-17 02:25:33 +000026748
William S Fulton76d99c72001-08-01 16:08:34 +0000267496/14/2001: mkoeppe
26750 * The parser now understands the (non-standard) "long long"
26751 types. It is up to the individual language modules to
26752 provide typemaps if needed. Reported by Sam Steingold, SF
26753 bug #429176.
26754 * The parser now understands arguments like "const int *
26755 const i". This fixes SF bug #215649.
26756 * Fixed the Guile test-suite.
Dave Beazley4a81f602000-12-24 04:06:48 +000026757
William S Fulton76d99c72001-08-01 16:08:34 +0000267586/13/2001: mkoeppe
26759 Partial merge from the CVS trunk at tag
26760 "mkoeppe-merge-1". This covers the following changes:
Dave Beazley4a81f602000-12-24 04:06:48 +000026761
William S Fulton76d99c72001-08-01 16:08:34 +000026762| 01/16/01: ttn
26763| Wrote table of contents for Doc/engineering.html. Added section
26764| on CVS tagging conventions. Added copyright to other docs.
26765| 9/25/00 : beazley
26766| Modified the preprocessor so that macro names can start with a '%'.
26767| This may allow new SWIG "directives" to be defined as macros instead
26768| of having to be hard-coded into the parser.
26769|
26770| *** Also a yet-to-be-documented quoting mechanism with backquotes
26771| *** has been implemented?
Dave Beazley4a81f602000-12-24 04:06:48 +000026772
William S Fulton76d99c72001-08-01 16:08:34 +0000267736/13/2001: mkoeppe
26774 * When configure does not find a language, don't use default
26775 paths like /usr/local/include; this only causes build
26776 problems.
26777 * New directory: Examples/Guile/test-suite, where a few
26778 bugs in 1.3a5 are demonstrated.
26779 * Handle C++ methods that have both a "const" and a "throw"
26780 directive (see Examples/Guile/test-suite/cplusplus-throw.i);
26781 thanks to Scott B. Drummonds for the report and the fix.
26782 * Handle C++ pointer-reference arguments (like "int *& arg")
26783 (see Examples/Guile/test-suite/pointer-reference.i,
26784 reported as SF bug #432224).
26785 * [Ruby] Fixed typo in rubydec.swg; thanks to Lyle Johnson!
26786 * Don't stop testing when one test fails.
26787 * [Guile, MzScheme] Don't print "Generating wrappers...".
Dave Beazley4a81f602000-12-24 04:06:48 +000026788
William S Fulton76d99c72001-08-01 16:08:34 +0000267896/12/2001: mkoeppe
26790 [Guile] VECTORLENINPUT and LISTLENINPUT now have separate
26791 list length variables. TYPEMAP_POINTER_INPUT_OUTPUT
26792 attaches argument documentation involving SCM_TYPE to the
26793 standard pointer typemaps. INOUT is now an alias for BOTH.
Dave Beazley4a81f602000-12-24 04:06:48 +000026794
William S Fulton76d99c72001-08-01 16:08:34 +0000267956/12/2001: cheetah (william fulton)
26796 Some Java documentation added.
26797 [Java] Fixed bugs in import pragma and shadow pragma.
Dave Beazley4a81f602000-12-24 04:06:48 +000026798
William S Fulton76d99c72001-08-01 16:08:34 +0000267996/12/2001: mkoeppe
26800 Fix declarations of SWIG_define_class
26801 (Lib/ruby/rubydec.swg) and SWIG_TypeQuery
26802 (Lib/common.swg). Thanks to Lyle Johnson
26803 <[email protected]> for the patches.
Dave Beazley4a81f602000-12-24 04:06:48 +000026804
William S Fulton76d99c72001-08-01 16:08:34 +0000268056/11/2001: mkoeppe
26806 [Guile] Use long instead of scm_bits_t; this makes the
26807 generated wrapper code compatible with Guile 1.3.4
26808 again. Thanks to Masaki Fukushima for pointing this out.
Dave Beazley4a81f602000-12-24 04:06:48 +000026809
William S Fulton76d99c72001-08-01 16:08:34 +0000268106/11/2001: cheetah (william fulton)
26811 The generic INSTALL file from autoconf added. Few changes to README file.
Dave Beazley4a81f602000-12-24 04:06:48 +000026812
William S Fulton76d99c72001-08-01 16:08:34 +0000268136/11/2001: mkoeppe
26814 Fixed typo in Makefile.in; thanks to Greg Troxel
26815 <[email protected]>.
Dave Beazley4a81f602000-12-24 04:06:48 +000026816
William S Fulton76d99c72001-08-01 16:08:34 +0000268176/08/2001: cheetah (william fulton)
26818 make check works again. Examples/GIFPlot configure generated by
26819 top level autoconf now.
Dave Beazley4a81f602000-12-24 04:06:48 +000026820
William S Fulton76d99c72001-08-01 16:08:34 +0000268216/08/2001: mkoeppe
26822 Another build change: The new script autogen.sh runs
26823 autoconf in the appropriate directories. The top-level
26824 configure also configures in Examples/GIFPlot.
Dave Beazleyc8a73192000-10-14 16:08:01 +000026825
William S Fulton76d99c72001-08-01 16:08:34 +0000268266/07/2001: mkoeppe
26827 Made the Makefile work with non-GNU make again.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026828
William S Fulton76d99c72001-08-01 16:08:34 +0000268296/07/2001: cheetah (william fulton)
26830 [Java] Class/struct members that are arrays of pointers to classes/structs -
26831 Shadow class's get/set accessors now use Java classes instead of longs (pointers).
26832 [Java] Shadow classes will now clean up memory if function return type
26833 is a class/struct.
26834 [Java] New example called reference based on the same example from other modules.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026835
William S Fulton76d99c72001-08-01 16:08:34 +0000268366/06/2001: mkoeppe
26837 New configure option --with-release-suffix allows for
26838 attaching a suffix to the swig binary and the swig runtime
26839 libraries. Minor changes to the build system. "swig
26840 -swiglib" works again. If invoked with the new option
26841 "-ldflags", SWIG prints a line of linker flags needed to
26842 link with the runtime library of the selected language
26843 module.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026844
William S Fulton76d99c72001-08-01 16:08:34 +0000268456/06/2001: mkoeppe
26846 [Guile] gswig_list_p is an int, not a SCM. This typo
26847 caused warnings when compiling with a Guile configured with
26848 strict C type checking. In INPUT and BOTH typemaps
26849 generated by the SIMPLE_MAP macro, use the SCM_TO_C
26850 function to convert from Guile to C (rather than C_TO_SCM).
26851 Use scm_intprint to print pointers (rather than
26852 sprintf). Allow using "-linkage" instead of "-Linkage".
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026853
William S Fulton76d99c72001-08-01 16:08:34 +0000268546/05/2001: cheetah (william fulton)
26855 [Java] Mods for using inherited c++ classes from Java
26856 [Java] New example called class based on the same example from other modules
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026857
William S Fulton76d99c72001-08-01 16:08:34 +0000268586/05/2001: cheetah (william fulton)
26859 [Java] destructor (_delete()) was not aware of %name renaming
26860 [Java] extends baseclass did not know about %name renaming
26861 [Java] extends baseclass did extend even when the baseclass was not known to swig
Olly Bettsf9566ad2013-01-08 18:47:40 +130026862 [Java] sometimes enum-declarations occurred before the Java class declaration
William S Fulton76d99c72001-08-01 16:08:34 +000026863 [Java] unrelated enum initialisations no longer appear in Java class
26864 [Java] if module ends in '_' correct JNI names are now produced
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026865
William S Fulton76d99c72001-08-01 16:08:34 +0000268666/04/2001: cheetah (william fulton)
26867 [Java] Shadow class mods - Modified constructor replaces
26868 newInstance(). _delete() now thread safe. getCPtr() replaces
26869 _self. _selfClass() removed as now redundant.
26870 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
Thien-Thi Nguyen37d919d2001-01-17 02:25:33 +000026871
William S Fulton76d99c72001-08-01 16:08:34 +000026872 [Java] Not all output java files had SWIG banner. New banner.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026873
William S Fulton76d99c72001-08-01 16:08:34 +000026874 [Java] Shadow class finalizers are output by default: Command
26875 line option -finalize deprecated and replaced with -nofinalize.
26876 *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026877
William S Fulton76d99c72001-08-01 16:08:34 +0000268786/ 1/2001: mkoeppe
26879 [Guile] Cast SCM_CAR() to scm_bits_t before shifting it.
26880 This is required for compiling with a Guile configured with
26881 strict C type checking.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026882
William S Fulton76d99c72001-08-01 16:08:34 +0000268836/ 1/2001: mkoeppe
26884 Added configure option "--with-swiglibdir".
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026885
William S Fulton76d99c72001-08-01 16:08:34 +0000268865/31/2001: mkoeppe
26887 [Guile] Support multiple parallel lists or vectors in
26888 the typemaps provided by list-vector.i. New typemaps file,
26889 pointer-in-out.i.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026890
William S Fulton76d99c72001-08-01 16:08:34 +0000268915/25/2001: cheetah (william fulton)
26892 [Java] HTML update for examples.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026893
William S Fulton76d99c72001-08-01 16:08:34 +0000268945/28/2001: mkoeppe
26895 Minor changes to the build system. Added subdirectory for
26896 Debian package control files.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026897
William S Fulton76d99c72001-08-01 16:08:34 +0000268985/28/2001: mkoeppe
26899 [Guile] Build a runtime library, libswigguile.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026900
William S Fulton76d99c72001-08-01 16:08:34 +0000269015/28/2001: mkoeppe
26902 [Guile] New typemap substitution $*descriptor. Use the {}
26903 syntax, rather than the "" syntax for the standard
26904 typemaps, in order to work around strange macro-expansion
26905 behavior of the SWIG preprocessor. This introduces some
26906 extra braces.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026907
William S Fulton76d99c72001-08-01 16:08:34 +0000269085/27/2001: mkoeppe
26909 [Guile] Handle pointer types with typemaps, rather than
26910 hard-coded. New typemap substitutions $descriptor,
26911 $basedescriptor; see documentation. Some clean-up in the
26912 variable/constants wrapper generator code. New convenience
26913 macro SWIG_Guile_MustGetPtr, which allows getting pointers
26914 from smobs in a functional style. New typemap file
26915 "list-vector.i", providing macros that define typemaps for
26916 converting between C arrays and Scheme lists and vectors.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026917
William S Fulton76d99c72001-08-01 16:08:34 +0000269185/25/2001: cheetah (william fulton)
26919 [Java] STL string moved into its own typemap as it is c++ code and
26920 it break any c code using the typemaps.i file.
26921 - Fixes for wrappers around global variables - applies to primitive
26922 types and user types (class/struct) and pointers to these.
26923 - Structure member variables and class public member variables getters
26924 and setters pass a pointer to the member as was in 1.3a3 and 1.1
26925 (1.3a5 was passing by value)
26926 - Parameters that were arrays and return types were incorrectly
26927 being passed to create_function() as pointers.
26928 - Fix for arrays of enums.
26929 [Java] Updated java examples and added two more.
26930 [Java] Java module updated from SWIG1.3a3 including code cleanup etc.
26931 [Java] enum support added.
26932 [Java] Array support implemented
26933 [Java] Shadow classes improved - Java objects used rather than
26934 longs holding the c pointer to the wrapped structure/c++class
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026935
William S Fulton76d99c72001-08-01 16:08:34 +0000269365/22/2001: mkoeppe
26937 [Guile] Fixed extern "C" declarations in C++ mode. Thanks
26938 to Greg Troxel <[email protected]>.
Thien-Thi Nguyen37d919d2001-01-17 02:25:33 +000026939
William S Fulton76d99c72001-08-01 16:08:34 +0000269405/21/2001: mkoeppe
26941 [Guile] New linkage "module" for creating Guile modules for
26942 Guile versions >= 1.5.0.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026943
William S Fulton76d99c72001-08-01 16:08:34 +0000269444/18/2001: mkoeppe
26945 [MzScheme] Added typemaps for passing through Scheme_Object
26946 pointers.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026947
William S Fulton76d99c72001-08-01 16:08:34 +0000269484/9/2001 : mkoeppe
26949 [MzScheme] Added typemaps for `bool'. Inclusion of headers
26950 and support routines is now data-driven via mzscheme.i.
26951 Headers come from the new file mzschemdec.swg. Don't abort
26952 immediately when a type-handling error is reported. When
26953 searching for typemaps for enums, fall back to using int,
26954 like the Guile backend does. Support char constants. Emit
26955 correct wrapper code for variables.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026956
William S Fulton76d99c72001-08-01 16:08:34 +0000269573/12/2001: mkoeppe
26958 [Guile] Fixed typemaps for char **OUTPUT, char **BOTH.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026959
William S Fulton76d99c72001-08-01 16:08:34 +0000269603/2/2001 : mkoeppe
26961 [Guile] Every wrapper function now gets a boolean variable
26962 gswig_list_p which indicates whether multiple values are
26963 present. The macros GUILE_APPEND_RESULT, GUILE_MAYBE_VALUES
26964 and GUILE_MAYBE_VECTOR use this variable, rather than
26965 checking whether the current return value is a list. This
26966 allows for typemaps returning a list as a single value (a
26967 list was erroneously converted into a vector or a
26968 multiple-value object in this case).
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026969
William S Fulton76d99c72001-08-01 16:08:34 +0000269703/1/2001 : mkoeppe
26971 [Guile] Added support for returning multiple values as
26972 vectors, or passing them to a muliple-value
26973 continuation. By default, multiple values still get
26974 returned as a list.
Dave Beazleyd4aceff2000-10-02 13:15:47 +000026975
William S Fulton76d99c72001-08-01 16:08:34 +0000269763/1/2001 : mkoeppe
26977 [Guile] Added a "beforereturn" pragma. The value of this
26978 pragma is inserted just before every return statement.
Thien-Thi Nguyen37d919d2001-01-17 02:25:33 +000026979
William S Fulton76d99c72001-08-01 16:08:34 +0000269803/1/2001 : mkoeppe
26981 [Guile] Added support for Guile 1.4.1 procedure
26982 documentation formats, see internals.html.
26983
269842/26/2001: mkoeppe
26985 [Guile] Made the wrapper code compile with C++ if the
26986 "-c++" command-line switch is given. Thanks to
26987 <[email protected]>.
26988
269892/26/2001: mkoeppe
26990 [Guile] Now two type tables, swig_types and
26991 swig_types_initial, are used, as all other SWIG language
26992 modules do. This removes the need for the tricky
26993 construction used before that the broken Redhat 7.0 gcc
26994 doesn't parse. Reported by <[email protected]>.
26995
269962/26/2001: mkoeppe
26997 [Guile] Fixed typemaps for char *OUTPUT, char *BOTH; a bad
26998 free() would be emitted. Added typemap for SCM.
26999
27000
27001Version 1.3 Alpha 5
27002===================
Dave Beazley92ae5e52000-09-18 02:45:53 +000027003
Dave Beazley344c4612000-09-20 02:25:28 +0000270049/19/00 : beazley
Dave Beazley2b75eae2000-09-20 04:32:21 +000027005 [Python] Python module generates more efficient code for
27006 creating the return value of a wrapper function. Modification
27007 suggested by Jon Travis.
27008
270099/19/00 : beazley
Dave Beazley344c4612000-09-20 02:25:28 +000027010 Library files specified with the -l option are now included at the
27011 end of the interface file (reverting to the old behavior).
27012
270139/19/00 : beazley
27014 Fixed some problems with enum handling. enums are now manipulated as
William S Fulton76d99c72001-08-01 16:08:34 +000027015 'int', but cast into the enum type when values are passed to the
Dave Beazley344c4612000-09-20 02:25:28 +000027016 corresponding C function.
27017
Matthias Köppe2963e762000-09-19 14:50:15 +0000270189/19/00 : mkoeppe
27019 [Guile] Removed "-with-smobs" command-line option, as this is the
27020 default now. Added "-emit-setters" command-line option,
27021 which turns on generating procedures-with-setters; see
27022 internals.html.
27023
Matthias Köppee867ed22000-09-18 09:35:36 +0000270249/18/00 : mkoeppe
William S Fulton76d99c72001-08-01 16:08:34 +000027025 Incorporated patch #101430, fixing bugs in the Guile module:
Matthias Köppee867ed22000-09-18 09:35:36 +000027026 1. Some arguments were erroneously taken as *optional* arguments when
William S Fulton76d99c72001-08-01 16:08:34 +000027027 ignored arguments were present.
Matthias Köppee867ed22000-09-18 09:35:36 +000027028 2. Guile 1.3.4 was not supported since functions introduced in Guile
William S Fulton76d99c72001-08-01 16:08:34 +000027029 1.4 were used.
Matthias Köppee867ed22000-09-18 09:35:36 +000027030 3. Added handling of `const char *'.
27031
Dave Beazley92ae5e52000-09-18 02:45:53 +0000270329/17/00 : beazley
27033 Fixed problem with failed assertion and large files.
27034
270359/17/00 : beazley
27036 Fixed problem with the '%' character appearing in added methods
27037 and function bodies. Preprocessor bug.
27038
Dave Beazley4a6eb362000-09-04 16:27:09 +000027039Version 1.3 Alpha 4 (September 4, 2000)
Olly Bettsfdcea432009-02-26 05:53:37 +000027040=======================================
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027041
270429/3/00 : ttn
27043 Added instructions for maintainers in Examples/README on how
Thien-Thi Nguyena30c3d22000-09-04 03:28:12 +000027044 to make examples also be useful in the testing framework.
27045 Also, "make check" now uses ./Lib by via env var `SWIG_LIB'.
27046 This is overridable like so:
27047 make chk-swiglib=/my/experimental/swig/Lib check
Dave Beazley6cfe2eb2000-09-04 01:54:30 +000027048
270499/3/00 : beazley
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027050 Added $typemap variable to typemaps. This gets replaced with
27051 a string indicating the typemap that is applied. Feature
27052 request from rsalz.
27053
270549/3/00 : beazley
27055 Experimental optimization to code generation for virtual
27056 member functions. If you have two classes like this:
Dave Beazleyd325d112000-09-03 21:25:59 +000027057
27058 class A() {
27059 virtual void foo();
27060 }
27061
27062 class B() : public A {
27063 virtual void foo();
27064 }
27065
Dave Beazley4a6eb362000-09-04 16:27:09 +000027066 Swig now will generate a single wrapper function for this
Dave Beazleyd325d112000-09-03 21:25:59 +000027067
27068 A_foo(A *a) {
27069 a->foo();
27070 }
27071
27072 and use it as the implementation of both A_foo() and B_foo().
27073 This optimization only takes place if both methods are declared
27074 as virtual and both take identical parameters.
27075 *** EXPERIMENTAL FEATURE ***
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027076
Dave Beazleyd325d112000-09-03 21:25:59 +0000270779/3/00 : beazley
Dave Beazleyebf51162000-09-03 19:18:00 +000027078 Restored the "memberin" typemap for setting structure members.
27079 Unlike the old version, the new version is expanded inline in the
27080 wrapper function allowing access to scripting language
27081 internals (a sometimes requested feature). The "memberout" typemap
27082 is gone. Use the "out" typemaps instead.
27083 *** POTENTIAL INCOMPATIBILITY ***
Thien-Thi Nguyen70f838b2000-06-28 22:42:18 +000027084
Dave Beazleyebf51162000-09-03 19:18:00 +0000270859/3/00 : beazley
27086 Attribute set methods no longer return the value of a member.
27087 For example:
27088
27089 struct Foo {
27090 int x;
27091 ...
27092 }
27093
27094 now gets set as follows:
27095
27096 void Foo_x_set(Foo *f, int x) {
27097 f->x = x;
27098 }
27099
27100 In SWIG1.1 it used to be this:
27101
27102 int Foo_x_set(Foo *f, int x) {
27103 return (f->x = x);
27104 }
27105
27106 This has been changed due to the complexity created by trying
27107 to do this with more exotic datatypes such as arrays. It also
27108 complicates inlining and handling of the "memberin" typemap.
27109 *** POTENTIAL INCOMPATIBILITY ***
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027110
Dave Beazley5e640312000-09-02 19:25:23 +0000271119/2/00 : beazley
27112 Removed the ptrcast() and ptrmap() functions from the
27113 pointer.i library file. Old implementation is incompatible
27114 with new type system.
27115 *** POTENTIAL INCOMPATIBILITY ***
27116
271179/2/00 : beazley
27118 New runtime function SWIG_TypeQuery(const char *name) added.
27119 This function can be used to extract the type info structure
27120 that is used for type-checking. It works with either the
27121 nice C name or mangled version of a datatype. For example:
27122
27123 swig_type_info *ty = Swig_TypeQuery("int *");
27124 swig_type_info *ty = Swig_TypeQuery("_p_int");
27125
27126 This is an advanced feature that has been added to support some
27127 exotic extension modules that need to directly manipulate
27128 scripting language objects.
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027129 *** NEW FEATURE ***
Dave Beazley5e640312000-09-02 19:25:23 +000027130
271319/2/00 : beazley
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027132 New directive %types() added. This is used to
Dave Beazley5e640312000-09-02 19:25:23 +000027133 explicitly list datatypes that should be included in
27134 the runtime type-checking code. Normally it is never
27135 necessary to use this but sometimes advanced extensions
27136 (such as the pointer.i library) may need to manually
27137 add types to the type-checker.
27138 *** NEW FEATURE ***
27139
Dave Beazley20db8b72000-09-01 16:16:58 +0000271408/31/00 : beazley
27141 Improved handling of string array variables. For example,
27142 a global variable of the form "char name[64]" is automatically
27143 managed as a 64 character string. Previously this didn't
27144 work at all or required the use of a special typemap.
27145 *** NEW FEATURE (Tcl, Perl, Python) ***
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027146
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +0000271478/31/00 : ttn
27148 Added Makefile target `check-c++-examples', which uses new
27149 files under Examples/C++ contributed by Tal Shalif. Now "make
27150 check" also does "make check-c++-examples". Also, expanded
27151 actions in `check-gifplot-example' and `check-aliveness'.
27152
Matthias Köppeef21a912000-08-30 20:13:30 +0000271538/30/00 : mkoeppe
27154 Major clean-up in the Guile module. Added typemap-driven
Matthias Köppeef19a0d2000-08-31 12:14:27 +000027155 documentation system. Changed to handle more than 10
27156 args. Updated and extended examples.
Matthias Köppeef21a912000-08-30 20:13:30 +000027157 *** NEW FEATURE ***
27158
Dave Beazley730afd52000-08-30 16:28:16 +0000271598/29/00 : beazley
27160 Added new %insert directive that inserts the contents of a file
27161 into a portion of the output wrapper file. This is only intended
27162 for use by writers of language modules. Works as follows:
27163
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027164 %insert(headers) "file.swg";
Dave Beazley730afd52000-08-30 16:28:16 +000027165 %insert(runtime) "file.swg";
27166 %insert(wrappers) "file.swg";
27167 %insert(init) "file.swg";
27168
27169 *** NEW FEATURE ***
27170
271718/29/00 : beazley
27172 Added new %runtime directive which includes code into the runtime
27173 portion of the wrapper code. For example:
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027174
Dave Beazley730afd52000-08-30 16:28:16 +000027175 %runtime %{
27176 ... some internal runtime code ...
27177 %}
27178
27179 There is no practical reason for ordinary users to use this
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027180 feature (almost everything can be done using %{ ... %}
Dave Beazley730afd52000-08-30 16:28:16 +000027181 instead). However, writers of language modules may want to
27182 use this in language configuration files.
27183 *** NEW FEATURE ***
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027184
Dave Beazley7f9b71f2000-08-28 20:59:07 +0000271858/28/00 : beazley
27186 Typemaps can now be specified using string literals like
27187 this:
27188
William S Fultonc10a84c2022-08-20 22:14:58 +010027189 %typemap(in) int "$target = SvIV($source);"
Dave Beazley7f9b71f2000-08-28 20:59:07 +000027190
27191 When code is specified like this, it is *NOT* enclosed
27192 inside a local scope (as with older typemap declarations).
27193 Note: character escape sequences are interpreted in the
27194 code string so if you want to include a quote or some
27195 other special character, make sure you use a (\).
27196 *** NEW FEATURE ***
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027197
Dave Beazleyc1266a02000-08-28 12:24:47 +0000271988/27/00 : beazley
27199 Typemaps have been modified to follow typedef declarations.
27200 For example, if you have this:
27201
27202 typedef int Number;
27203
27204 %typemap(in) int {
27205 ... get an integer ...
27206 }
27207
27208 void foo(Number a);
27209
27210 The typemap for 'int' will be applied to the argument 'Number a'.
27211 Of course, if you specify a typemap for 'Number' it will take
27212 precedence (nor will it ever be applied to an 'int').
27213 *** POTENTIAL INCOMPATIBILITY ***
27214
272158/27/00 : beazley
27216 Default typemap specification has changed. In older
27217 versions of swig, you could do this:
27218
27219 %typemap(in) int SWIG_DEFAULT_TYPE {
27220 ...
27221 }
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027222
Dave Beazleyc1266a02000-08-28 12:24:47 +000027223 To specify the default handling of a datatype. Now that
27224 SWIG follows typedef declarations, this is unnecessary.
27225 Simply specifying a typemap for 'int' will work for all
27226 variations of integers that are typedef'd to 'int'.
27227
27228 Caveat, specifying the default behavior for pointers,
27229 references, arrays, and user defined types is a little
27230 different. This must be done as follows:
27231
27232 %typemap() SWIGPOINTER * {
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027233 ... a pointer ...
Dave Beazleyc1266a02000-08-28 12:24:47 +000027234 }
27235 %typemap() SWIGREFERENCE & {
27236 ... a reference ...
27237 }
27238 %typemap() SWIGARRAY [] {
27239 ... an array ...
27240 }
27241 %typemap() SWIGTYPE {
27242 ... a user-defined type (by value) ...
27243 }
27244 *** POTENTIAL INCOMPATIBILITY ***
27245
Dustin Mitchell253d3382000-08-15 20:33:54 +0000272468/15/00 : dustin
27247 The file swig-1.3a1-1.spec has been added to the Tools directory.
27248 It can be used to build a redhat package for SWIG, although it
27249 will need to be updated for the next public release.
27250
Dave Beazley5100af92000-08-15 18:24:16 +0000272518/15/00 : beazley
27252 Typemaps have been completely rewritten. Eventually they may be
27253 replaced with something better, but for now they stay. However,
27254 there are a number of a significant changes that may trip some
27255 people up:
27256
27257 1. Typemap scoping is currently broken. Because of this, the
27258 following code won't work.
27259
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027260 %typemap(in) blah * {
Dave Beazley5100af92000-08-15 18:24:16 +000027261 ...
27262 }
27263 class Foo {
27264 ...
27265 int bar(blah *x);
27266 }
27267 %typemap(in) blah *; /* Clear typemap */
27268
27269 (this breaks because the code for the class Foo is actually
27270 generated after the entire interface file has been processed).
27271 This is only a temporary bug.
27272
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027273 2. In SWIG1.1, the %apply directive worked by performing a
Dave Beazley5100af92000-08-15 18:24:16 +000027274 very complex type-aliasing procedure. From this point on,
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027275 %apply is simply a generalized typemap copy operation.
Dave Beazley5100af92000-08-15 18:24:16 +000027276 For example,
27277
27278 %apply double *OUTPUT { double *x, double *y };
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027279
Dave Beazley5100af92000-08-15 18:24:16 +000027280 Copies *ALL* currently defined typemaps for 'double *OUTPUT' and
27281 copies them to 'double *x' and 'double *y'.
27282
27283 Most people probably won't even notice this change in
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027284 %apply. However, where it will break things is in code like
Dave Beazley5100af92000-08-15 18:24:16 +000027285 this:
27286
27287 %apply double *OUTPUT { double *x };
27288 %typemap(in) double *OUTPUT {
27289 ... whatever ...
27290 }
27291
27292 void foo(double *x);
27293
27294 In SWIG1.1, you will find that 'foo' uses the 'double *OUTPUT' rule
27295 even though it was defined after the %apply directive (this is
27296 the weird aliasing scheme at work). In SWIG1.3 and later,
27297 the 'double *OUTPUT' rule is ignored because it is defined
27298 after the %apply directive.
27299
27300 3. The %clear directive has been modified to erase all currently
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027301 defined typemaps for a particular type. This differs from
Dave Beazley5100af92000-08-15 18:24:16 +000027302 SWIG1.1 where %clear only removed rules that were added using
27303 the %apply directive.
27304
27305 4. Typemap matching is now performed using *exact* types.
27306 This means that things like this
27307
27308 %typemap(in) char * { }
27309 %typemap(in) const char * { }
27310
27311 are different typemaps. A similar rule applies for pointers,
27312 arrays, and references. For example:
27313
27314 %typemap(in) double * { }
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027315
Dave Beazley5100af92000-08-15 18:24:16 +000027316 used to apply to 'double &', 'double []', Now, it only applies
27317 to 'double *'. If you want a 'double &', you'll need to handle
27318 that separately.
27319
27320 5. Array matching has been simplfied. In SWIG1.1, array matching
27321 was performed by trying various combinations of dimensions.
27322 For example, 'double a[10][20]' was matched as follows:
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027323
Dave Beazley5100af92000-08-15 18:24:16 +000027324 double [10][20]
27325 double [ANY][20]
27326 double [10][ANY]
27327 double [ANY][ANY]
27328
27329 In SWIG1.3, only the following matches are attempted:
27330
27331 double [10][20]
27332 double [ANY][ANY]
27333
27334 On the positive side, typemap matching is now *significantly* faster
27335 than before.
27336 *** POTENTIAL INCOMPATIBILITY ***
27337
Dave Beazley4a6eb362000-09-04 16:27:09 +0000273388/15/00 : beazley
William S Fulton76d99c72001-08-01 16:08:34 +000027339 Secret developer feature. Since datatypes are now represented as
Dave Beazley4a6eb362000-09-04 16:27:09 +000027340 strings internally, you can bypass limitations of the parser and
27341 create a wild datatype by simply enclosing the raw string encoding
27342 in backticks (``) and sticking it in the interface file anywhere a
William S Fulton76d99c72001-08-01 16:08:34 +000027343 type is expected. For example, `a(20).a(10).p.f(int,int)`. This
Dave Beazley4a6eb362000-09-04 16:27:09 +000027344 feature is only intended for testing (i.e., you want to see what
27345 happens to your language module if it gets a reference to a pointer
William S Fulton76d99c72001-08-01 16:08:34 +000027346 to an array of pointers to functions or something).
Dave Beazley4a6eb362000-09-04 16:27:09 +000027347 *** SICK HACK ***
27348
Dave Beazleyaf04a7c2000-08-14 22:04:29 +0000273498/14/00 : beazley
27350 Completely new type-system added to the implementation.
27351 More details later.
27352
Dave Beazley6361a702000-08-11 16:32:04 +0000273538/11/00 : beazley
27354 Cleaned up some of the I/O handling. SWIG no longer generates
27355 any temporary files such as _wrap.wrap, _wrap.ii, _wrap.init.
27356 Instead, these "files" are kept around in memory as strings
Dave Beazley501350d2000-09-03 21:55:29 +000027357 (although this is transparent to language modules).
Thien-Thi Nguyenc0aed6a2000-08-31 19:27:42 +000027358
Thien-Thi Nguyen765742c2000-08-04 16:17:36 +0000273598/4/00 : ttn
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027360 Added Makefile target "check" and variants.
27361 This can be used like "make check" or, to explicitly skip a
27362 language LANG: "make skip-LANG=true check". LANG is skipped
27363 automatically if ./configure determines that LANG support is
27364 insufficient.
27365
27366 Currently, the check is limited to doing the equivalent of
27367 "make all" in some of the Examples directories. This should
27368 be expanded both horizontally (different types of tests) and
27369 vertically (after "make all" in an Examples subdir succeeds,
27370 do some additional tests with the resulting interpreter, etc).
27371
273728/4/00 : ttn
Thien-Thi Nguyen765742c2000-08-04 16:17:36 +000027373 Added Makefile target "distclean", which deletes all the
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027374 files ./configure creates, including config.status and friends.
Thien-Thi Nguyen765742c2000-08-04 16:17:36 +000027375
273768/3/00 : harcoh
27377 java changes??? [todo: document changes]
27378
Dave Beazley39734892000-07-24 03:50:07 +0000273797/23/00 : beazley
27380 Typemaps have been modified to key off of the real datatypes
27381 used in the interface file. This means that typemaps for
27382 "const char *" and "char *" will be difference as will typemaps
27383 for "Vector" and "Vector *."
27384 *** POTENTIAL INCOMPATIBILITY ***
27385 This is likely to break interfaces that rely on the odd type
27386 handling behavior of typemaps in SWIG1.1--especially with
27387 respect to interfaces involving pass-by-value.
27388
273897/23/00 : beazley
Dave Beazley20db8b72000-09-01 16:16:58 +000027390 New %constant directive. This directive can be used to
27391 create true constants in the target scripting language.
27392 It's most simple form is something like this:
27393
27394 %constant FOO 42;
27395
Thien-Thi Nguyen60755292000-09-04 02:45:19 +000027396 In this case, the type is inferred from the syntax of the
Dave Beazley20db8b72000-09-01 16:16:58 +000027397 value (in reality, all #define macros are translated into
27398 directives of this form).
27399
27400 An expanded version is as follows:
27401
27402 %constant(Foo *) FOO = &FooObj;
27403
27404 In this case, an explicit type can be specified. This
27405 latter form may be useful for creating constants that
27406 used to be specified as
27407
27408 const Foo *FOO = &FooObj;
27409
27410 (which are now treated as variables).
27411 *** EXPERIMENTAL FEATURE *** The syntax may change in
27412 the final release.
27413
274147/23/00 : beazley
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027415 Modified the parser so that variable declarations of the form
Dave Beazley39734892000-07-24 03:50:07 +000027416 "const type *a" are handled as variables, not constants.
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027417 Note: SWIG1.1 handled this case erroneously because
Dave Beazley39734892000-07-24 03:50:07 +000027418 const char *a is a pointer variable that can be reassigned.
27419 *** POTENTIAL INCOMPATIBILITY ***
27420 Note: just because this is the "right" way to do things,
27421 doesn't mean it's the most appropriate interpretation.
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027422 I suspect that many C programmers might use 'const char *'
Dave Beazley39734892000-07-24 03:50:07 +000027423 with the intent of creating a constant, without realizing
27424 that they've created a reassignable global variable.
27425
274267/23/00 : beazley
27427 The C/C++ wrapping layer has been completely redesigned and
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027428 reimplemented. This change should iron out a few rough
Dave Beazley39734892000-07-24 03:50:07 +000027429 spots with the handling of datatypes. In addition, the
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027430 wrapper code is somewhat cleaner.
Dave Beazley39734892000-07-24 03:50:07 +000027431 *** POTENTIAL INCOMPATIBILITY ***
27432 This change may break interfaces that involve
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027433 subtle corner-cases with typemaps and the %addmethods
27434 directive since some of these features had somewhat
Dave Beazley39734892000-07-24 03:50:07 +000027435 type handling behavior in SWIG1.1.
27436
274377/23/00 : beazley
27438 The "memberin" and "memberout" typemaps are gone for the
27439 moment, but they might return as soon as I figure out
27440 how to integrate them with some of the streamlined C wrapper
27441 functions.
27442 *** POTENTIAL INCOMPATIBILITY ***
27443
Dave Beazleyb2f1d102000-07-23 04:48:42 +0000274447/22/00 : beazley
27445 A variety of old type handling functions such as print_type(),
27446 print_full(), print_mangle(), etc... are gone and have been
27447 replaced with a smaller set of functions. See the file
27448 Doc/internals.html for details. This will break all third
27449 party language modules.
27450 *** POTENTIAL INCOMPATIBILITY ***
27451
Dave Beazleyd177ad02000-07-20 20:28:37 +0000274527/20/00 : beazley
27453 Deprecated the %val and %out directives. These directives
27454 shouldn't really be necessary since typemaps can be used
27455 to achieve similar results. This also cleans up the
27456 handling of types and parameters quite a bit.
27457 *** POTENTIAL INCOMPATIBILITY ***
Thien-Thi Nguyen4fe08902000-08-04 20:19:15 +000027458
Thien-Thi Nguyen10014e52000-07-20 20:11:01 +0000274597/20/00 : ttn
27460 Fixed unspecified-module bug in Guile support and removed
27461 more non-"with-smobs" functionality using patches submitted
27462 by Matthias Koeppe.
27463
27464 Re-enable recognition of "-with-smobs" (with no effect since
27465 we use smobs by default now) for the time being. After the
27466 1.3a4 release, this option will signal an error.
27467
Thien-Thi Nguyen3ff47782000-07-17 18:31:40 +0000274687/17/00 : ttn
27469 Fixed NULL-input bug in parameter list handling.
27470 Reported by Matthias Koeppe.
27471
Dave Beazleydb1c7e32000-07-12 20:06:09 +0000274727/12/00 : beazley
27473 Fixed memory leak in Python type-checking code. Reported by
27474 Keith Davidson. Bug #109379.
27475
Dave Beazley30b1e562000-07-10 21:51:57 +0000274767/10/00 : beazley
Dave Beazleydadb3762000-07-11 19:41:47 +000027477 Changed internal data structures related to function parameters.
27478
274797/10/00 : beazley
Dave Beazleyf4977bb2000-07-10 23:12:45 +000027480 Fixed some bugs related to the handling of the %name() directive
27481 and classes in the Tcl module. Problem reported by James Bailey.
27482
274837/10/00 : beazley
Dave Beazleyd34f29e2000-07-10 22:52:04 +000027484 Fixed parsing and enum handling problems with character constants.
27485 Reported by Greg Kochanski.
27486
274877/10/00 : beazley
Dave Beazley30b1e562000-07-10 21:51:57 +000027488 Removed WrapperFunction class from the core and updated the language
27489 module. This will break third party modules.
27490 *** POTENTIAL INCOMPATIBILITY ***
27491
Dave Beazley0fff2672000-07-10 03:19:31 +0000274927/9/00 : beazley
27493 Implementation of SWIG no longer makes use of C++ operator overloading.
27494 This will almost certainly break *all* third party language modules
27495 that are not part of the main SWIG CVS tree. Sorry.
27496 *** POTENTIAL INCOMPATIBILITY ***
Thien-Thi Nguyen3ff47782000-07-17 18:31:40 +000027497
Dave Beazley0fff2672000-07-10 03:19:31 +0000274987/8/00 : beazley
27499 Removed the experimental and undocumented "build" typemap that
27500 was intended to work with multiple arguments. Simply too weird
27501 to keep around. Besides, a better replacement is in the works.
27502
Thien-Thi Nguyenbcf61b02000-07-06 21:55:44 +0000275037/6/00 : ttn
27504 Removed non-"with-smobs" functionality (Guile support), i.e.,
27505 "-with-smobs" is now the default and no longer needs to be
27506 specified on the command-line.
27507
Thien-Thi Nguyenee7c93a2000-07-05 19:25:26 +0000275087/5/00 : ttn
27509 Incorporated Ruby support contributed by Masaki Fukushima.
27510
Thien-Thi Nguyenfb5ad432000-06-28 23:02:07 +0000275116/28/00 : ttn
27512 Applied more-than-10-args bugfix patch contributed
27513 by Matthias Koeppe.
27514
Dave Beazley53f937d2000-06-29 04:08:17 +0000275156/27/00 : beazley
27516 Rewrote some of the string handling and eliminated the C++
27517 implementation (which is now just a wrapper).
Thien-Thi Nguyenee7c93a2000-07-05 19:25:26 +000027518
Thien-Thi Nguyen70f838b2000-06-28 22:42:18 +0000275196/27/00 : ttn
27520 Added Doc/index.html and Doc/internals.html. The target
27521 audience for the latter is new SWIG developers.
27522
27523
Dave Beazley243ef9c2000-06-18 20:34:21 +000027524Version 1.3 Alpha 3 (June 18, 2000)
27525===================================
27526
275276/18/00 : beazley
27528 Removed the naming.cxx, hash.cxx, and symbol.cxx files from
27529 the SWIG1.1 directory. Continued to migrate things away
27530 from the C++ base (although there's still a lot of work to do).
27531
275326/17/00 : beazley
27533 Added a few more examples to the Examples directory. Still
27534 need to do a lot of work on this.
27535
Dave Beazleya3529362000-06-16 15:38:35 +0000275366/16/00 : beazley
27537 Added -includeall to follow all #include statements in the
27538 preprocessor.
27539
275406/15/00 : beazley
27541 Tried to fix as many C++ warnings as possible when compiling
27542 with the Sun Workshop C++ compiler. Unfortunately, this means
27543 that there are a lot of statements that contain string literals
27544 of the form (char*)"Blah".
27545
275466/15/00: beazley
27547 A variety of cleanup and performance optimization in the
27548 low-level DOH library. This seems to result in a speedup
27549 of 50-100% for preprocessing and other related tasks.
27550
Thien-Thi Nguyenaf8edc52000-05-10 23:30:38 +0000275515/10/00 : ttn
27552 Applied variable-wrapping bugfix patch contributed
27553 by Matthias Koeppe.
27554
Thien-Thi Nguyenee79f332000-04-17 16:14:00 +0000275554/17/00 : ttn
27556 Updated MzScheme support contributed by Oleg Tolmatcev.
27557 We now use a `Scheme_Type'-based structure to wrap pointers.
27558
Thien-Thi Nguyen83746ec2000-04-12 11:57:50 +0000275594/11/00 : ttn
27560 Incorporated further Guile-support patch by Matthias Koeppe.
27561 Typemaps previously deleted have been re-added. There is now
27562 exception handling (see Doc/engineering.html). `SWIG_init' is now
27563 declared extern only for simple linkage. Some bugs were fixed.
27564
Thien-Thi Nguyen79afb162000-04-06 08:46:48 +0000275654/06/00 : ttn
27566 Incorporated MzScheme support contributed by Oleg Tolmatcev.
27567 This includes new directories Lib/mzscheme and Examples/mzscheme.
27568
Thien-Thi Nguyen58225bf2000-04-03 15:36:56 +0000275694/03/00 : ttn
27570 Added Examples/guile and children. This is an adaptation of
27571 the same-named directory from the SWIG-1.1p5 distribution.
27572 Added Guile-specific section to Doc/engineering.html.
27573
Thien-Thi Nguyen464c4722000-04-03 07:46:33 +0000275744/02/00 : ttn
27575 Incorporated new guilemain.i by Martin Froehlich.
Thien-Thi Nguyen83746ec2000-04-12 11:57:50 +000027576 Incorporated Guile-support rewrite patch by Matthias Koeppe.
Thien-Thi Nguyen68e546d2000-04-03 08:18:01 +000027577 The command line option "-with-smobs" enables implementation of
27578 pointer type handling using smobs, the canonical mechanism for
27579 defining new types in Guile. Previous implementation (using
27580 strings) is at the moment still supported but deprecated. At
27581 some point, "-with-smobs" will be the default and no longer
27582 required.
Thien-Thi Nguyen464c4722000-04-03 07:46:33 +000027583
Dave Beazleya8529d52000-03-13 17:41:14 +0000275843/13/00 : beazley
27585 Added purify patches submitted by Ram Bhamidipaty.
27586
Thien-Thi Nguyene61c7b82000-03-04 02:29:55 +0000275873/02/00 : ttn
27588 Added support for different Guile "linkage" schemes.
27589 Currently, "-Linkage hobbit" works.
27590
27591
Dave Beazley2ea292d2000-03-02 01:57:49 +000027592Version 1.3 Alpha 2 (March 1, 2000)
27593===================================
27594
Dave Beazleyb0b24212000-02-29 17:38:15 +0000275952/29/00 : beazley
Dave Beazley6711f812000-02-29 21:31:50 +000027596 Made SWIG ignore the 'mutable' keyword.
27597
275982/29/00 : beazley
Dave Beazleyb0b24212000-02-29 17:38:15 +000027599 Incorporated some patches to the Perl5 module related to
Thien-Thi Nguyen68e546d2000-04-03 08:18:01 +000027600 the -hide option and the destruction of objects.
Dave Beazleyb0b24212000-02-29 17:38:15 +000027601 Patch submitted by Karl Forner.
27602
Thien-Thi Nguyen25ae6982000-02-28 14:40:47 +0000276032/27/00 : ttn
27604 Incorporated Guile support contributed by Matthias Koeppe.
27605 This includes a cpp macro in Lib/guile/guile.swg and the
27606 entire file Lib/guile/typemaps.i.
27607
Thien-Thi Nguyen9cffe602000-02-26 15:20:40 +0000276082/25/00 : ttn
27609 Modified configure.in and Makefile.in files to support
27610 non-local build (useful in multi-arch environments).
27611
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000276122/24/00 : ttn
Thien-Thi Nguyen9cffe602000-02-26 15:20:40 +000027613 Incorporated Guile support contributed by Clark McGrew.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027614 This works with Guile 1.3, but since it depends heavily
27615 on the gh_ interface, it should work for all later versions.
27616 It has not been tested with versions before 1.3.
27617 WARNING: Code is unstable due to experimentation by ttn.
27618
Dave Beazleyb0b24212000-02-29 17:38:15 +0000276192/16/00 : beazley
27620 A variety of performance improvements to the Python shadow
27621 class code generation. Many of these result in substantial
27622 runtime performance gains. However, these have come at
27623 a cost of requiring the use of Python 1.5.2. For older
27624 versions, use 'swig -noopt -python' to turn off these
27625 optimization features.
27626
Dave Beazleyd6d71882000-02-11 19:47:45 +000027627Version 1.3 Alpha 1 (February 11, 2000)
27628=======================================
27629
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000276302/11/00 : Added 'void' to prototype of Python module initializer.
Dave Beazleyd6d71882000-02-11 19:47:45 +000027631 Reported by Mark Howson (1/20/00).
27632
276332/11/00 : beazley
27634 Modified the Python shadow class code to discard ownership of an
27635 object whenever it is assigned to a member of another object.
27636 This problem has been around for awhile, but was most recently
27637 reported by Burkhard Kloss (12/30/99).
27638
276392/11/00 : beazley
27640 Added braces around macros in the exception.i library. Reported
27641 by Buck Hodges (12/19/99)
27642
276432/11/00 : beazley
27644 Fixed bug in the constraints.i library. Reported by Buck
27645 Hodges (12/14/99)
27646
276472/11/00 : beazley
27648 The %native directive now generates Tcl8 object-style command calls.
27649 A full solution for Tcl7 and Tcl8 is still needed. Patch suggested
27650 by Mike Weiblen (11/29/99)
27651
276522/11/00 : beazley
27653 Modified the typemap code to include the $ndim variable for arrays.
27654 Patch provided by Michel Sanner (11/12/99).
27655
276562/11/00 : beazley
27657 Modified the Python module to raise a Runtime error if an attempt
27658 is made to set a read-only member of a shadow class. Reported by
27659 Michel Sanner (11/5/99).
27660
Dave Beazleyd8435c82000-02-10 20:38:42 +0000276612/10/00 : The documentation system has been removed. However, it is likely
27662 to return at some point in the future.
27663
Dave Beazley34f87ab2000-02-02 07:02:28 +0000276642/1/00 : Added a number of performance enhancements to the Python shadow
27665 classing and type-checking code. Contributed by Vadim Chugunov.
27666
27667 1. Remove _kwargs argument from the shadow wrappers when -keyword
27668 option is not specified. This saves us a construction of keyword
27669 dictionary on each method call.
27670
27671 def method1(self, *_args, **_kwargs):
27672 val = apply(test2c.PyClass1_method1, (self,) + _args, _kwargs)
27673 return val
27674
27675 becomes
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027676
Dave Beazley34f87ab2000-02-02 07:02:28 +000027677 def method1(self, *_args):
27678 val = apply(test2c.PyClass1_method1, (self,) + _args)
27679 return val
27680
27681 2. Incorporate self into the _args tuple. This saves at least one tuple
27682 allocation per method call.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027683
Dave Beazley34f87ab2000-02-02 07:02:28 +000027684 def method1(self, *_args):
27685 val = apply(test2c.PyClass1_method1, (self,) + _args)
27686 return val
27687
27688 becomes
27689
27690 def method1(*_args):
27691 val = apply(test2c.PyClass1_method1, _args)
27692 return val
27693
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027694 3. Remove *Ptr classes.
Dave Beazley34f87ab2000-02-02 07:02:28 +000027695 Assume that we are SWIGging a c++ class CppClass.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027696 Currently SWIG will generate both CppClassPtr class
Dave Beazley34f87ab2000-02-02 07:02:28 +000027697 that hosts all methods and also CppClass that is derived
27698 from the former and contains just the constructor.
27699 When CppClass method is called, the interpreter will try
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027700 to find it in the CppClass's dictionary first, and only then
Dave Beazley34f87ab2000-02-02 07:02:28 +000027701 check the base class.
27702
27703 CppClassPtr functionality may be emulated with:
27704
27705 import new
27706 _new_instance = new.instance
27707 def CppClassPtr(this):
27708 return _new_instance(CppClass, {"this":this,"thisown":0})
27709
27710 This saves us one dictionary lookup per call.
27711
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027712 <DB>The new module was first added in Python-1.5.2 so it
Dave Beazley34f87ab2000-02-02 07:02:28 +000027713 won't work with older versions. I've implemented an
27714 alternative that achieves the same thing</DB>
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027715
Dave Beazley34f87ab2000-02-02 07:02:28 +000027716 4. Use CObjects instead of strings for pointers.
27717
William S Fulton76d99c72001-08-01 16:08:34 +000027718 Dave: This enhancements result in speedups of up to 50% in some
Dave Beazley34f87ab2000-02-02 07:02:28 +000027719 of the preliminary tests I ran.
27720
Dave Beazleyb68ed792000-02-02 04:54:02 +0000277212/1/00 : Upgraded the Python module to use a new type-checking scheme that
27722 is more memory efficient, provides better performance, and
27723 is less error prone. Unfortunately, it will break all code that
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027724 depends on the SWIG_GetPtr() function call in typemaps.
Dave Beazleyb68ed792000-02-02 04:54:02 +000027725 These functions should be changed as follows:
27726
27727 if (SWIG_GetPtr(string,&ptr,"_Foo_p")) {
27728 return NULL;
27729 }
27730
27731 becomes
27732
27733 if (SWIG_ConvertPtr(pyobj, &ptr, SWIG_TYPE_Foo_p) == -1) {
27734 return NULL;
27735 }
27736
27737 Note: In the new implementation SWIG_TYPE_Foo_p is no longer
27738 a type-signature string, but rather an index into a type
27739 encoding table that contains type information.
27740 *** POTENTIAL INCOMPATIBILITY ***
27741
Loic Dachary8a341962000-01-30 15:39:55 +0000277421/30/00 : loic
Olly Betts618868c2014-04-29 11:24:04 +120027743 Conditionally compile experimental code with --enable-experiment
Loic Dachary8a341962000-01-30 15:39:55 +000027744 configure flag.
Olly Betts618868c2014-04-29 11:24:04 +120027745 Fix .cvsignore to ignore configure & yacc generated files
Loic Dachary8a341962000-01-30 15:39:55 +000027746
Loic Dacharyd0ab9152000-01-29 01:06:10 +0000277471/28/00 : loic
27748 Apply automake everywhere
27749 Keep configure scripts so that people are not *forced* to autoconf
27750 Keep sources generated by yacc so that compilation without yacc
27751 is possible.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027752 Source/LParse/cscanner.c: change lyacc.h into parser.h to please
Loic Dacharyd0ab9152000-01-29 01:06:10 +000027753 default yacc generation rules.
27754 Use AC_CONFIG_SUBDIRS in configure.in instead of hand made script.
27755 Update all relevant .cvsignore to include .deps
27756 Fixed missing ; line 136 Source/Swig/swig.h
27757
Dave Beazley485d00d2000-01-13 16:36:29 +0000277581/13/00 : beazley
Dave Beazley71570582000-01-13 17:23:30 +000027759 Fixed a number of minor end-of-file parsing problems in the
27760 preprocessor.
27761
277621/13/00 : beazley
Dave Beazley6d462db2000-01-13 16:44:41 +000027763 Added -freeze option that forces SWIG to freeze upon exit.
27764 This is only used as a debugging tool so that I can more
27765 easily examine SWIG's memory footprint.
27766
277671/13/00 : beazley
Dave Beazley485d00d2000-01-13 16:36:29 +000027768 Added patch to guile module for supporting optional arguments
27769 Patch contributed by Dieter Baron.
27770
Loic Dacharybcf13952000-01-13 15:13:59 +0000277711/13/00 : loic
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027772 Added .cvsignore, Examples/.cvsignore, Source/DOH/Doh/.cvsignore
Loic Dacharycb441952000-01-13 16:23:52 +000027773 Source/SWIG1.1/main.cxx: Fixed -I handling bug
Loic Dacharybcf13952000-01-13 15:13:59 +000027774 Source/Modules1.1/java.cxx: fixed char* -> const char* warnings that are
27775 errors when compiling with gcc-2.95.2
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027776 Source/SWIG1.1/main.cxx: cast const char* to char* for String_replace
Loic Dacharybcf13952000-01-13 15:13:59 +000027777 token and rep should really be const.
27778
Dave Beazley7e3d33a2000-01-12 18:24:22 +0000277791/12/00 : beazley
27780 Added Harco's Java modules.
27781
277821/12/00 : beazley
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027783 Revoked the %ifdef, %ifndef, %endif, %if, %elif, and %else
Dave Beazley7e3d33a2000-01-12 18:24:22 +000027784 directives. These are no longer needed as SWIG now has a real
27785 preprocessor.
27786 *** POTENTIAL INCOMPATIBILITY ***
27787
277881/12/00 : beazley
27789 Moved the documentation modules from the SWIG directory
27790 to the Modules directory (where they really should have been
27791 to begin with).
27792
277931/12/00 : beazley
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027794 Removed the -stat option for printing statistics. The
Dave Beazley7e3d33a2000-01-12 18:24:22 +000027795 statistics reporting was inadequate and mostly broken
27796 anyway.
27797 *** POTENTIAL INCOMPATIBILITY ***
27798
277991/12/00 : beazley
27800 Removed the -t option for reading a typemap file. More
27801 trouble than it's worth. Just include typemaps at the top
27802 of the interface file.
27803 *** POTENTIAL INCOMPATIBILITY ***
27804
278051/12/00 : beazley
27806 Removed the %checkout directive.
27807 *** POTENTIAL INCOMPATIBILITY ***
27808
278091/12/00 : beazley
27810 Removed the -ci option for file checkin. Too problematic
27811 to implement. Probably better to just put your SWIG library
27812 under CVS instead.
27813 *** POTENTIAL INCOMPATIBILITY ***.
27814
278151/11/00 : beazley
Dave Beazley62c16682000-01-12 05:07:10 +000027816 Deleted the LATEX module. Sorry... Didn't know anyone
27817 who was using it. Besides, I'm looking to simplify
27818 the documentation system.
27819 *** POTENTIAL INCOMPATIBILITY ***
27820
Dave Beazley7e3d33a2000-01-12 18:24:22 +0000278211/11/00 : beazley
Dave Beazley62c16682000-01-12 05:07:10 +000027822 Modified the ASCII documentation module to use a .txt
27823 suffix for its output file instead of .doc.
27824
Dave Beazley7e3d33a2000-01-12 18:24:22 +0000278251/11/00 : beazley
Dave Beazley62c16682000-01-12 05:07:10 +000027826 Added the long-lost SWIG preprocessor back to the system.
27827 It should be enabled by default. Raw preprocessed output
27828 can be viewed using swig -E file.i.
27829 *** NEW FEATURE ***
27830
Dave Beazley7e3d33a2000-01-12 18:24:22 +0000278311/11/00 : beazley and djmitche
Dave Beazleyc928c102000-01-12 03:01:06 +000027832 Completely reorganized the SWIG directory structure. The
27833 basic organization is now:
27834
27835 Source/ SWIG source code
27836 Lib/ SWIG library files (swig_lib)
27837 Doc/ Documentation
27838 Examples/ Examples
27839
27840 More directories will be added as needed.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027841
Dave Beazleyc928c102000-01-12 03:01:06 +00002784212/08/99: Loic Dachary ([email protected])
27843 Enhanced package handling for perl5 and c++.
27844
27845 With new option -hide Foo::Bar, every perl5 object (Frob) is
27846 qualified by Foo::Bar::Frob. The package name is solely used
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027847 to encapsulate C/C++ wrappers output in <module>_wrap.c and the
Dave Beazleyc928c102000-01-12 03:01:06 +000027848 corresponding perl package in <module>.pm. Note that a package
27849 name may contain :: (Frob::Nitz) and will be relative to the
27850 package name provided by -hide (Foo::Bar::Frob::Nitz).
27851
27852 In *_wrap.c, SWIG_init macro is used. Was previously defined
27853 but not used and simplifies code.
27854
27855 Added typemap(perl5,perl5in) and typemap(perl5,perl5out) that
27856 do the equivalent of typemap(perl5,in) and typemap(perl5,out)
27857 but contain perl code and applies to wrappers generated by
27858 -shadow.
27859
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027860 Lacking proper regression tests I used
Dave Beazleyc928c102000-01-12 03:01:06 +000027861 Examples/perl5/{c++,constraint,defarg,except,
27862 graph/graph[1234],multinherit,nested,shadow,simple,tree,
27863 typemaps/{argv,argv2,arraymember,database,file,ignore,integer,
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027864 output,passref,reference,return}}/. I ran swig with and without
Dave Beazleyc928c102000-01-12 03:01:06 +000027865 the patches, diff the generatedsources, run the .pl files
27866 and checked that the results are identical. In all those examples
27867 I had no error.
27868
2786911/21/99: Modified the Tcl module to provide full variable linking capabilities
27870 to all datatypes. In previous versions, a pair of accessor functions
27871 were created for datatypes incompatible with the Tcl_LinkVar() function.
27872 Now, we simply use variable traces to support everything. This may
27873 break scripts that rely upon the older behavior.
27874 *** POTENTIAL INCOMPATIBILITY ***
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027875
Dave Beazleyc928c102000-01-12 03:01:06 +00002787611/21/99: Added slight tweak to wrapper generator to collect local variables
27877 of similar type. Produces somewhat more compact wrapper code.
27878
2787911/20/99: Modified the Tcl module to use SWIG_GetArgs() to parse
27880 arguments. This is a technique borrowed from Python in which
27881 arguments are converted using a format string convention similiar
27882 to fprintf(). This results in a *substantial* reduction in the
27883 size of the resulting wrapper code with only a modest runtime overhead
27884 in going through the extra conversion function.
27885
2788611/13/99: Completely rewrote the class/structure generation code for the
27887 Tcl module. Now, a small set of runtime functions are used
27888 to implement the functionality for all classes (instead of a
27889 massive amount of runtime code being generated for each class).
27890 Class specific information is simply encoded in a series of
27891 static tables. This results in a *HUGE* reduction in wrapper
27892 code size--especially for C++.
27893
2789411/13/99: Removed the -tcl (Tcl 7.x) module. Tcl 8.0 is now several
27895 years old and the defacto standard--no real reason to keep
27896 supporting the old version at this point.
27897
2789811/13/99: Cleaned up -c option for Python module. The pyexp.swg file
27899 is now gone.
27900
2790111/13/99: Fixed external declarations to work better with static linking
27902 on Windows. Static linking should now be possible by defining
27903 the -DSTATIC_LINK option on the command line. Patch contributed
27904 by Alberto Fonseca.
27905
2790611/5/99 : Fixed an obscure code generation bug related to the generation
27907 of default constructors. Bug reported by Brad Clements.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027908
Dave Beazleyc928c102000-01-12 03:01:06 +00002790911/5/99 : Fixed a few memory problems found by purify.
27910
2791111/5/99 : Officially deprecated the -htcl, -htk, and -plugin options
27912 from the Tcl and Tcl8 modules.
27913
2791410/26/99: Removed unused variable from python/typemaps.i. Patch
27915 contributed by Keith Davidson.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027916
Dave Beazleyc928c102000-01-12 03:01:06 +0000279178/16/99 : Added _WIN32 symbol to libraries to better support Windows.
27918
279198/16/99 : Deprecated the Perl4 module. It is no longer included in the
27920 distribution and no longer supported. In the entire 3 years SWIG
27921 has been around I never received a single comment about it so I'm
27922 assuming no one will miss it...
27923
279248/16/99 : Modified the type-checking code to register type mappings using a
27925 table instead of repeated calls to SWIG_RegisterMapping(). This
27926 reduces the size of the module initialization function somewhat.
27927
279288/15/99 : Cleaned up the pointer type-checking code in the Tcl module.
27929
279308/15/99 : Many changes to the libraries to support runtime libraries.
27931
279328/13/99 : Eliminated C++ compiler warning messages about extern "C" linkage.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027933
Dave Beazleyc928c102000-01-12 03:01:06 +0000279348/13/99 : Some cleanup of Python .swg files to better support runtime libraries
27935 on Windows.
27936
279378/13/99 : Modified the %pragma directive to attach pragmas declared inside
27938 a class definition to the class itself. For example:
27939
27940 class foo {
27941 ...
27942 %pragma(python) addtomethod = "insert:print `hello world'"
27943 ...
27944 }
27945
27946 Most people don't need to worry about how this works. For people
27947 writing backend modules, class-based pragmas work like this:
27948
27949 lang->cpp_open_class() // Open a class
27950 lang->cpp_pragma() // Supply pragmas
27951 ... // Emit members
27952
27953 lang->cpp_close_class() // Close the class
27954
27955 All of the pragmas are passed first since they might be used to
27956 affect the code generation of other members. Please see
27957 the Python module for an example. Patches contributed
27958 by Robin Dunn.
27959
279608/13/99 : Patch to Python shadow classes to eliminate ignored
27961 exception errors in destructors. Patch contributed
27962 by Robin Dunn.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027963
Dave Beazleyc928c102000-01-12 03:01:06 +0000279648/11/99 : Minor patch to swig_lib/python/swigptr.swg (added SWIGSTATIC
27965 declaration). Patch contributed by Lyle Johnson.
27966
279678/11/99 : Added FIRSTKEY/NEXTKEY methods to Perl5 shadow classes
27968 Patch contributed by Dennis Marsa.
27969
279708/11/99 : Modified Python module so that NULL pointers are returned
27971 and passed as 'None.' Patch contributed by Tal Shalif.
27972
279738/10/99 : Fixed missing 'int' specifiers in various places.
27974
279758/10/99 : Added Windows makefile for Runtime libraries. Contributed
27976 by Bob Techentin.
27977
279788/10/99 : Fixed minor problem in Python runtime makefile introduced
27979 by keyword arguments.
27980
279818/8/99 : Changed $target of perl5(out) typemap from ST(0) to
27982 ST(argvi). Patch contributed by Geoffrey Hort.
27983
279848/8/99 : Fixed bug in typemap checking related to the ANY keyword
27985 in arrays and ignored arguments. Error reported by
27986 Geoffrey Hort.
27987
279888/8/99 : %enabledoc and %disabledoc directives can now be used
27989 inside class/structure definitions. However, no check
27990 is made to see if they are balanced (i.e., a %disabledoc
27991 directive inside a class does not have to have a matching
27992 %enabledoc in the same class).
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000027993
279948/8/99 : Keyword argument handling is now supported in the Python
Dave Beazleyc928c102000-01-12 03:01:06 +000027995 module. For example:
27996
27997 int foo(char *bar, int spam, double x);
27998
27999 Can be called from Python as
28000
28001 foo(x = 3.4, bar="hello", spam=42)
28002
28003 To enable this feature, run SWIG with the '-keyword' command
28004 line option. Mixing keyword and default arguments
28005 should work as well. Unnamed arguments are assigned names
28006 such as "arg1", "arg2", etc...
28007
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028008 *** POTENTIAL INCOMPATIBILITY ***
28009 Functions with duplicate argument names such as
Dave Beazleyc928c102000-01-12 03:01:06 +000028010 bar(int *OUTPUT, int *OUTPUT) will likely cause problematic
28011 wrapper code to be generated. To fix this, use different
28012 names or use %apply to map typemaps to alternate names.
28013
280148/8/99 : Handling of the 'this' pointer has been changed in Python shadow
Olly Bettsf9566ad2013-01-08 18:47:40 +130028015 classes. Previously, dereferencing of '.this' occurred in the
Dave Beazleyc928c102000-01-12 03:01:06 +000028016 Python shadow class itself. Now, this step occurs in the C
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028017 wrappers using the following function:
Dave Beazleyc928c102000-01-12 03:01:06 +000028018
28019 SWIG_GetPtrObj(PyObject *, void **ptr, char *type)
28020
28021 This function can accept either a string containing a pointer
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028022 or a shadow class instance with a '.this' attribute of
Dave Beazleyc928c102000-01-12 03:01:06 +000028023 appropriate type. This change allows the following:
28024
28025 1. The real shadow class instance for an object is
28026 passed to the C wrappers where it can be examined/modified
28027 by typemaps.
28028
28029 2. Handling of default/keyword arguments is now greatly
28030 simplified.
28031
28032 3. The Python wrapper code is much more simple.
28033
28034 Plus, it eliminated more than 300 lines of C++ code in the
28035 Python module.
28036
28037 *** CAVEAT : This requires the abstract object interface.
28038 It should work with Python 1.4, but probably nothing older
28039 than that.
28040
28041
280428/8/99 : Fixed handling of "const" and pointers in classes. In particular,
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028043 declarations such as
Dave Beazleyc928c102000-01-12 03:01:06 +000028044
28045 class foo {
28046 ...
28047 const char *msg;
28048 const int *iptr;
28049 }
28050
28051 are handled as assignable variables as opposed to constant
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028052 values (this is the correct behavior in C/C++). Note:
Dave Beazleyc928c102000-01-12 03:01:06 +000028053 declarations such as "char *const msg" are still unsupported.
28054 Constants declared at the global level using const are also
28055 broken (because I have a number of interfaces that rely upon
28056 this behavior).
28057
28058 *** POTENTIAL INCOMPATIBILITY *** This may break interfaces that
28059 mistakenly treat 'const char *' types as constant values.
28060
280618/8/99 : Modified the parser to support bit-fields. For example:
28062
28063 typedef struct {
28064 unsigned int is_keyword : 1;
28065 unsigned int is_extern : 1;
28066 unsigned int is_static : 1;
28067 } flags;
28068
28069 Bit-fields can only be applied to integer types and their
28070 are other restrictions. SWIG performs no such type-checking
28071 (although the C compiler will catch problems when it tries to
28072 compile the wrapper code).
28073
280748/8/99 : Removed trailing space of $basetype substitution in typemaps.
28075 This is to allow things like this:
28076
28077 %typemap(python, argout) spam** OUTPUT{
28078 ...
28079 char* a = "$basetype_p";
28080 ...
28081 }
28082
28083 (Patch suggested by Nathan Dunfield).
28084
280856/22/99 : Made a very slight tweak to the Perl5 shadow class
28086 code that allows typemaps to alter the return type
28087 of objects (to support polymorphic types). Patch
28088 contributed by Drake Diedrich.
28089
280904/8/99 : Fixed null pointer handling bug in Perl module.
28091 Patch contributed by Junio Hamano.
28092
280933/17/99 : Fixed bug in perl5ptr.swg for ActiveState Perl.
28094 Patch contributed by Greg Anderson.
28095
280962/27/99 : Eliminated segmentation fault when Swig runs on
28097 empty files.
28098
280992/27/99 : Added patch to Guile module to eliminate unused
28100 variables. Contributed by Mike Simons.
28101
281022/27/99 : Fixed problem with %addmethods returning references.
28103
281042/27/99 : Fixed Runtime/Makefile. Patch contributed by
28105 Mike Romberg.
28106
281072/27/99 : Incorporated patches to the type-checker.
28108
281092/27/99 : Fixed problem with -exportall switch and shadow classes
28110 in Perl5 module. Patch contributed by Dennis Marsa.
28111
281122/27/99 : Modified Perl5 module to recognize 'undef' as a NULL char *.
28113 Patch contributed by Junio Hamano.
28114
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000281152/27/99 : Fixed the Perl5 module to support the newer versions of
Dave Beazleyc928c102000-01-12 03:01:06 +000028116 ActiveState Perl for Win32.
28117
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000281182/27/99 : Fixed the include order of files specified with the
Dave Beazleyc928c102000-01-12 03:01:06 +000028119 -I option.
28120
Dave Beazleyd6d71882000-02-11 19:47:45 +0000281212/5/98- : Dave finishes his dissertation, goes job hunting, moves to
281222/5/99 Chicago and generally thrashes about.
28123
Dave Beazleyc928c102000-01-12 03:01:06 +000028124Version 1.1 Patch 5 (February 5, 1998)
28125======================================
Olly Bettsfdcea432009-02-26 05:53:37 +000028126
Dave Beazleyc928c102000-01-12 03:01:06 +0000281272/4/98 : Fixed a bug in the configure script when different package
28128 locations are specified (--with-tclincl, etc...).
28129
281302/2/98 : Fixed name-clash bug related to the switch to C macros for accessor
28131 functions. The new scheme did not work correctly for objects
28132 with members such as 'obj', 'val', etc... Fixed the bug by
28133 appending the word 'swig' to macro argument names. Patch
28134 contributed by Rudy Albachten.
28135
281362/2/98 : Slight fix to the Perl5 module to eliminate warning messages
28137 about 'varname used only once : possible typo'. Fix
28138 contributed by Rudy Albachten.
28139
281401/9/98 : Fixed a bug in the Perl 5 module related to the creation of
28141 constants and shadow classes.
28142
281431/9/98 : Fixed linking bug with Python 1.5 embed.i library file.
28144
28145Version 1.1 Patch 4 (January 4, 1998)
28146=====================================
28147
281481/4/98 : Changed structured of the Examples directory to be more friendly
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028149 to Borland C++.
Dave Beazleyc928c102000-01-12 03:01:06 +000028150
281511/4/98 : Added the function Makefile.win.bc for compiling the examples
28152 under Borland 5.2.
28153
281541/4/98 : Slight change to the perl5 module and C++ compilation. The
28155 <math.h> library is now included before any Perl headers
28156 because Perl the extern "C" linkage of math.h screws alot
28157 of things up (especially on Windows).
28158
281591/2/98 : Change to the Python module that reduces the number of constants
28160 created by C++ classes, inheritance, and shadow classes. This
28161 modification may introduce a few slight incompatibilities if
28162 you attempt to use the non-shadow class interface with shadow
28163 classes enabled. Patch contributed by Mike Romberg.
28164
281651/2/98 : Support for Tcl 8.0 namespaces has been added. This *replaces*
28166 the original SWIG mechanism that assumed [incr Tcl] namespaces.
28167 To use namespaces, simply run SWIG with the following options
28168
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028169 swig -tcl -namespace foo.i
28170
Dave Beazleyc928c102000-01-12 03:01:06 +000028171 This places everything in a namespace that matches
28172 the module name
28173
28174 swig -tcl -namespace -prefix bar foo.i
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028175
Dave Beazleyc928c102000-01-12 03:01:06 +000028176 This places everything in the namespace 'bar'
28177
28178 The use of namespaces is new in Tcl 8.0. However, the wrapper code
28179 generated by SWIG will still work with all versions of Tcl newer
28180 than and including Tcl 7.3/Tk3.6 even if the -namespace option is
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028181 used.
Dave Beazleyc928c102000-01-12 03:01:06 +000028182
28183 *** POTENTIAL INCOMPATIBILITY ***
28184 This change may break existing applications that relied on the
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028185 -prefix and -namespace options.
Dave Beazleyc928c102000-01-12 03:01:06 +000028186
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000281871/2/98 : Added the following constants to the Tcl wrapper code
Dave Beazleyc928c102000-01-12 03:01:06 +000028188
28189 SWIG_name - Name of the SWIG module
28190 SWIG_prefix - Prefix/namespace appended to command names
28191 SWIG_namespace - Name of the namespace
28192
28193 SWIG library writers can use these to their advantages.
28194
281951/2/98 : Fixed a bug in the Tcl8 module related to the creation of
28196 pointer constants (the function SWIG_MakePtr was missing from
28197 the wrapper code).
28198
281991/2/98 : Added the consthash.i library file to the Tcl and Tcl8 modules.
28200
282011/1/98 : Changed and cleaned up the Python typemaps.i file. The following
28202 significant changes were made :
28203
28204 1. The OUTPUT typemap now returns Python tuples instead of
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028205 lists. Lists can be returned as before by using the
Dave Beazleyc928c102000-01-12 03:01:06 +000028206 L_OUTPUT type. If compatibility with older versions
28207 is needed, run SWIG with the -DOUTPUT_LIST option.
28208
28209 2. The BOTH typemap has been renamed to INOUT. For backwards
28210 compatibility, the "BOTH" method still exists however.
28211
28212 3. Output typemaps now generate less code than before.
28213
28214 Changes to typemaps.i may break existing Python scripts that assume
28215 output in the form of a list.
28216 *** POTENTIAL INCOMPATIBILITY ***
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028217
2821812/31/97: Fixed long overdue problems with the testing scripts and certain
28219 makefiles that required the use of the bash shell. Everything should
Dave Beazleyc928c102000-01-12 03:01:06 +000028220 work properly with the standard Bourne shell (sh) now.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028221
Dave Beazleyc928c102000-01-12 03:01:06 +00002822212/31/97: Modified typemaps to allow $basetype as a valid local variable.
28223 This allows for all sorts of bizarre hackish typemaps that
28224 do cool things. Patch contributed by Dominique Dumont.
28225
2822612/31/97: Switched accessor functions generated for member data to
28227 C preprocessor macros (except in cases involving typemaps
28228 or char *).
28229
2823012/31/97: Fixed a bug related to C++ member data involving references.
28231
2823212/31/97: Changed accessor functions for C++ member functions to
28233 preprocessor macros. This cleans up the wrapper code
28234 and results in fewer function definitions.
28235
2823612/31/97: Changed the default C constructor to use calloc() instead
28237 of malloc()
28238
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +00002823912/30/97: Changed the creation of constants in the Perl5 module.
Dave Beazleyc928c102000-01-12 03:01:06 +000028240 For all practical purposes, they should work in exactly the
28241 same way as before except that they now require much less
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028242 wrapper code. Modules containing large numbers of
Dave Beazleyc928c102000-01-12 03:01:06 +000028243 constants may see greater than a 50% reduction in wrapper
28244 code size.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028245
Dave Beazleyc928c102000-01-12 03:01:06 +00002824612/30/97: Modified the Python module to be more intelligent about the
28247 creation of constants. SWIG no longer generates redundant
28248 global variables and the size of the module initialization
28249 function should be reduced. (Many thanks to Jim Fulton).
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028250
Dave Beazleyc928c102000-01-12 03:01:06 +00002825112/29/97: Fixed a bug in C++ code generation related to member functions,
28252 default arguments, and references.
28253
2825412/29/97: Fixed configure script and a few makefiles to support Python 1.5
28255
2825612/29/97: Added 'embed15.i' library file. This file should be used to
Olly Betts2f3bf142014-02-23 16:52:08 +130028257 statically link versions of Python 1.5. To make it the default,
Dave Beazleyc928c102000-01-12 03:01:06 +000028258 simply copy 'swig_lib/python/embed15.i' to 'swig_lib/python/embed.i'
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028259
Dave Beazleyc928c102000-01-12 03:01:06 +000028260Version 1.1 Patch 3 (November 24, 1997)
28261========================================
28262
2826311/23/97: Fixed a bug in the Perl5 module with shadow classes and
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028264 static class functions that return class instances.
Dave Beazleyc928c102000-01-12 03:01:06 +000028265 Note : The fix for this bug requires a slight restructuring of
28266 of the .pm files created by SWIG.
28267
2826811/23/97: Fixed a bug in the Tcl/Tcl8 modules related to variable linking
28269 of character arrays. If you declared a global variable 'char foo[10]',
28270 the generated wrapper code would either cause a segmentation fault
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028271 immediately upon loading or weird memory corruption elsewhere.
Dave Beazleyc928c102000-01-12 03:01:06 +000028272 This should now be fixed although character arrays can only be
28273 read-only.
28274
2827511/23/97: Fixed a bug with the %import directive that caused it to
28276 fail if files were imported from directories other than
28277 the current working directory.
28278
2827911/23/97: Fixed incorrect diagnostic message in the ASCII documentation
28280 module.
28281
2828211/23/97: Changed the behavior of the -o option when used with shadow
28283 classes. If -o was used to specify both the pathname and filename
28284 of SWIG's output such as
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028285
Dave Beazleyc928c102000-01-12 03:01:06 +000028286 swig -o /home/swig/wrapper.c -shadow -perl5 foo.i
28287
28288 The wrapper code would be placed the file specified with -o,
28289 but the .pm file and documentation would be placed in the
28290 directory where SWIG was run. Now, these files are placed
28291 in the same directory as the file specified with the -o option.
28292 This change is also needed for proper operation on the
28293 Macintosh.
28294
2829511/23/97: Added a 'this()' method to Perl5 shadow classes. This can
28296 be used to return the normal pointer value from a shadow
28297 class that is represented as a tied hash. To use just
28298 invoke as a method like this :
28299
28300 $l = new List; # Create an object
28301 $ptr = $l->this(); # Get the normal pointer value
28302
28303 *** NEW FEATURE ***
28304
2830511/23/97: Fixed the Tcl 8 pointer.i library file (which was completely
28306 broken in 1.1p2).
28307
2830811/23/97: Modified the Perl5 type-checker to fix a few problems
28309 with global variables of pointer types and to allow
28310 tied hashes to be used interchangably with normal
28311 pointer values.
28312
2831311/23/97: Modified the typemap mechanism to allow output
28314 typemaps of type 'void'. These were ignored previously,
28315 but now if you specify,
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028316
Dave Beazleyc928c102000-01-12 03:01:06 +000028317 %typemap(lang,out) void {
28318 ... return a void ...
28319 }
28320
28321 You can change or assign a return value to the function.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028322
Dave Beazleyc928c102000-01-12 03:01:06 +00002832311/23/97: Fixed processing of 'bool' datatypes in the Python module.
28324
2832511/23/97: Fixed minor parsing error with C++ initializers. For example,
28326
28327 class B : public A {
28328 public:
28329 B() : A() { ... };
28330 ...
28331 }
28332
2833311/23/97: Fixed the Tcl8 module so that C functions that call back into
28334 Tcl don't corrupt the return result object (SWIG was gathering
28335 the result object too early which leads to problems if subsequent
28336 Tcl calls are made).
28337
2833811/23/97: Fixed a code generation bug in the Python module when two or
28339 more output parameters were used as the first arguments of a
28340 function. For example :
28341
28342 %include typemaps.i
28343 void foo(double *OUTPUT, double *OUTPUT, double a);
28344
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028345 Previously, doing this resulted in the creation of an
Dave Beazleyc928c102000-01-12 03:01:06 +000028346 extraneous comma in the output, resulting in a C syntax error.
28347
2834811/22/97: Fixed a bug when template handling that was stripping whitespace
28349 around nested templates. For example :
28350
28351 Foo<Bar<double> >
28352
28353 was getting munged into Foo<Bar>> which is a syntax error in
28354 in the C++ compiler.
28355
2835611/22/97: Fixed bugs in the Borland C++ makefiles.
28357
2835811/22/97: Fixed memory corruption bug when processing integer
28359 arguments in Tcl8 module.
28360
2836111/21/97: Fixed a bug in the Runtime/Makefile related to Tcl 8.
28362
2836311/21/97: Fixed a bug with the %new directive and Perl5 shadow classes.
28364 No longer generates a perl syntax error.
28365
2836611/9/97 : Changed a strncpy() to strcpy() in the pointer type-checker.
28367 This results in a substantial performance improvement in
28368 type-checking.
28369
2837010/29/97: Fixed a bug in the code generation of default arguments and
28371 user-defined types. For example :
28372
28373 void foo(Vector a, Vector b = d);
28374
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028375 should now work properly.
Dave Beazleyc928c102000-01-12 03:01:06 +000028376
28377Version 1.1 Patch 2 (September 4, 1997)
28378=======================================
Olly Bettsfdcea432009-02-26 05:53:37 +000028379
Dave Beazleyc928c102000-01-12 03:01:06 +0000283809/4/97 : Fixed problem with handling of virtual functions that
28381 was introduced by some changes in the C++ module.
28382
28383Version 1.1 Patch 1 (August 27, 1997)
28384=====================================
28385
283868/26/97 : Fixed compilation and run-time bugs with Tcl 8.0 final.
28387
283888/21/97 : Fixed code generation bug with arrays appearing as arguments
28389 to C++ member functions. For example :
28390
28391 class Foo {
28392 public:
28393 void Bar(int a[20][20]);
28394 };
28395
28396 There is still a bug using arrays with added methods
28397 however.
28398
283998/20/97 : Fixed a bug with generating the code for added methods
28400 involving pass-by-value.
28401
284028/19/97 : Modified the typemapper to substitute the '$arg' value
28403 when declaring local variables. For example :
28404
28405 %typemap(in) double * (double temp_$arg) {
28406 ... do something ...
28407 }
28408
28409 When applied to a real function such as the following :
28410
28411 void foo(double *a, double *b, double *result);
28412
28413 three local variables will be created as follows :
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028414
Dave Beazleyc928c102000-01-12 03:01:06 +000028415 double temp_a;
28416 double temp_b;
28417 double temp_result;
28418
28419 This can be used when writing multiple typemaps that need
28420 to access the same local variables.
28421
28422
284237/27/97 : Fixed a variety of problems with the %apply directive and arrays.
28424 The following types of declarations should now work :
28425
28426 %apply double [ANY] { Real [ANY] };
28427 %apply double [4] { double [10] };
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028428
Dave Beazleyc928c102000-01-12 03:01:06 +000028429 A generic version of apply like this :
28430
28431 %apply double { Real };
28432
28433 should now work--even if arrays involving doubles and Reals are
28434 used later.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028435
Dave Beazleyc928c102000-01-12 03:01:06 +0000284367/27/97 : Changed warning message about "Array X has been converted to Y" to
28437 only appear if running SWIG in verbose mode.
28438
284397/27/97 : Added the variables $parmname and $basemangle to the typemap
28440 generator. $parmname is the name of the parameter used
28441 when the typemap was matched. It may be "" if no parameter
28442 was used. $basemangle is a mangled version of the base
28443 datatype. Sometimes used for array handling.
28444
284457/27/97 : Changed the behavior of output arguments with Python shadow classes.
28446 Originally, if a function returned an object 'Foo', the shadow class
28447 mechanism would create code like this :
28448
28449 def return_foo():
28450 val = FooPtr(shadowc.return_foo())
28451 val.this = 1
28452 return val
28453
28454 The problem with this is that typemaps allow a user to redefine
28455 the output behavior of a function--as a result, we can no longer
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028456 make any assumptions about the return type being a pointer or
Dave Beazleyc928c102000-01-12 03:01:06 +000028457 even being a single value for that matter (it could be a list,
28458 tuple, etc...). If SWIG detects the use of output typemaps
28459 (either "out" or "argout") it returns the result unmodified like
28460 this :
28461
28462 def return_foo():
28463 val = shadowc.return_foo()
28464 return val
28465
28466 In this case, it is up to the user to figure out what to do
28467 with the return value (including the possibility of converting it
28468 into a Python class).
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028469
Dave Beazleyc928c102000-01-12 03:01:06 +0000284707/26/97 : Fixed a parsing problem with types like 'unsigned long int',
28471 'unsigned short int', etc...
28472
284737/24/97 : Minor bug fix to Tcl 8 module to parse enums properly. Also
28474 fixed a memory corruption problem in the type-checker.
28475 (patch contributed by Henry Rowley.
28476
284777/24/97 : Added Python-tuple typemaps contributed by Robin Dunn.
28478
284797/24/97 : Incorporated some changes to the Python module in support of
28480 Mark Hammond's COM support. I'm not entirely sure they
28481 work yet however. Needs documentation and testing.
28482
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000284837/24/97 : Fixed code generation bugs when structures had array members
Dave Beazleyc928c102000-01-12 03:01:06 +000028484 and typemaps were used. For example :
28485
28486 %typemap(memberin) double [20][20] {
28487 ... get a double [20][20] ...
28488 }
28489 struct Foo {
28490 double a[20][20];
28491 }
28492
28493 Originally, this would generate a compiler-type error when
28494 the wrapper code was compiled. Now, a helper function like
28495 this is generated :
28496
28497 double *Foo_a_set(Foo *a, double val[20][20]) {
28498 ... memberin typemap here ...
28499 return (double *) val;
28500 }
28501
28502 When writing typemaps, one can assume that the source variable
28503 is an array of the *same* type as the structure member. This
28504 may break some codes that managed to work around the array bug.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028505 *** POTENTIAL INCOMPATIBILITY ***
Dave Beazleyc928c102000-01-12 03:01:06 +000028506
285077/13/97 : Fixed bug in Perl5 module when using C global variables that
28508 are pointers. When used in function calls and other operations,
28509 the value of the pointer would be invalid---causing core
28510 dumps and other problems. SWIG implements global variables
28511 using Perl magic variables. As it turns out, the error
28512 was caused by the fact that the pointer-extraction code
28513 was somehow bypassing the procedure used to resolve magical
28514 variables (hence, leaving the value undefined). To fix
28515 the problem, SWIG now explicitly resolves magic before
28516 extracting pointer values.
28517
285187/12/97 : Eliminated the last remnants of free() and malloc() from
28519 the SWIG compiler.
28520
285217/12/97 : Fixed parsing problems with typemaps involving arrays and
28522 temporary variables of arrays. Also made it possible for
28523 SWIG to handle typemaps like this :
28524
28525 %typemap(in) double [ANY] (double temp[$dim0]) {
28526 ... store data in temp[$dim0] ...
28527 }
28528
28529 Not only does this typemap match any double [] array, it
28530 creates a local variable with precisely the right dimensions.
28531 (ie. $dim0 gets filled in with the real number of dimensions).
28532 Of course, off the record, this will be a way to add more
28533 functionality to the typemaps.i libraries.
28534
285357/9/97 : Fixed some problems with Perl5, static linking, and shadow
28536 classes. When statically linking multiple modules together, write
28537 a top-level interface file like this when shadow classes are not
28538 used :
28539
28540 %module swig, foo, bar, glob;
28541 %include perlmain.i
28542
28543 When shadow classes are used, the module names have an extra 'c'
28544 appended so it should read as :
28545
28546 %module swig, fooc, barc, globc;
28547 %include perlmain.i
28548
28549 When linking multiple modules, consider using the SWIG runtime
28550 library.
28551
285527/8/97 : Incorporated fixed versions of the Borland C++ Makefiles.
28553
285547/8/97 : First cut at trying to eliminate excessive compiler warnings.
28555 As it turns out, alot of warnings go away if you just make
28556 declarations like this
28557
28558 clientData = clientData;
28559
28560 in the resulting wrapper code. Most compilers should just
28561 ignore this code (at least would can hope).
28562
285637/8/97 : Fixed bizarre code generation bug with typemaps and C++ classes.
28564 In some cases, typemaps containing printf formatting strings such as
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028565
Dave Beazleyc928c102000-01-12 03:01:06 +000028566 %typemap(memberout) int * {
28567 printf("%d",42);
28568 }
28569
28570 Would generate completely bogus code with garbage replacing
28571 the '%d'. Caused by one faulty use of printf (wasn't able to find
Olly Bettsf9566ad2013-01-08 18:47:40 +130028572 any other occurrences).
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028573
Dave Beazleyc928c102000-01-12 03:01:06 +0000285747/7/97 : Fixed bug in Python shadow class generation with non-member
28575 functions that are returning more than one value.
28576
285777/7/97 : Incorporated modifications to make SWIG work with Guile 1.2.
28578 Still need to test it out, but it is rumored to work.
28579
285807/2/97 : Fixed some bugs related to output arguments and Python shadow
28581 classes. If an output argument is detected, SWIG assumes
28582 that the result is a list and handles it appropriately.
28583 If the normal return type of an function is an object,
28584 it will be converted into a shadow class as before, but
28585 with the assumption that it is the first element of a
28586 list. *** NOTE : This behavior has been subsequently changed ***
28587
285886/29/97 : Changed EXPORT to SWIGEXPORT in all of the language modules.
28589 Should provide better compatibility with Windows.
28590
285916/29/97 : Modified Python shadow classes so that output arguments
28592 work correctly (when typemaps are used).
28593
28594Version 1.1 (June 24, 1997)
28595===========================
28596
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000285976/24/97 : Fixed Objective-C constructor bug when working with Perl5
Dave Beazleyc928c102000-01-12 03:01:06 +000028598 shadow classes.
28599
286006/23/97 : Fixed some parsing problems with Objective-C. Declarations
28601 such as the following should work now :
28602
28603 - foo : (int) a with: (int) b;
28604
286056/22/97 : Added SWIG Runtime library. This library contains
28606 the SWIG pointer type-checker and support functions
28607 that are normally included in every module. By using
28608 the library, it is easier to work with multiple SWIG
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028609 generated modules.
Dave Beazleyc928c102000-01-12 03:01:06 +000028610
286116/22/97 : Fixed minor bug in Perl5 module related to static linking
28612 of multiple modules.
28613
286146/22/97 : Fixed some bugs with the %import directive. When used with
28615 Perl5 shadow classes, this generates a 'require' statement
28616 to load in external modules.
28617
286186/22/97 : Added -swiglib option. This prints out the location of the
28619 SWIG library and exits. This option is only really useful to
28620 configuration tools that are looking for SWIG and its library
28621 location (e.g. autoconf, configure, etc...).
28622
286236/21/97 : Fixed export bug with Perl5.004 on Windows-NT.
28624
286256/20/97 : Minor change to code generation of class/structure members in
28626 order to work better with typemaps. Should have no noticable
28627 impact on existing SWIG modules.
28628
286296/19/97 : Added -t option. This allows SWIG to load a typemap file before
28630 processing any declarations. For example :
28631
28632 swig -t typemaps.i -python example.i
28633
28634 At most, only one typemap file can be specified in this manner.
28635 *** NEW FEATURE ***
28636
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000286376/18/97 : Need a Makefile fast? Type
Dave Beazleyc928c102000-01-12 03:01:06 +000028638
28639 swig [-tcl, -perl5, -python] -co Makefile
28640
28641 and you will get a Makefile specific to that target language.
28642 You just need to modify it for your application and you're
28643 ready to run.
28644
286456/18/97 : Completed the -ci option. This option checks a file into the
28646 SWIG library. It should be used in conjunction with a
28647 language option. For example :
28648
28649 swig -tcl -ci foobar.i
28650
28651 Checks the file foobar.i into the Tcl part of the library.
28652 In order to check a file into the general library (accessible
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028653 to all languages modules), do the following
Dave Beazleyc928c102000-01-12 03:01:06 +000028654
28655 swig -ci -o ../foobar.i foobar.i
28656
28657 (Admittedly this looks a little strange but is unavoidable).
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028658 The check-in option is primarily designed for SWIG maintenance
Dave Beazleyc928c102000-01-12 03:01:06 +000028659 and library development. The command will fail if the user does
28660 not have write permission to the SWIG library. Third party library
28661 extensions can easily install themselves by simply providing
28662 a shell script that uses 'swig -ci' to install the appropriate
28663 library files. It is not necessary to know where the SWIG library
28664 is located if you use this mechanism.
28665 *** NEW FEATURE ***
28666
286676/16/97 : Fixed a bug in shadow class generation when %name() was applied
28668 to a class definition. Unfortunately, fixing the bug required
28669 a change in the Language C API by adding an extra argument to
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028670 the Language::cpp_class_decl() function. This may break
Dave Beazleyc928c102000-01-12 03:01:06 +000028671 SWIG C++ extensions.
28672 *** POTENTIAL INCOMPATIBILITY ***
28673
286746/15/97 : Added a warning message if no module name is specified with the
28675 %module directive or -module option.
28676
286776/15/97 : Fixed line number bug when reporting errors for undefined
28678 base classes.
28679
286806/15/97 : Added new %rename directive. This allows the forward declaration
28681 of a renaming. For example :
28682
28683 %rename OldName NewName;
28684
28685 .... later ...
28686 int OldName(int);
28687
Olly Bettsf9566ad2013-01-08 18:47:40 +130028688 Unlike %name, %rename will rename any occurrence of the old name.
Dave Beazleyc928c102000-01-12 03:01:06 +000028689 This applies to functions, variables, class members and so forth.
28690 There is no way to disable %rename once set, but you can change the
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028691 name by redeclaring it to something else.
Dave Beazleyc928c102000-01-12 03:01:06 +000028692 *** NEW FEATURE ***
28693
286946/15/97 : Improved the implementation of the %name directive so that it
28695 could be used with conditional compilation :
28696
28697 #ifdef SWIG
28698 %name(NewName)
28699 #endif
28700 int OldName(int);
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028701
Dave Beazleyc928c102000-01-12 03:01:06 +0000287026/15/97 : Added support for functions with no return datatype. In this case,
28703 SWIG assumes a return type of 'int'.
28704
287056/11/97 : Improved error reporting in the parser. It should be a little
28706 less sensitive to errors that occur inside class definitions
28707 now. Also reports errors for function pointers.
28708
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000287096/11/97 : Made '$' a legal symbol in identifiers. This is to support
Dave Beazleyc928c102000-01-12 03:01:06 +000028710 some Objective-C libraries. Some compilers (such as gcc) may also
28711 allow identifiers to contain a $ in C/C++ code as well (this is
28712 an obscure feature of C). When '$' appears in identifier, SWIG
28713 remaps it to the string '_S_' when creating the scripting language
28714 function. Thus a function 'foo$bar' would be called 'foo_S_bar'.
28715
287166/11/97 : Fixed bug in Python shadow classes with __repr__ method. If
28717 supplied by the user, it was ignored, but now it should work.
28718
287196/9/97 : Fixed the Tcl 8.0 module to work with Tcl 8.0b1. SWIG is no
28720 longer compatible with *any* alpha release of Tcl 8.0.
28721 *** POTENTIAL INCOMPATIBILITY ***
28722
287236/7/97 : Put a maximal error count in (currently set to 20). SWIG will bail out
28724 if it generates more errors than this (useful for preventing SWIG
28725 from printing 4000 syntax errors when it gets confused).
28726
287276/7/97 : Fixed segmentation fault when parsing variable length arguments.
28728
287296/7/97 : Minor change to Perl5 module. C++ static functions are now
28730 put in the same package as their class when using shadow classes.
28731
287326/7/97 : Centralized the naming of functions, members, wrappers etc... By
28733 centralizing the naming scheme, it should be possible to make
28734 some multi-file optimizations. Also, it should be possible to
28735 change SWIG's naming scheme (perhaps a new feature to be added
28736 later).
28737
287386/2/97 : Added 'arginit' typemap. This can be used to assign initial values
28739 to function arguments. Doing so makes it somewhat easier to detect
28740 improper argument passing when working with other typemaps.
28741
287426/2/97 : Fixed code generation bug when read-only variables were inherited
28743 into other classes. Under inheritance, the variables would
28744 become writable, but this has now been corrected.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028745
287465/30/97 : An empty %name() directive is no longer allowed or supported.
Dave Beazleyc928c102000-01-12 03:01:06 +000028747 This directive was originally used to strip the prefix
28748 off of a class or structure. Unfortunately, this never really
28749 seemed to work right and it complicated the C++ code generator
28750 significantly. As far as I can tell no one uses it, so it
28751 is now history. *** POTENTIAL INCOMPATIBILITY ***
28752
287535/28/97 : Fixed a parsing bug with #define and C++ comments. Declarations
28754 such as the following now work properly :
28755
28756 #define CONST 4 // A Comment
28757
287585/28/97 : Made some performance improvements to the SWIG String class.
28759 (only affects the SWIG compiler itself).
28760
287615/28/97 : Modified the parser to skip template definitions and issue a
28762 warning message.
28763
287645/28/97 : Preliminary support for parameterized types added (ie. templates).
28765 Types such as the following should pass through the SWIG compiler
28766
28767 void foo(vector<complex> *a, vector<double> *b);
28768
28769 When used, the entire name 'vector<complex>' becomes the name
28770 of the datatype. Due to space limitations in datatype
28771 representations, the name should not exceed 96 characters.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028772
Dave Beazleyc928c102000-01-12 03:01:06 +000028773 Note : This is only part of what is needed for template support.
28774 Template class definitions are not yet supported by SWIG.
28775
28776 The template notation above may also be used when specifying
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028777 Objective-C protocol lists.
Dave Beazleyc928c102000-01-12 03:01:06 +000028778 *** NEW FEATURE ***
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028779
Dave Beazleyc928c102000-01-12 03:01:06 +0000287805/24/97 : First cut at Objective-C support added. As it turns out, almost
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028781 everything can be handled with only a few minor modifications to
Dave Beazleyc928c102000-01-12 03:01:06 +000028782 the C++ module.
28783 *** NEW FEATURE ***
28784
287855/23/97 : Fixed repeated definition bug in multiple inheritance handling
28786 when multiple base classes share a common base class (ie.
28787 the evil diamond).
28788
287895/21/97 : Fixed rather embarrassing typo that worked its way into the
28790 Tests/Build directory.
28791
287925/19/97 : Fixed code generation bug when using native methods and
28793 shadow classes with Python and Perl5 modules.
28794
287955/19/97 : Modified the %apply directive slightly so that it would work
28796 with pointers a little better. For example :
28797
28798 %apply unsigned long { DWORD };
28799
28800 Applies *all* typemaps associated with "unsigned long" to
28801 "DWORD". This now includes pointers to the two datatypes.
28802 For example, a typemap applied to "unsigned long **" would
28803 also be applied to any occurrence of "DWORD **" as well.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028804
Dave Beazleyc928c102000-01-12 03:01:06 +0000288055/19/97 : Fixed an ownership assignment bug in the Perl5 module when
28806 class members were returning new objects belonging to
28807 different classes.
28808
288095/17/97 : Added a few more typemap variables.
28810
28811 $name - Name of function/variable/member
28812 $basetype - Base datatype (type without pointers)
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028813 $argnum - Argument number
Dave Beazleyc928c102000-01-12 03:01:06 +000028814
288155/16/97 : Fixed embarrassing underscore error in local variable
28816 allocator.
28817
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000288185/16/97 : Fixed namespace clash bug in parameterized typemaps
Dave Beazleyc928c102000-01-12 03:01:06 +000028819 when creating arrays as new local variables.
28820
288215/15/97 : Fixed some bugs with inheritance of added methods across
28822 multiple files. SWIG now uses names of base classes
28823 when generating such functions.
28824
288255/14/97 : Finished support for default typemaps. Primarily used
28826 internally, they can be used to match the basic
28827 built-in datatypes used inside of SWIG. You can
28828 specify them in interface files as well like this :
28829
28830 %typemap(tcl,in) int SWIG_DEFAULT_TYPE {
28831 $target = atoi($target);
28832 }
28833
28834 Unlike normal typemaps, this default map will get applied
28835 to *all* integer datatypes encountered, including those
28836 renamed with typedef, etc...
28837
288385/13/97 : Fixed substring bug in type checker.
28839
288405/12/97 : Fixed bug in parameterized typemaps when declaring local
28841 variables of structures.
28842
28843Version 1.1 Beta6 (May 9, 1997)
28844===============================
28845
288465/9/97 : Fixed bizarre NULL pointer handling bug in Perl5 module.
28847
288485/8/97 : Fixed mysterious segmentation fault when running SWIG on an
28849 empty file.
28850
288515/7/97 : The code generator will now replace the special symbol "$cleanup"
28852 with the cleanup code specified with the "freearg" typemap.
28853 This change needed to properly manage memory and exceptions.
28854
288555/5/97 : Added the 'typemaps.i' library file. This contains a
28856 variety of common typemaps for input values, pointers,
28857 and so on.
28858
288595/5/97 : Changed behavior of "argout" typemap in Python module.
28860 Old versions automatically turned the result into a
28861 Python list. The new version does nothing, leaving the
28862 implementation up to the user. This provides more flexibility
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028863 but may break older codes that rely on typemaps.
Dave Beazleyc928c102000-01-12 03:01:06 +000028864 *** POTENTIAL INCOMPATIBILITY ***
28865
288665/5/97 : Fixed bug in Python module related to the interaction of
28867 "argout" and "ignore" typemaps.
28868
288695/5/97 : Fixed bug in Python module that would generate incorrect code
28870 if all function arguments are "ignored".
28871
288725/4/97 : Added %apply and %clear directives. These form a higher level
28873 interface to the typemap mechanism. In a nutshell, they
28874 can be used to change the processing of various datatypes without
28875 ever having to write a typemap. See the SWIG documentation
28876 for more details. ** NEW FEATURE **
28877
288785/4/97 : Added a local variable extension to the typemap handler.
28879 For example :
28880
28881 %typemap(tcl,in) double *(double temp) {
28882 temp = atof($source);
28883 $target = &temp;
28884 }
28885
28886 In this case, 'temp' is a local variable that exists
28887 in the entire wrapper function (not just the typemap
28888 code). This mechanism provides better support for
28889 certain types of argument handling and also makes it
28890 possible to write thread-safe typemaps. Any number
28891 local variables can be declared by supplying a comma
28892 separated list. Local variables are guaranteed to be
28893 unique, even if the same typemap is applied many times
28894 in a given function.
28895 ** Not currently supported in Perl4 or Guile modules.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028896
Dave Beazleyc928c102000-01-12 03:01:06 +0000288975/2/97 : Fixed processing of %ifdef, %endif, %if, etc... (These are
28898 SWIG equivalents of the C preprocessor directives that
28899 can pass through the C preprocessor without modification).
28900
289015/2/97 : Fixed major (but subtle) bug in the run-time type checker
28902 related to searching and type-checking for C++ inheritance.
28903 To make a long story short, if you had two classes named
28904 "Foo" and "FooObject" the type checker would sometimes
28905 get confused and be unable to locate "Foo" in an internal
28906 table.
28907
289085/2/97 : Fixed some bugs in the -co option.
28909
289104/24/97 : Pointer library added to the SWIG library.
28911
289124/19/97 : Added the %new directive. This is a "hint" that can be used
28913 to tell SWIG that a function is returning a new object. For
28914 example :
28915
28916 %new Foo *create_foo();
28917
28918 This tells SWIG that create_foo() is creating a new object
28919 and returning a pointer to it. Many language modules may
28920 choose to ignore the hint, but when working with shadow classes,
28921 the %new is used to handle proper ownership of objects.
28922
28923 %new can also be used with dynamically allocated strings.
28924 For example :
28925
28926 %new char *create_string();
28927
28928 When used, all of the language modules will automatically cleanup
28929 the returned string--eliminating memory leaks.
28930 ** NEW FEATURE **
28931
289324/19/97 : Added a new typemap "newfree". This is used in conjunction with
28933 the %new directive and can be used to change the method by which
28934 a new object returned by a function is deleted.
28935
289364/19/97 : The symbol "__cplusplus" is now defined in the SWIG interpreter
28937 when running with the -c++ option.
28938
289394/17/97 : Added support for static member functions when used inside the
28940 %addmethods directive.
28941
289424/15/97 : Added a special typemap symbol PREVIOUS that can be used to
28943 restore a previous typemap. For example :
28944
28945 %typemap(tcl,in) int * = PREVIOUS;
28946
28947 This is primarily used in library files.
28948
289494/13/97 : Added %pragma directive for Perl5 module. Two new pragmas are
28950 available :
28951
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028952 %pragma(perl5) code = "string"
28953 %pragma(perl5) include = "file.pl"
Dave Beazleyc928c102000-01-12 03:01:06 +000028954
28955 Both insert code into the .pm file created by SWIG. This can
28956 be used to automatically customize the .pm file created by SWIG.
28957
289584/13/97 : Scanner modified to only recognize C++ keywords when the -c++
28959 option has been specified. This provides support for C programs
28960 that make use of these keywords for identifiers.
28961 SWIG may need to be explicitly run with the -c++ option when
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028962 compiling C++ code (this was allowed, but not recommended in
Dave Beazleyc928c102000-01-12 03:01:06 +000028963 previous versions). **POTENTIAL INCOMPATIBILITY**
28964
289654/11/97 : Fixed a rather nasty bug in the Perl5 module related to using
28966 variable linking with complex datatypes and pointers. On Unix,
28967 code would work (somehow), but would cause an access violation
28968 under Windows-NT. The fix should correct the problem,
28969 but there may still be a problem using global variables of
28970 complex datatypes in conjunction with shadow classes. Fortunately,
28971 this sort of thing seems to be relatively rare (considering
28972 that the bug has been around for more than a year - yikes!).
28973
289744/11/97 : Fixed bizarre constant evaluation bug in Perl5 code generation
28975 when running under Windows-NT.
28976
289774/8/97 : Bug when using default arguments and C++ references fixed.
28978
289794/8/97 : Fixed code generation bugs in Python and Perl5 modules related to
28980 using class renaming (applying the %name directive to a class
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028981 definition) and shadow classes.
28982
Dave Beazleyc928c102000-01-12 03:01:06 +0000289834/7/97 : Fixed minor bugs in swigptr.swg, tcl8ptr.swg, and perl5ptr.swg to
28984 prevent infinite loops when weird datatypes are passed.
28985
289863/29/97 : 'Makefile.win' added. This is used to build most of the examples
28987 in the Examples directory under Windows NT/95.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000028988
Dave Beazleyc928c102000-01-12 03:01:06 +0000289893/27/97 : Fixes to SWIG's error return codes. SWIG now returns non-zero
28990 exit codes for certain kinds of errors (which makes it more
28991 friendly to makefiles). An overhaul of the error handling
28992 is on the to-do list and will probably show up in a later release.
28993
289943/25/97 : Bug fix. "freearg" and "argout" typemaps have been fixed in
28995 the Perl5 module. In previous versions, function input parameters
28996 and function output parameters shared the same memory space--causing
28997 all sorts of nasty problems when trying to pass perl values by
28998 reference. SWIG now internally makes a "copy" (which is really
28999 just a pointer) of affected parameters and uses that. This
29000 is done transparently so there is no noticable impact on any
29001 SWIG generated modules. This change is probably only noticable
29002 to expert users.
29003
290043/25/97 : Added type-check to verbose and stat mode. SWIG will now generate a list
29005 of all datatypes that were used but undefined (useful for tracking
29006 down weird bugs). This is enabled with the -v option (which
29007 is now officially known as "overly verbose" mode) or the -stat option.
29008
290093/25/97 : Slight change to the parser to make include guards work correctly.
29010 For example :
29011
29012 #ifndef INTERFACE_I
29013 #define INTERFACE_I
29014 %module foobar.i
29015 ... declarations ...
29016 #endif
29017
290183/24/97 : %checkout directive added. This allows an interface file to
29019 extract files from the SWIG library and place them in the
29020 current directory. This can be used to extract scripts and
29021 other helper code that might be associated with library files.
29022 For example :
29023
29024 %checkout array.tcl
29025
29026 Will look for a file "array.tcl" in the library and copy it
29027 to the current directory. If the file already exists in the
29028 directory, this directive does nothing (it will not overwrite an
29029 existing file). This only an experimental feature for now.
29030
290313/24/97 : SWIG will now look in the SWIG Library for a file if it can't
29032 find it in the current directory. As a result, it is easy to
29033 make modules from SWIG library files. For example, if you
29034 want to make a Python module from the SWIG timers library, just
29035 type this in any directory :
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029036
Dave Beazleyc928c102000-01-12 03:01:06 +000029037 swig -python timers.i
29038
29039 You will get the files timers_wrap.c and timers_wrap.doc in
29040 the current directory that you can now compile. The file
29041 remains in the SWIG library (although you can check it out
29042 using the -co option). *** New Feature ***
29043
290443/24/97 : -co option added to SWIG to allow easy access to the SWIG library.
29045 When used, this instructs SWIG to check out a library file and
29046 place it in the current directory. For example :
29047
29048 unix > swig -co array.i
29049 array.i checked out from the SWIG library
29050 unix >
29051
29052 Once in your directory you can customize the file to suit your
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029053 particular purposes. The checkout option makes it easy to
Dave Beazleyc928c102000-01-12 03:01:06 +000029054 grab library files without knowing anything about the SWIG
29055 installation, but it also makes it possible to start
29056 including scripts, C code, and other miscellaneous files
29057 in the library. For example, you could put a cool script
29058 in the library and check it out whenever you wanted to use it.
29059 *** New Feature ***
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029060
Dave Beazleyc928c102000-01-12 03:01:06 +0000290613/24/97 : #pragma export directives added to Tcl output for compiling
29062 shared libraries on the Mac.
29063
290643/24/97 : Minor changes to wish.i and tclsh.i library files to provide
29065 support for the Macintosh.
29066
290673/19/97 : SWIG's policy towards NULL pointers has been relaxed. The
29068 policy of requiring a special compiler directive -DALLOW_NULL
29069 to use NULL pointers is no longer supported. While this may
29070 seem "unsafe", it turns out that you can use a "check"
29071 typemap to achieve some safety. For example :
29072
29073 %typemap(perl5,check) Node * {
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029074 if (!$target)
Dave Beazleyc928c102000-01-12 03:01:06 +000029075 croak("NULL Pointers not allowed.");
29076 }
29077
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029078 This prevents any NULL value of a "Node *" pointer to be
Dave Beazleyc928c102000-01-12 03:01:06 +000029079 passed to a function. (I think this is much cleaner
29080 than the old -DALLOW_NULL hack anyways).
29081
290823/19/97 : Fixed pointer handling errors in Perl5 module. Modules no
29083 longer core dump when a Perl reference is inadvertently
29084 passed in as a C pointer.
29085
290863/18/97 : Added a "check" typemap. This can be used to check the
29087 validity of function input values. For example :
29088
29089 %typemap(perl5,check) int posint {
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029090 if ($target < 0)
Dave Beazleyc928c102000-01-12 03:01:06 +000029091 croak("Argument is not a positive integer");
29092 }
29093
290943/18/97 : Added an $arg variable to Tcl typemaps. This makes it easier
29095 to return argument values by "reference".
29096
290973/18/97 : Fixed a code generation bug when using C++ references and
29098 the %addmethods directive.
29099
291003/18/97 : Fixed a few glitches in the typemap module with respect to
29101 chaining. For example :
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029102
Dave Beazleyc928c102000-01-12 03:01:06 +000029103 %typemap(tcl,in) int {
29104 $in // Inserts prexisting typemap
29105 printf("Received a %d\n", $target);
29106 }
29107
29108 This has been allowed for quite some time, but didn't work
29109 if no existing typemap was defined. Now, it still doesn't
29110 work if no existing typemap is defined, but it issues a
29111 warning message. There is some support using default typemaps,
29112 but none of the language modules take advantage of it. This
29113 should be considered experimental at this time.
29114
29115Version 1.1b5 Patch 1 (March 16, 1997)
29116======================================
29117
291183/16/97 : Fixed references bug with C++ code generation.
29119
291203/16/97 : Fixed initialization bug in the documentation system that
29121 was causing weird problems.
29122
291233/16/97 : Fixed fatal bug with -c option in the Python module.
29124
291253/13/97 : Fixed bug in the documentation system involving the %text directive
29126 and sorting. In the old system, %text entries would float to the
29127 top of a section because they were "nameless". Now they are
29128 attached to the previous declaration and will stay in the proper
29129 location relative to the previous entry.
29130
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029131Version 1.1b5 (March 12, 1997)
Dave Beazleyc928c102000-01-12 03:01:06 +000029132==============================
29133
291343/11/97 : Fixed compilation problems introduced by Tcl/Tk 8.0a2.
29135 *** INCOMPATIBILITY *** SWIG no longer works with Tcl/Tk 8.0a1.
29136
291373/10/97 : Fixed bug with ignored arguments and C++ member functions in
29138 the Python module.
29139
291403/9/97 : Parsing bugs with nested class definitions and privately
29141 declared nested class definitions fixed.
29142
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000291433/9/97 : Fixed a few minor code generation bugs with C++ classes and
Dave Beazleyc928c102000-01-12 03:01:06 +000029144 constructors. In some cases, the resulting wrapper code
29145 would not compile properly. SWIG now attempts to use
29146 the default copy constructor instead.
29147
291483/8/97 : Added a -l option to SWIG that allows additional SWIG library files
29149 to be grabbed without having them specified in the interface file.
29150 This makes it easier to keep the interface file clean and move certain
29151 options into a Makefile. For example :
29152
29153 swig -tcl example.i # Build a normal Tcl extension
29154 swig -tcl -lwish.i example.i # Build it as a wish extension
29155 # by including the 'wish.i' file.
29156
29157 swig -python example.i # Build a dynamically loaded extension
29158 swig -python -lembed.i example.i # Build a static extension
29159
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029160 These kinds of options could previously be accomplished with
Dave Beazleyc928c102000-01-12 03:01:06 +000029161 conditional compilation such as :
29162
29163 %module example
29164 ...
29165 #ifdef STATIC
29166 %include embed.i
29167 #endif
29168
291693/8/97 : Incorporated changes to Guile module to use the new gh interface
29170 in FSF Guile 1.0. The older gscm interface used in Cygnus
29171 Guile releases is no longer supported by SWIG.
29172
291733/8/97 : Cleaned up the Tcl Netscape plugin example. It should work with
29174 version 1.1 of the plugin now.
29175
291763/8/97 : Added better array support to the typemap module. The keyword
29177 ANY can now be used to match any array dimension. For example :
29178
29179 %typemap(tcl,in) double [ANY] {
29180 ... get an array ...
29181 }
29182
29183 This will match any single-dimensional double array. The array
29184 dimension is passed in the variables $dim0, $dim1, ... $dim9. For
29185 example :
29186
29187 %typemap(tcl,in) double [ANY][ANY][ANY] {
29188 printf("Received a double[%d][%d][%d]\n",$dim0,$dim1,$dim2);
29189 }
29190
29191 Any typemap involving a specific array dimension will override any
29192 specified with the ANY tag. Thus, a %typemap(tcl,in) double [5][4][ANY] {}
29193 would override a double [ANY][ANY][ANY]. However, overuse of the ANY
29194 tag in arrays of high-dimensions may not work as you expect due to
29195 the pattern matching rule used. For example, which of the following
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029196 typemaps has precedence?
Dave Beazleyc928c102000-01-12 03:01:06 +000029197
29198 %typemap(in) double [ANY][5] {} // Avoid this!
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029199 %typemap(in) double [5][ANY] {}
Dave Beazleyc928c102000-01-12 03:01:06 +000029200
292013/7/97 : Fixed a number of bugs related to multi-dimensional array handling.
29202 Typedefs involving multi-dimensional arrays now works correctly.
29203 For example :
29204
29205 typedef double MATRIX[4][4];
29206
29207 ...
29208 extern double foo(MATRIX a);
29209
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029210 Typecasting of pointers into multi-dimensional arrays is now
Dave Beazleyc928c102000-01-12 03:01:06 +000029211 implemented properly when making C/C++ function calls.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029212
Dave Beazleyc928c102000-01-12 03:01:06 +0000292133/6/97 : Fixed potentially dangerous bug in the Tcl Object-oriented
29214 interface. Well, actually, didn't fix it but issued a
29215 Tcl error instead. The bug would manifest itself as follows:
29216
29217 % set l [List] # Create an object
29218 ...
29219 % set m [List -this $l] # Make $m into an object assuming $l
29220 # contains a pointer.
29221 # Since $m == $l, $l gets destroyed
29222 # (since its the same command name)
29223 % $m insert Foo
29224 Segmentation fault # Note : the list no longer exists!
29225
29226 Now, an error will be generated instead of redefining the command.
29227 As in :
29228
29229 % set l [List]
29230 ...
29231 % set m [List -this $l]
29232 Object name already exists!
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029233
Dave Beazleyc928c102000-01-12 03:01:06 +000029234 Use catch{} to ignore the error.
29235
292363/3/97 : Better support for enums added. Datatypes of 'enum MyEnum'
29237 and typedefs such as 'typedef enum MyEnum Foo;' now work.
29238
292393/3/97 : Parser modified to ignore constructor initializers such as :
29240
29241 class Foo : public Bar {
29242 int a,b;
29243 public:
29244 Foo(int i) : a(0), b(i), Bar(i,0) { };
29245 };
29246
292473/3/97 : Modified parser to ignore C++ exception specifications such as :
29248
29249 int foo(double) throw(X,Y);
29250
292513/3/97 : Added %import directive. This works exactly like %extern
29252 except it tells the language module that the declarations are
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029253 coming from a separate module. This is usually only
Dave Beazleyc928c102000-01-12 03:01:06 +000029254 needed when working with shadow classes.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029255
Dave Beazleyc928c102000-01-12 03:01:06 +0000292563/2/97 : Changed pointer type-checker to be significantly more
29257 efficient when working with derived datatypes. This
29258 has been accomplished by storing type-mappings in sorted
29259 order, using binary search schemes, and caching recently
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029260 used datatypes. For SWIG generated C++ modules that
Dave Beazleyc928c102000-01-12 03:01:06 +000029261 make a large number of C function calls with derived types,
29262 this could result in speedups of between 100 and 50000 percent.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029263 However, due to the required sorting operation, module
Dave Beazleyc928c102000-01-12 03:01:06 +000029264 loading time may increased slightly when there are lots of
29265 datatypes.
29266
292673/2/97 : Fixed some C++ compilation problems with Python
29268 embed.i library files.
29269
292702/27/97 : Slight change to C++ code generation to use copy constructors
29271 when returning complex data type by value.
29272
292732/26/97 : Fixed bug in Python module with -c option.
29274
292752/26/97 : Slight tweak of parser to allow trailing comma in enumerations
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029276 such as
29277
Dave Beazleyc928c102000-01-12 03:01:06 +000029278 enum Value (ALE, STOUT, LAGER, };
29279
292802/25/97 : Fixed code generation bug in Tcl module when using the
29281 %name() directive on a classname.
29282
292832/25/97 : Finished code-size optimization of C++ code generation with
29284 inheritance of attributes. Inherited attributes now
29285 only generate one set of wrapper functions that are re-used
29286 in any derived classes. This could provide big code
29287 size improvements in some scripting language interfaces.
29288
292892/25/97 : Perl5 module modified to support both the Unix and Windows
29290 versions. The windows version has been tested with the
29291 Activeware port of Perl 5.003 running under Windows 95.
29292 The C source generated by SWIG should compile without
29293 modification under both versions of Perl, but is now
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029294 even more hideous than before.
Dave Beazleyc928c102000-01-12 03:01:06 +000029295
292962/25/97 : Modified parser to allow scope resolution operation to
29297 appear in expressions and default arguments as in :
29298
29299 void foo(int a = Bar::defvalue);
29300
293012/25/97 : Fixed bug when resolving symbols inside C++ classes.
29302 For example :
29303
29304 class Foo {
29305 public:
29306 enum Value {ALE, STOUT, LAGER};
29307 ...
29308 void defarg(Value v = STOUT);
29309
29310 };
29311
293122/24/97 : Fixed bug with member functions returning void *.
29313
293142/23/97 : Modified Python module to be better behaved under Windows
29315
29316 - Module initialization function is now properly exported.
Olly Bettsf9106072016-01-12 13:37:39 +130029317 It should not be necessary to explicitly export this function
Dave Beazleyc928c102000-01-12 03:01:06 +000029318 yourself.
29319
29320 - Bizarre compilation problems when compiling the SWIG wrapper
29321 code as ANSI C under Visual C++ 4.x fixed.
29322
29323 - Tested with both the stock Python-1.4 distribution and Pythonwin
29324 running under Win95.
29325
293262/19/97 : Fixed typedef handling bug in Perl5 shadow classes.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029327
Dave Beazleyc928c102000-01-12 03:01:06 +0000293282/19/97 : Added exception support. To use it, do the following :
29329
29330 %except(lang) {
29331 ... try part of the exception ...
29332 $function
29333 ... catch part of exception ...
29334 }
29335
29336 $function is a SWIG variable that will be replaced by the
29337 actual C/C++ function call in a wrapper function. Thus,
29338 a real exception specification might look like this :
29339
29340 %except(perl5) {
29341 try {
29342 $function
29343 } catch (char *& sz) {
29344 ... process an exception ...
29345 } catch(...) {
29346 croak("Unknown exception. Bailing out...");
29347 }
29348 }
29349
293502/19/97 : Added support for managing generic code fragments (needed
29351 for exceptions).
29352
293532/19/97 : Fixed some really obscure typemap scoping bugs in the C++
29354 handler.
29355
293562/18/97 : Cleaned up perlmain.i file by removing some problematic,
29357 but seemingly unnecessary declarations.
29358
293592/18/97 : Optimized handling of member functions under inheritance.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029360 SWIG can now use wrapper functions generated for a
29361 base class instead of regenerating wrappers for
Dave Beazleyc928c102000-01-12 03:01:06 +000029362 the same functions in a derived class. This could
29363 make a drastic reduction in wrapper code size for C++
29364 applications with deep inheritance hierarchies and
29365 lots of functions.
29366
293672/18/97 : Additional methods specified with %addmethods can now
29368 be inherited along with normal C++ member functions.
29369
293702/18/97 : Minor internal fixes to make SWIG's string handling a little
29371 safer.
29372
293732/16/97 : Moved some code generation of Tcl shadow classes to
29374 library files.
29375
293762/16/97 : Fixed documentation error of '-configure' method in
29377 Tcl modules.
29378
293792/16/97 : Modified Perl5 module slightly to allow typemaps
29380 to use Perl references.
29381
293822/12/97 : Fixed argument checking bug that was introduced by
29383 default arguments (function calls with too many
29384 arguments would still be executed). Functions now
29385 must have the same number of arguments as C version
29386 (with possibility of default/optional arguments
29387 still supported).
29388
293892/12/97 : Fixed default argument bug in Perl5 module when
29390 generating wrapper functions involving default
29391 arguments of complex datatypes.
29392
293932/12/97 : Fixed typemap scoping problems. For example :
29394
29395 %typemap(tcl,in) double {
29396 .. get a double ..
29397 }
29398
29399 class Foo {
29400 public:
29401 double bar(double);
29402 }
29403
29404 %typemap(tcl,in) double {
29405 .. new get double ..
29406 }
29407
29408 Would apply the second typemap to all functions in Foo
29409 due to delayed generation of C++ wrapper code (clearly this
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029410 is not the desired effect). Problem has been fixed by
Dave Beazleyc928c102000-01-12 03:01:06 +000029411 assigning unique numerical identifiers to every datatype in
29412 an interface file and recording the "range of effect" of each
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029413 typemap.
Dave Beazleyc928c102000-01-12 03:01:06 +000029414
294152/11/97 : Added support for "ignore" and "default" typemaps. Only use
29416 if you absolutely know what you're doing.
29417
294182/9/97 : Added automatic creation of constructors and destructors for
29419 C structs and C++ classes that do not specify any sort of
29420 constructor or destructor. This feature can be enabled by
29421 running SWIG with the '-make_default' option or by inserting
29422 the following pragma into an interface file :
29423
29424 %pragma make_default
29425
29426 The following pragma disables automatic constructor generation
29427
29428 %pragma no_default
29429
294302/9/97 : Added -make_default option for producing default constructors
29431 and destructors for classes without them.
29432
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000294332/9/97 : Changed the syntax of the SWIG %pragma directive to
Dave Beazleyc928c102000-01-12 03:01:06 +000029434 %pragma option=value or %pragma(lang) option=value.
29435 This change makes the syntax a little more consistent
29436 between general pragmas and language-specific pragmas.
29437 The old syntax still works, but will probably be phased
29438 out (a warning message is currently printed).
29439
294402/9/97 : Improved Tcl support of global variables that are of
29441 structures, classes, and unions.
29442
294432/9/97 : Fixed C++ compilation problem in Python 'embed.i' library file.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029444
Dave Beazleyc928c102000-01-12 03:01:06 +0000294452/9/97 : Fixed missing return value in perlmain.i library file.
29446
294472/9/97 : Fixed Python shadow classes to return an AttributeError when
29448 undefined attributes are accessed (older versions returned
29449 a NameError).
29450
294512/9/97 : Fixed bug when %addmethods is used after a class definition whose
29452 last section is protected or private.
29453
294542/8/97 : Made slight changes in include file processing to support
29455 the Macintosh.
29456
294572/8/97 : Extended swigmain.cxx to provide a rudimentary Macintosh interface.
29458 It's a really bad interface, but works until something better
29459 is written.
29460
294611/29/97 : Fixed type-casting bug introduced by 1.1b4 when setting/getting the
29462 value of global variables involving complex data types.
29463
294641/29/97 : Removed erroneous white space before an #endif in the code generated
29465 by the Python module (was causing errors on DEC Alpha compilers).
29466
294671/26/97 : Fixed errors when using default/optional arguments in Python shadow
29468 shadow classes.
29469
294701/23/97 : Fixed bug with nested %extern declarations.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029471
Dave Beazleyc928c102000-01-12 03:01:06 +0000294721/21/97 : Fixed problem with typedef involving const datatypes.
29473
294741/21/97 : Somewhat obscure, but serious bug with having multiple levels
29475 of typedefs fixed. For example :
29476
29477 typedef char *String;
29478 typedef String Name;
29479
29480Version 1.1 Beta4 (January 16, 1997)
29481====================================
29482
29483Note : SWIG 1.1b3 crashed and burned shortly after take off due
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029484to a few major run-time problems that surfaced after release.
Dave Beazleyc928c102000-01-12 03:01:06 +000029485This release should fix most, if not all, of those problems.
29486
294871/16/97 : Fixed major memory management bug on Linux
29488
294891/14/97 : Fixed bug in functions returning constant C++ references.
29490
294911/14/97 : Modified C++ module to handle datatypes better.
29492
294931/14/97 : Modified parser to allow a *single* scope resolution
29494 operator in datatypes. Ie : Foo::bar. SWIG doesn't
29495 yet handle nested classes, so this should be
29496 sufficient for now.
29497
294981/14/97 : Modified parser to allow typedef inside a C++ class.
29499
295001/14/97 : Fixed some problems related to datatypes defined inside
29501 a C++ class. SWIG was not generating correct code,
29502 but a new scoping mechanism and method for handling
29503 datatypes inside a C++ class have been added.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029504
Dave Beazleyc928c102000-01-12 03:01:06 +0000295051/14/97 : Changed enumerations to use the value name instead
29506 of any values that might have appeared in the interface
29507 file. This makes the code a little more friendly to
29508 C++ compilers.
29509
295101/14/97 : Removed typedef bug that made all enumerations
29511 equivalent to each other in the type checker (since
29512 it generated alot of unnecessary code).
29513
29514Version 1.1 Beta3 (January 9, 1997)
Olly Bettsfdcea432009-02-26 05:53:37 +000029515===================================
Dave Beazleyc928c102000-01-12 03:01:06 +000029516
29517Note : A *huge* number of changes related to ongoing modifications.
29518
295191. Support for C++ multiple inheritance added.
29520
295212. Typemaps added.
29522
295233. Some support for nested structure definitions added.
29524
295254. Default argument handling added.
29526
295275. -c option added for building bare wrapper code modules.
29528
295296. Rewrote Pointer type-checking to support multiple inheritance
29530 correctly.
29531
295327. Tcl 8.0 module added.
29533
295348. Perl4 and Guile modules resurrected from the dead (well, they
29535 at least work again).
29536
295379. New Object Oriented Tcl interface added.
29538
2953910. Bug fixes to Perl5 shadow classes.
29540
2954111. Cleaned up many of the internal modules of the parser.
29542
2954312. Tons of examples and testing modules added.
29544
2954513. Fixed bugs related to use of "const" return values.
29546
2954714. Fixed bug with C++ member functions returning void *.
29548
2954915. Changed SWIG configuration script.
29550
29551Version 1.1 Beta2 (December 3, 1996)
29552====================================
29553
295541. Completely rewrote the SWIG documentation system. The changes
29555 involved are too numerous to mention. Basically, take everything
29556 you knew about the old system, throw them out, and read the
29557 file Doc/doc.ps.
29558
295592. Limited support for #if defined() added.
29560
295613. Type casts are now allowed in constant expressions. ie
29562
29563 #define A (int) 3
29564
295654. Added support for typedef lists. For example :
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029566
Dave Beazleyc928c102000-01-12 03:01:06 +000029567 typedef struct {
29568 double x,y,z;
29569 } Vector, *VectorPtr;
29570
295715. New SWIG directives (related to documentation system)
29572
29573 %style
29574 %localstyle
29575 %subsection
29576 %subsubsection
29577
295786. Reorganized the C++ handling and made it a little easier to
29579 work with internally.
29580
295817. Fixed problem with inheriting data members in Python
29582 shadow classes.
29583
295848. Fixed symbol table problems with shadow classes in both
29585 Python and Perl.
29586
295879. Fixed annoying segmentation fault bug in wrapper code
29588 generated for Perl5.
29589
2959010. Fixed bug with %addmethods directive. Now it can be placed
29591 anywhere in a class.
29592
2959311. More test cases added to the SWIG self-test. Documentation
29594 tests are now performed along with other things.
29595
2959612. Reorganized the SWIG library a little bit and set it up to
29597 self-document itself using SWIG.
29598
2959913. Lots and lots of minor bug fixes (mostly obscure, but bugs
29600 nonetheless).
29601
29602
29603Version 1.1 Beta1 (October 30, 1996)
29604====================================
29605
296061. Added new %extern directive for handling multiple files
29607
296082. Perl5 shadow classes added
29609
296103. Rewrote conditional compilation to work better
29611
296124. Added 'bool' datatype
29613
296145. %{,%} block is now optional.
29615
296166. Fixed some bugs in the Python shadow class module
29617
296187. Rewrote all of the SWIG tests to be more informative
29619 (and less scary).
29620
296218. Rewrote parameter list handling to be more memory
29622 efficient and flexible.
29623
296249. Changed parser to ignore 'static' declarations.
29625
2962610. Initializers are now ignored. For example :
29627
29628 struct FooBar a = {3,4,5};
29629
2963011. Somewhat better parsing of arrays (although it's
29631 usually just a better error message now).
29632
2963312. Lot's of minor bug fixes.
29634
29635
29636Version 1.0 Final (August 31, 1996)
29637===================================
Olly Bettsfdcea432009-02-26 05:53:37 +000029638
Dave Beazleyc928c102000-01-12 03:01:06 +0000296391. Fixed minor bug in C++ module
29640
296412. Fixed minor bug in pointer type-checker when using
29642 -DALLOW_NULL.
29643
296443. Fixed configure script to work with Python 1.4beta3
29645
296464. Changed configure script to allow compilation without
29647 yacc or bison.
29648
29649Version 1.0 Final (August 28, 1996)
29650===================================
29651
296521. Changed parser to support more C/C++ datatypes (well,
29653 more variants). Types like "unsigned", "short int",
29654 "long int", etc... now work.
29655
296562. "unions" added to parser.
29657
296583. Use of "typedef" as in :
29659
29660 typedef struct {
29661 double x,y,z;
29662 } Vector;
29663
29664 Now works correctly. The name of the typedef is used as
29665 the structure name.
29666
296674. Conditional compilation with #ifdef, #else, #endif, etc...
29668 added.
29669
296705. New %disabledoc, %enabledoc directives allow documentation
29671 to selectively be disabled for certain parts of a wrapper
29672 file.
29673
296746. New Python module supports better variable linking, constants,
29675 and shadow classes.
29676
296777. Perl5 module improved with better compatibility with XS
29678 and xsubpp. SWIG pointers and now created so that they
29679 are compatible with xsubpp pointers.
29680
296818. Support for [incr Tcl] namespaces added to Tcl module.
29682
296839. %pragma directive added.
29684
2968510. %addmethods directive added.
29686
2968711. %native directive added to allow pre-existing wrapper functions
29688 to be used.
29689
2969012. Wrote configure script for SWIG installation.
29691
2969213. Function pointers now allowed with typedef statements.
29693
2969414. %typedef modified to insert a corresponding C typedef into
29695 the output file.
29696
2969715. Fixed some problems related to C++ references.
29698
2969916. New String and WrapperFunction classes add to make generating
29700 wrapper code easier.
29701
2970217. Fixed command line option processing to eliminate core dumps
29703 and to allow help messages.
29704
2970518. Lot's of minor bug fixes to almost all code modules
29706
29707
29708Version 1.0 Beta 3 (Patch 1) July 17, 1996
29709==========================================
29710
297111.0 Final is not quite ready yet, but this release fixes a
29712number of immediate problems :
29713
297141. Compiler errors when using -strict 1 type checking have been fixed.
29715
297162. Pointer type checker now recognizes pointers of the form
29717 _0_Type correctly.
29718
297193. A few minor fixes were made in the Makefile
29720
29721Version 1.0 Beta 3 (June 14, 1996)
Olly Bettsfdcea432009-02-26 05:53:37 +000029722==================================
Dave Beazleyc928c102000-01-12 03:01:06 +000029723
29724
29725There are lots of changes in this release :
29726
297271. SWIG is now invoked using the "swig" command instead of "wrap".
29728 Hey, swig sounds cooler.
29729
297302. The SWIG_LIB environment variable can be set to change the
29731 location where SWIG looks for library files.
29732
297333. C++ support has been added. You should use the -c++ option
29734 to enable it.
29735
297364. The %init directive has been replaced by the %module directive.
29737 %module constructs a valid name for the initialization function
29738 for whatever target language you're using (actually this makes
29739 SWIG files a little cleaner). The old %init directive still works.
29740
297415. The syntax of the %name directive has been changed. Use of the
29742 old one should generate a warning message, but may still work.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029743
Dave Beazleyc928c102000-01-12 03:01:06 +0000297446. To support Tcl/Tk on non-unix platforms, SWIG imports a file called
29745 swigtcl.cfg from the $(SWIG_LIB)/tcl directory. I don't have access
29746 to an NT machine, but this file is supposedly allows SWIG to
29747 produce wrapper code that compiles on both UNIX and non UNIX machines.
29748 If this doesn't work, you'll have to edit the file swigtcl.cfg. Please
29749 let me know if this doesn't work so I can update the file as
29750 necessary.
29751
297527. The SWIG run-time typechecker has been improved. You can also
29753 now redefine how it works by supplying a file called "swigptr.cfg"
29754 in the same directory as your SWIG interface files. By default,
29755 SWIG reads this file from $(SWIG_LIB)/config.
29756
297578. The documentation system has been changed to support the following :
29758
29759 - Documentation order is printed in interface file order by
29760 default. This can be overridden by putting an %alpha
29761 directive in the beginning of the interface file.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029762
Dave Beazleyc928c102000-01-12 03:01:06 +000029763 - You can supply additional documentation text using
29764
29765 %text %{ put your text here %}
29766
29767 - A few minor bugs were fixed.
29768
297699. A few improvements have been made to the handling of command line
29770 options (but it's still not finished).
29771
2977210. Lots of minor bug fixes in most of the language modules have been
29773 made.
29774
2977511. Filenames have been changed to 8.3 for compatibility with a SWIG
29776 port to non-unix platforms (work in progress).
29777
2977812. C++ file suffix is now .cxx (for same reason).
29779
2978013. The documentation has been upgraded significantly and is now
29781 around 100 pages. I added new examples and a section on
29782 C++. The documentation now includes a Table of Contents.
29783
2978414. The SWIG Examples directory is still woefully sparse, but is
29785 getting better.
29786
29787Special notice about C++
29788------------------------
29789This is the first version of SWIG to support C++ parsing. Currently
29790the C++ is far from complete, but seems to work for simple cases.
29791No work has been done to add special C++ processing to any of
29792the target languages. See the user manual for details about how
29793C++ is handled. If you find problems with the C++ implementation,
29794please let me know. Expect major improvements in this area.
29795
29796Note : I have only successfully used SWIG and C++ with Tcl and
29797Python.
29798
29799Notice about Version 1.0Final
29800-----------------------------
29801
29802Version 1.0B3 is the last Beta release before version 1.0 Final is
29803released. I have frozen the list of features supported in version 1.0
29804and will only fix bugs as they show up. Work on SWIG version 2.0 is
29805already in progress, but is going to result in rather significant
29806changes to SWIG's internal structure (hopefully for the better). No
29807anticipated date for version 2.0 is set, but if you've got an idea,
29808let me know.
29809
29810Version 1.0 Beta 2 (April 26, 1996)
29811===================================
Olly Bettsfdcea432009-02-26 05:53:37 +000029812
Dave Beazleyc928c102000-01-12 03:01:06 +000029813This release is identical to Beta1 except a few minor bugs are
29814fixed and the SWIG library has been updated to work with Tcl 7.5/Tk 4.1.
29815A tcl7.5 examples directory is now included.
29816
29817- Fixed a bug in the Makefile that didn't install the libraries
29818 correctly.
29819
29820- SWIG Library files are now updated to work with Tcl 7.5 and Tk 4.1.
29821
29822- Minor bug fixes in other modules.
29823
29824
29825Version 1.0 Beta 1 (April 10, 1996).
29826=====================================
Olly Bettsfdcea432009-02-26 05:53:37 +000029827
Dave Beazleyc928c102000-01-12 03:01:06 +000029828This is the first "semi-official" release of SWIG. It has a
29829number of substantial improvements over the Alpha release. These
29830notes are in no particular order--hope I remembered everything....
29831
298321. Tcl/Tk
29833
29834SWIG is known to work with Tcl7.3, Tk3.6 and later versions.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029835I've also tested SWIG with expect-5.19.
Dave Beazleyc928c102000-01-12 03:01:06 +000029836
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029837Normally SWIG expects to use the header files "tcl.h" and "tk.h".
Dave Beazleyc928c102000-01-12 03:01:06 +000029838Newer versions of Tcl/Tk use version numbers. You can specify these
29839in SWIG as follows :
29840
29841 % wrap -htcl tcl7.4.h -htk tk4.0.h example.i
29842
29843Of course, I prefer to simply set up symbolic links between "tcl.h" and
29844the most recent stable version on the machine.
29845
298462. Perl4
29847
29848This implementation has been based on Perl-4.035. SWIG's interface to
29849Perl4 is based on the documentation provided in the "Programming Perl"
29850book by Larry Wall, and files located in the "usub" directory of the
29851Perl4 distribution.
29852
29853In order to compile with Perl4, you'll need to link with the uperl.o
29854file found in the Perl4 source directory. You may want to move this
29855file to a more convenient location.
29856
298573. Perl5
29858
29859This is a somewhat experimental implementation, but is alot less
29860buggy than the alpha release. SWIG operates independently of
29861the XS language and xsubpp supplied with Perl5. Currently SWIG
29862produces the necessary C code and .pm file needed to dynamically
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029863load a module into Perl5.
Dave Beazleyc928c102000-01-12 03:01:06 +000029864
29865To support Perl5's notion of modules and packages (as with xsubpp),
29866you can use the following command line options :
29867
29868 % wrap -perl5 -module MyModule -package MyPackage example.i
29869
29870Note : In order for dynamic loading to be effective, you need to be
29871careful about naming. For a module named "MyModule", you'll need to
29872create a shared object file called "MyModule.so" using something like
29873
29874 % ld -shared my_obj.o -o MyModule.so
29875
29876The use of the %init directive must match the module name since Perl5
29877calls a function "boot_ModuleName" in order to initialize things.
29878See the Examples directory for some examples of how to get things
29879to work.
29880
298814. Python1.3
29882
29883This is the first release supporting Python. The Python port is
29884experimental and may be rewritten. Variable linkage is done through
29885functions which is sort of a kludge. I also think it would be nice
29886to import SWIG pointers into Python as a new object (instead of strings).
29887Of course, this needs a little more work.
29888
298895. Guile3
29890
29891If you really want to live on the edge, pick up a copy of Guile-iii and
29892play around with this. This is highly experimental---especially since
29893I'm not sure what the official state of Guile is these days. This
29894implementation may change at any time should I suddenly figure out better
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029895ways to do things.
Dave Beazleyc928c102000-01-12 03:01:06 +000029896
298976. Extending SWIG
29898
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029899SWIG is written in C++ although I tend to think of the code as mostly
Dave Beazleyc928c102000-01-12 03:01:06 +000029900being ANSI C with a little inheritance thrown in. Each target language
29901is implemented as a C++ class that can be plugged into the system.
29902If you want to add your own modifications, see Appendix C of the user
29903manual. Then take a look at the "user" directory which contains some
29904code for building your own extenions.
29905
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +0000299067. The SWIG library
Dave Beazleyc928c102000-01-12 03:01:06 +000029907
29908The SWIG library is still incomplete. Some of the files mentioned in
29909the user manual are unavailable. These files will be made available
29910when they are ready. Subscribe to the SWIG mailing list for announcements
29911and updates.
29912
299138. SWIG Documentation
29914
29915I have sometimes experienced problems viewing the SWIG documentation in
29916some postscript viewers. However, the documentation seems to print
29917normally. I'm working on making much of the documentation online,
29918but this takes time.
29919
29920Version 0.1 Alpha (February 9, 1996)
29921====================================
29922
299231. Run-time type-checking of SWIG pointers. Pointers are now represented
29924 as strings with both numeric and encoded type information. This makes
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029925 it a little harder to shoot yourself in the foot (and it eliminates
Dave Beazleyc928c102000-01-12 03:01:06 +000029926 some segmentation faults and other oddities).
29927
299282. Python 1.3 now supported.
29929
299303. #define and enum can be used to install constants.
29931
299324. Completely rewrote the %include directive and made it alot more powerful.
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029933
Dave Beazleyc928c102000-01-12 03:01:06 +0000299345. Restructured the SWIG library to make it work better.
29935
299366. Various bug fixes to Tcl, Perl4, Perl5, and Guile implementations.
29937
299387. Better implementation of %typedef directive.
29939
299408. Made some changes to SWIG's class structure to make it easier to expand.
29941 SWIG is now built into a library file that you can use to make your
Thien-Thi Nguyenbb543242000-02-24 18:47:11 +000029942 own extenions.
Dave Beazleyc928c102000-01-12 03:01:06 +000029943
299449. Made extensive changes to the documentation.
29945
2994610. Minor changes to the SWIG parser to make it use less memory.
29947 Also took out some extraneous rules that were undocumented and
29948 didn't work in the first place.
29949
2995011. The SWIG library files "tclsh", "wish", "expect", etc... in the first
29951 release have been restructured and renamed to "tclsh.i", "wish.i",
29952 and so on.
OSZAR »