1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
|
Version 1.3.18 (In progress)
============================
03/21/2003: beazley
Fixed two problems with the %extend directive, overloading, and
template expansion. See the 'template_extend_overload' and
'template_extend_overload_2' tests in Examples/test-suite for
details.
03/20/2003: cheetah (William Fulton)
[C#] Added some typemaps as suggested by Andreas Schoerk for handling
parameters that are passed as pointers or by reference. These have
been put in typemaps.i.
03/20/2003: beazley
Fixed a C++ scoping bug related to code like this:
class Foo {
public:
int Foo::bar();
};
Previously, SWIG just tossed out the Foo::bar() declaration. Now,
the declaration is wrapped provided that the prefix is exactly the
same as the current scope (including any enclosing namespaces).
Reported by Bruce Lowery.
03/20/2003: beazley
Incorporated [ 696516 ] Enabling exception processing for data member access.
In some compilers, attribute access can generate exceptions. However,
SWIG ordinarily assumes that no exceptions will be raised. To disable this,
use the %feature("allowexcept"). For example:
%feature("allowexcept") Foo::x;
...
class Foo {
public:
int x; /* Exception handling enabled */
...
};
Patch contributed by Yakov Markovitch.
03/20/2003: beazley
Incorporated Patch. [ 701860 ] Improve Performance (python proxies).
Gives a performance boost to proxy class code and the management of the
.this and .thisown attributes. Contributed by Mike Romberg.
03/19/2003: cheetah (William Fulton)
[C# and Java] Added missing vararg support.
03/18/2003: mrose (Mark Rose)
Removed code related to tagging individual methods for directors.
The concept of having directors for some but not all virtual methods
of a class is deeply flawed. The %feature("nodirector") tag is also
gone.
Directors are off by default. To enable them for a class, issue
%feature("director") classname; which will create director methods
for every virtual method in the hierarchy of the class.
03/17/2003: beazley
Fixed a subtle problem with passing arguments of type function. For
example:
int foo(int x(int, int));
or
typedef int binop_t(int, int);
int foo(binop_t x);
In old versions, this would produce code that wouldn't compile. Now,
SWIG merely adds an extra pointer, making these declarations the same
as:
int foo(int (*x)(int, int));
typedef int binop_t(int, int);
int foo(binop_t *x);
Reported by Garth Bushell.
03/17/2003: mrose (Mark Rose)
Fixed the return statement for director base class calls that have no
return value.
03/15/2003: beazley
Fixed a problem with const smart-pointer wrapping. For example:
class Foo {
public:
int x;
void bar() const;
void spam();
};
class Blah {
...
const Foo *operator->();
...
};
In this case, only "x" and "bar" are visible from Blah (since application
of spam violates constness). Moreover, access to "x" is read-only.
03/15/2003: mrose (Mark Rose)
Cleaned up two signed versus unsigned comparisons in python/std_vector.i.
03/15/2003: cheetah (William Fulton)
[C#] Global variables are wrapped using properties instead of get and set methods.
Member variable wrapping bug fixes, for example wrapping pointers work now.
Typemaps are used for all variable wrapping to generate the property code.
03/13/2003: mrose (Mark Rose)
Fixed a bug in the virtual method unrolling for directors.
The order of unrolling is now from base to derived, to ensure
that the most derived implementation of a director method is
found.
Director methods for pure virtual methods now throw
DIRECTOR_PURE_VIRTUAL_EXCEPTION if _up is set.
03/12/2003: cheetah (William Fulton)
[C#] Polymorphism fix: virtual functions now use the appropriate
keyword in the C# proxy class, virtual or override.
Some 'using System;' statement fixes needed by the Mono compiler.
03/11/2003: beazley
Fixed subtle bug in the application of SwigValueWrapper<> to
template classes with default constructors. Reported by
Bruce Lowery.
03/11/2003: beazley
The $descriptor(type) variable is now expanded in code supplied to
%extend. This is useful for certain kinds of advanced wrapping
(especially container classes).
03/11/2003: luigi
Support for std::map.
(a) Integration with scripting language (a la std::vector) for
Python, Ruby, MzScheme, and Guile;
(b) Simple wrapper for other languages
03/10/2003: beazley
Fixed problem with escape sequences in string and character constants. SWIG
wasn't parsing certain octal codes correctly.
03/07/2003: beazley
Fixed a variety of subtle preprocessor problems reported by
Sebastien Recio.
(a) Empty preprocessor values no longer generate "bad constant
value" errors. For example:
#define FOO
#define FOO BAR
(b) Macro names can now span multiple lines (technically valid,
although questionable practice). For example:
#define A_LONG_MACRO_\
NAME 42
(c) Whitespace is no longer required before certain macro values.
For example:
#define FOO"Hello"
#define BAR\
"Hello"
03/07/2003: ljohnson (Lyle Johnson)
[Ruby] Added missing long long and unsigned long long typemaps
in the Lib/ruby/typemaps.i library file.
03/07/2003: mrose (Mark Rose)
Added Examples/python/callback to demostrate how directors can
be used to implement callbacks in Python
Added Examples/python/extend to demonstrate virtual method
calls from C++ to Python (really the same as the callback
example, just a different context).
Added four tests for very basic director functionality. These
have runtime tests under python.
The Python module now emits #define SWIG_DIRECTORS near the
top of the output file if directors are enabled. This is useful
for disabling parts of tests in target languages that don't
support directors.
03/06/2003: mrose (Mark Rose)
Added a section to Doc/Manual/Python.html on cross language
polymorphism (directors).
03/06/2003: mrose (Mark Rose)
The short-lived "-fdirectors" command line option has been
removed. To enable directors, instead use the extended %module
directive as follows:
%module(directors="1") modulename
03/06/2003: cheetah (William Fulton)
The long long typemaps have been rewritten so that they can be more
easily used with non ISO compilers, like Visual C++. For example
if you are wrapping the Windows 64 bit type __int64 the long long
typemaps can be used with %apply:
%apply long long { __int64 };
__int64 value1(__int64 x);
__int64 will now appear in the generated code instead of long long.
03/06/2003: beazley
*** DEVELOPER CHANGE ***
Swig module mutation has been changed slightly. When a language
class method wants to save node attributes, it now uses one of the
following functions:
Swig_require()
Swig_save()
The first argument to these functions is a namespace in which
saved attributes are placed. For example,this code
Node *n;
Swig_save("cDeclaration",n,"type","parms","name",NIL);
saves the attributes as "cDeclaration:type", "cDeclaration:parms",
and so forth. If necessary, a language module can refer to
old values by using this special namespace qualifier.
In addition to this, a special attribute "view" contains the name
of the last namespace used to save attributes. In the above
example, "view" would have the value "cDeclaration". The value
of "cDeclaration:view" would have the previous view and so forth.
Swig_restore(n) restores a node to the state before the last
Swig_require() or Swig_save() call.
Note: This change makes it easier for language modules to refer
to old values of attributes.
03/06/2003: mrose (Mark Rose)
Merged the cross-language polymorphism patch. When enabled, C++
"proxy" classes (called directors) are generated for each specified
C++ class. Directors pass method calls from C++ to Python, similar
to the way the usual proxy (shadow) classes pass method calls from
Python to C++. Together, these two types of proxies allow C++
classes that are extended in Python to behave just like ordinary
C++ classes and be used in C++ like native objects.
This feature is still very experimental and is disabled by default.
To enable director support, specify '-fdirectors' on the SWIG command
line or in the SWIG_FEATURES environment variable. In the interface
file, add %feature("director") to generate directors for all classes
that have virtual methods.
See http://stm.lbl.gov/~tm2/swig/ProxyDoc.html for more details.
03/03/2003: beazley
Fixed a small glitch in typemap local variable replacement. If you had
a typemap like this:
%typemap(in) type ($1_type temp) {
...
temp = ...;
...
}
and no occurrence of "$1_type" appeared in the body, then the local
variable type wouldn't be substituted.
03/03/2003: cheetah (William Fulton)
[C#] New version of the CSharp module which is typemap based.
It also uses ECMA C# and no longer uses Microsoft Visual C++.NET
glue. This means that it will work on non-Windows platforms.
Contributed by Neil Cawse.
02/27/2003: beazley
Fixed [ 653548 ] error parsing casting operator definition.
SWIG now ignores casting operators declared outside of a class.
For example:
inline A::operator char *() { ... }
Bug reported by Martin Casado.
02/27/2003: beazley
Added support for anonymous bit-fields. For example:
struct Foo {
int x : 4;
int : 4;
int y : 8;
};
Anonymous bit-fields are ignored by SWIG. Problem
reported by Franz Höpfinger.
02/26/2003: cheetah (William Fulton)
[Java] Better typemaps in the Examples/java/typemap example and also
fixes subtle bug when using the StringBuffer typemaps more than once.
02/26/2003: beazley
Fixed [ 642112 ] Constants char bug.
02/26/2003: beazley
Fixed [ 675337 ] Partial template specialization not entirely working.
There was a subtle problem related to the naming and ordering of
template partial specialization arguments. Matching worked okay,
the resulting templates weren't expanded correctly.
02/25/2003: beazley
Fixed problem with parsing (and generating code) for
references to arrays. For example:
int foo(int (&x)[10]);
02/25/2003: beazley
Fixed [ 635347 ] Compilation warning from libpy.c.
Reported by Daniel L. Rall.
02/25/2003: beazley
Fixed a subtle problem with virtual method implementation
checking and typedef.
typedef int *intptr;
struct A {
virtual int *foo() = 0;
};
struct B : public A {
virtual intptr foo() { };
};
SWIG was treating these declarations as different even though
they are the same (via typedef).
02/25/2003: ljohnson (Lyle Johnson)
[Ruby] Added range checking for the NUM2USHRT macro, per [ 675353 ].
02/24/2003: beazley
Fixed a subtle problem with the code that determined if a class is abstract
and can be instantiated. If you had classes like this:
struct A {
virtual int foo(int) = 0;
};
struct B : virtual A {
virtual int foo(int);
};
struct C : virtual A {
};
/* Note order of base classes */
struct D : B, C { }; /* Ok */
struct E : C, B { }; /* Broken */
then SWIG determined that it could instantiate D(), but not E().
This inconsistency arose from the depth-first search of the
inheritance hierarchy to locate the implementations of virtual
methods. This problem should now be fixed---SWIG will attempt
to locate any valid implementation of a virtual method by
traversing over the entire hierarchy.
02/22/2003: cheetah (William Fulton)
[Java] Fix for using enum typemaps. The Java final static variable type
can be set using the jstype typemap, enabling enums to be mapped to
something other than int. Bug reported by Heiner Petith.
02/21/2003: songyanf (Tiger)
Added CSharp (C#) module prototype
i.e. csharp.cxx & csharp.h at Source/Modules/.
They are for test usage only now and need improvement.
The interface also need to be modified.
*** NEW FEATURE ***
02/20/2003: songyanf (Tiger)
Fixed problem with typedef with -fvirtual.
Similar as beazley's modification today.
02/20/2003: beazley
Added support for gcc-style variadic preprocessor macros.
Patch [ 623258 ] GCC-style vararg macro support.
Contributed by Joe Mason.
02/20/2003: beazley
Fixed [ 605162 ] Typemap local variables.
Reported by Lyle Johnson.
02/20/2003: beazley
Fixed problem with abstract classes and typedef. For example:
class Foo {
public:
virtual void foo(int x) = 0;
};
typedef int Integer;
class Bar : public Foo {
public:
virtual void foo(Integer x);
};
SWIG was getting confused about the latter method---making Bar
abstract. Reported by Marcelo Matus.
02/19/2003: cheetah (William Fulton)
[Java] %javaconst(flag) can also be used on enums as well as constants.
This feature enables true Java compiler constants so that they can be
used in Java switch statements. Thanks to Heiner Petith for patches.
02/19/2003: songyanf (Tiger)
Modified -fcompact feature to deal with PP lines
02/18/2003: beazley
Fixed [ 689040 ] Missing return value in std_vector.i.
Reported by Robert H. de Vries.
02/18/2003: beazley
Fixed a few evil scoping problems with templates, namespaces, and the
%extend directive. Problem reported by Luigi Ballabio.
02/18/2003: cheetah (William Fulton)
[Ruby] Improved support for Visual C++ and other native Windows compilers.
It is no longer necessary to specify "/EXPORT:Init_<module>", where <module> is the
swig module name when linking using these native Windows compilers.
02/15/2003: songyanf (Tiger)
Added -fvirtual option.
Reduce the lines and size of the wrapper file
by omitting redifined virtual function in children classes.
Modified -compact option to -fcompact option
Added -small option.
-small = -fvirtual -fcompact
And it can be extended by future feature options,
which are used to reduce wrapper file szie.
Added SWIG_FEATURES environment variable check.
To dynamically set the feature options such as -fcompact & -fvirtual
*** NEW FEATURE ***
02/13/2003: lenz
Updated Doc/Manual/Perl5.html to talk about C++ compile problems
configure.in now checks for PERL5_CCFLAGS
Runtime/Makefile.in and Example/Makefile.in now use PERL5_CCFLAGS
Added Lib/perl5/noembed.h which contains all the known macro conflicts
02/12/2003: beazley
Fixed [ 685410 ] C++ Explicit template instantiation causes SWIG to exit.
Fixes a syntax error with declarations similar to this:
template class std::vector<int>;
SWIG now ignores the instantiation and generates a warning message.
We might do more later. Reported by Thomas Williamson.
02/11/2003: cheetah (William Fulton)
Rewrote bool typemaps to remove performance warning for compiling generated code
under Visual C++.
02/11/2003: cheetah (William Fulton)
Fix for wrapping reference variables (const non-primitive and all non-const types)
for example:
int& i;
Class& c;
const Class& c;
02/11/2003: beazley
Fixed more very subtle preprocessor corner cases related to recursive
macro expansion. For example:
#define cat(x,y) x ## y
cat(cat(1,2),3) // Produces: cat(1,2)3
#define xcat(x,y) cat(x,y)
xcat(xcat(1,2),3) // Produces 123
See K&R, 2nd Ed. p. 231.
02/10/2003: cheetah (William Fulton)
Fixed [ 683882 ] - patch submitted by F. Postma for SWIG to compile on HP-UX.
02/10/2003: beazley
Fixed subtle preprocessor argument expansion bug. Reported by Marcelo Matus.
02/10/2003: songyanf
Added -compact option.
Reduce the lines and size of the wrapper file
by omitting comments and combining short lines.
*** NEW FEATURE ***
02/07/2003: beazley
Fixed [ 651355 ] Syntax error with cstring.i
Reported by Omri Barel.
02/07/2003: beazley
Fixed [ 663632 ] incompatibility with standard cpp.
This is a refinement that fixes this problem:
// Some macro with an argument
#define FOO(x) x
int FOO; /* Not a macro---no arguments */
02/05/2003: beazley
Fixed [ 675491 ] parse error with global namespace qualification.
Submitted by Jeremy Yallop.
02/04/2003: beazley
Fixed bug in varargs processing introduced by the numinputs typemap parameter.
01/08/2003: ttn
[xml] Fix string-replacement ordering buglet.
Thanks to Gary Herron.
12/23/2002: cheetah (William Fulton)
Further build changes:
- The SWIG executable is now built using a single Makefile.
- This makefile is generated by Automake (Source/Makefile.am).
- Dependency tracking and tags support are in this makefile.
- Automake 1.7.2 and Autoconf 2.54 minimum versions are needed to build SWIG from CVS.
- Running ./autogen.sh now installs Autoconf/Automake support files into
Tools/config and these files are no longer stored in CVS.
- Bug fixes in 'make install' for systems using .exe executable extension and
./configure --with-release-suffix=whatever
12/16/2002: cheetah (William Fulton)
More build changes:
- Autoconf's AC_CANONICAL_HOST replaces proprietary approach for detecting build host.
- Autoconf support files moved to Tools/config.
12/16/2002: cheetah (William Fulton)
Modifications to run on MacOS, submitted by Bernard Desgraupes.
Mainly ensuring generated files are output in the appropriate directory for
some modules.
12/11/2002: cheetah (William Fulton)
Various build modifications and bug fixes:
- Simplification of version string. Use autoconf's PACKAGE_VERSION instead.
- Build time removed from SWIG version.
- Using standard autoconf config header generation.
- Updated old autoconf macros as reported by autoupdate.
- Removed $prefix in autoconf from search paths as autoconf won't expand them.
- Subtle bug fix where 'make prefix=/somewhere; make clean; make prefix=/somwhere/else'
produced an executable using the incorrect library directories.
- Added -ldflags commandline option for MzScheme, Ocaml, Pike and PHP.
- Fixed reporting of compiler used when using -version commandline option.
- SWIG web address added to -version commandline option.
12/11/2002: beazley
Minor fix to Tcl dynamic cast typemaps. Reported by
Kristopher Blom.
12/10/2002: beazley
Fixed subtle template argument replace bug. Reported by
Chris Flatley.
12/10/2002: beazley
Reverted CHANGES 09/03/2002, preprocessor argument evaluation. Arguments
are not evaluated during collection, K&R, p. 230.
12/06/2002: beazley
Fixed [ 649022 ] Compilation problems with KAI/KCC
12/02/2002: beazley
SWIG 'rel-1-3' CVS branch merged back into the main branch.
|