Swig

Latest version: v4.2.1

Safety actively analyzes 638437 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 9 of 13

1.3.25

==============================

06/11/2006: mkoeppe
[Guile] Fix handling of anonymous-enum variables.

06/10/2005: mkoeppe
[Guile] Fix for function arguments that are passed by
copy-of-value. Fix for global "const char *" variables.
Fix testcases arrays_dimensionless, arrays_global.

06/08/2005: wsfulton
Fix for when a base class defines a symbol as a member variable and a derived class defines
the same symbol as a member method.

06/08/2005: wsfulton
[C] More fixes for virtual/new/override modifiers - when a method has protected access
in base and public access in derived class.

06/02/2005: wsfulton
Fix 1066363 - Follow convention of release tarball name matching directory name.

06/02/2005: wsfulton
[C, Java] Fix 1211353 - typesafe enums (and Java proper enums) wrappers when enum value
is negative.

05/27/2005: wsfulton
Modernised and tidied up Windows macros --> SWIGEXPORT, SWIGSTDCALL. They can be overridden
by users via -D compiler directives if need be.

05/26/2005: wsfulton
%csmethodmodifiers can be applied to variables as well as methods now.

In addition to the default 'public' modifier that SWIG generates, %csmethodmodifiers will also
replace the virtual/new/override modifiers that SWIG thinks is appropriate. This feature is
useful for some obscure cases where SWIG might get the modifiers incorrect, for example
with multiple inheritance and overriding a method in the base class.

*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***

05/25/2005: wsfulton
Added missing constructors to std::pair wrappers (std_pair.i) for all languages.

05/25/2005: wsfulton
[C] Added std::pair wrappers in std_pair.i

05/25/2005: wsfulton
[C] The C 'new' and 'override' modifiers will be generated when a C++ class inherits methods
via a C++ 'using' declaration.

05/25/2005: wsfulton
Fix for exception specifications previously being ignored in classes that inherited methods
from 'using' declarations, eg calls to Derived::bar below will convert C++ exceptions into
a target language exception/error, like it always has done for Base::Bar.

class Base {
virtual bar() throw (std::string);
};
class Derived : public Base {
using Base::bar;
};

05/23/2005: wsfulton
Fixes for detecting virtual methods in %extend for the -fvirtual option and C override and new
method modifiers.

05/23/2005: wsfulton
[C] The 'new' modifier is now generated on the proxy method when a method in a derived
class is not polymorphic and the same method exists in the derived class (ie it hides
the base class' non-virtual method).

05/23/2005: wsfulton
[Java, C] Fixes to detection of covariant return types - when the class hierarchy is more
than 2 classes deep.

05/21/2005: wsfulton
[Java] std::wstring typemaps moved from std_string.i to std_wstring.i

05/21/2005: wsfulton
Fix for crash in DohStrstr, bug 1190921

05/21/2005: wsfulton
[TCL] Fix for methods with similar names when showing list of names on error - bug 1191828.
Patch from Jeroen Dobbelaere.

05/21/2005: wsfulton
[TCL] long long overloading fix - bug 1191835, patch from Jeroen Dobbelaere.

05/21/2005: wsfulton
Fix bug 1196755 to remove debug from swigtcl8.swg.

05/19/2005: wsfulton
[C and -fvirtual option] Fix for the override key not being generated in the derived class when a
virtual method's return type was a typedef in either the base or derived class. Also ensures the
method is eliminated when using the -fvirtual option. For example, Derived.method now has the C
override keyword generated:

typedef int* IntegerPtr;

struct Base {
virtual IntegerPtr method();
};

struct Derived : Base {
int * method() const;
};

[C] Fix for the override key being incorrectly generated for virtual methods when a base class
is ignored with %ignore.

05/13/2005: wsfulton
[Java] Fixes to remove "dereferencing type-punned pointer will break strict-aliasing rules"
warnings in C wrappers when compiling C code with 'gcc -Wall -fstrict-aliasing'. Patch from
Michael Cahill. This modifies many of the casts slightly, for example
arg1 = *(DB_ENV **)&jarg1;
to
arg1 = *(DB_ENV **)(void *)&jarg1;

05/12/2005: wsfulton
[C] Support for C attributes. C attributes can be generated:
1) On a C/C++ type basis by specifying an inattributes and/or outattributes typemap attribute
in the imtype or cstype typemaps (for C return type or C parameter type attributes).
2) On a wrapped method or variable by specifying a csattributes feature (%feature).
3) On a wrapped proxy class or enum by specifying a csattributes typemap.

Examples are in the C documentation (CSharp.html).

04/29/2005: wsfulton
New configure option to turn off the default maximum compiler warning as
they couldn't be removed even when overriding CFLAGS and CXXFLAGS with configure
(./configure CFLAGS= CXXFLAGS=). To turn the maximum warnings off, run:

./configure --without-maximum-compile-warnings

04/28/2005: wsfulton
Patch from Scott Michel which reworks the Java constructor and finalize/destructor typemaps,
for directors to reduce the number of overall Java typemaps. Added the director_take and
director_release typemaps to emulate other modules' __disown__ functionality.

*** POTENTIAL INCOMPATIBILITY FOR JAVA DIRECTORS ***

04/28/2005: wsfulton
[C] Fixed problems due to the over eager garbage collector. Occasionally the
garbage collector would collect a C proxy class instance while it was being used
in unmanaged code if the object was passed as a parameter to a wrapped function.
Needless to say this caused havoc as the C proxy class calls the C++ destructor
when it is collected. Proxy classes and type wrapper classes now use a HandleRef,
which holds an IntPtr, instead of a plain IntPtr to marshal the C++ pointer to unmanaged
code. There doesn't appear to be any performance degradation as a result of this
modification.

The changes are in the proxy and type wrapper classes. The swigCPtr is now of type HandleRef
instead of IntPtr and consequently the getCPtr method return type has also changed. The net
effect is that any custom written typemaps might have to be modified to suite. Affected users
should note that the implementation uses the new 'out' attribute in the imtype typemap as the
input type is now a HandleRef and the output type is still an IntPtr.

*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***

04/28/2005: wsfulton
[C] Support for asymmetric type marshalling added. Sometimes the output type needs to be
different to the input type. Support for this comes in the form of a new optional 'out'
attribute for the ctype, imtype and cstype typemaps. If this typemap attribute is not
specified, then the type used for both input and output is the type specified in the
typemap, as has always previously been the case. If this typemap attribute is specified,
then the type specified in the attribute is used for output types and the type specified
in the typemap itself is used for the input type. An output type is a return value from
a wrapped method or wrapped constant and an input type is a parameter in a wrapped method.

An example shows that char * could be marshalled in different ways,

%typemap(imtype, out="IntPtr") char * "string"
char * function(char *);

The output type is thus IntPtr and the input type is string. The resulting intermediary C code is:

public static extern IntPtr function(string jarg1);

04/22/2005: mkoeppe (Matthias Koeppe)
[Guile] Fix generation of "define-method" for methods of
classes with a constructor. Reported by Luigi Ballabio.

04/15/2005: wuzzeb (John Lenz)
[Chicken]
For wrapped functions that return multiple values (using argout),
SWIG CHICKEN now returns them as multiple values instead of as
a list. They can then be accessed using (call-with-values).

04/14/2005: wuzzeb (John Lenz)
[Chicken]
+ Added a whole bunch of new _runme scripts into the chicken test
suite. Also fix some bugs these new scripts turned up.

+ Added optimization when returning a wrapped proxy class. Before,
a minor garbage collection was invoked every time a function returned.

+ All the chicken Examples should now run correctly

04/14/2005: wsfulton
[C] More fixes for typemap matching when wrapping variables, in particular
std::string, so that std::string variables can be easily marshalled with
a C string property using:

%include "std_string.i"
%apply const std::string & { std::string *variable_name };
std::string variable_name;

(Recall that all class variables are wrapped using pointers)

04/05/2005: wuzzeb (John Lenz)
[Chicken]
+ Added Examples/chicken/egg, an example on how to build a chicken
extension library in the form of an egg. Also updated the
documentation on the different linking options.

+ chicken test-suite now has support to check SWIG with the -proxy
argument if there exists a _proxy_runme.ss file.

+ More fixes for overloaded functions and -proxy

03/31/2005: wsfulton
Turned on extra template features for all languages which were
previously only available to Python.

This enables typemaps defined within a templated class to be used as
expected. Requires %template on the templated class, %template() will
also pick up the typemaps. Example:

template <typename T> struct Foo {
...
%typemap(in) Foo "in typemap for Foo<T> "
or
%typemap(in) Foo<T> "in typemap for Foo<T> "
};

%template(Foo_i) Foo<int>;
%template() Foo<double>;

will generate the proper 'in' typemaps wherever Foo<int> and Foo<double>
are used.

03/30/2005: mkoeppe (Matthias Koeppe)
[MzScheme] Patch from Hans Oesterholt for supporting MzScheme 30x.

03/29/2005: wuzzeb (John Lenz)
[Chicken]
+ Reallow older versions of chicken (1.40 to 1.89) by passing -nocollection
argument to SWIG
+ %import now works correctly with tinyclos. (declare (uses ...)) will be
exported correctly.
+ TinyCLOS proxy classes now work correctly with overloaded functions
and constructors.

03/29/2005: wsfulton
[Java] Patch from Scott Michel for directorout typemaps. Java directors
require the directorout typemaps like the other languages now. The new
typemaps provide fixes for methods where the return type is returned
by reference (this cannot automatically be made thread safe though).

03/22/2005: wsfulton
Enum casting fixes. Visual C++ didn't like the C type casting SWIG produced
when wrapping C++ enum references, as reported by Admire Kandawasvika.

03/21/2005: wsfulton
[Perl] SF 1124490. Fix Perl macro clashes when using Visual Studio's STL string,
so now projects can include <string>.

03/21/2005: wsfulton
Fixed %varargs which got broken with the recent default argument changes.
Also works for Java and C for the first time now.

03/17/2005: wuzzeb (John Lenz)
[Chicken]
+ Fix a whole bunch of bugs in the chicken module. The entire
test suite now compiles, with the exception of the tests that require
std_vector.i, std_deque.i, and so on, which chicken does not have yet.

+ Add support for %exception and %typemap(exceptions). Exceptions are
thrown with a call to (abort) and can be handled by (handle-exceptions)

03/15/2005: wsfulton
[Java] Patch from Scott Michel for directors. Modifications to the typemaps
giving users fine control over memory ownership and lifetime of director classes.
Director classes no longer live forever by default as they are now collectable
by the GC.

03/15/2005: wuzzeb (John Lenz)
[Chicken] Add support for adding finalizers garbage collected objects.
Functions that return new objects should be marked with %newobject and
input arguments which consume (or take ownership) of a pointer should
be marked with the DISOWN typemap.

Also add support for correctly checking the number of arguments passed
to a function, and raising an error if the wrong number are passed.

03/14/2005: wuzzeb (John Lenz)
Add --without-alllang option to configure.in, which is the same as
passing all the --without-python --without-perl5 etc... that Matthias added.

03/09/2005: wsfulton
[Php] Memory leak fix for functions returning classes/structs by value.

03/08/2005: wsfulton
[Perl] Fix for Perl incorrectly taking memory ownership for return types that
are typedefs to a struct/class pointer. Reported by Josh Cherry.

03/07/2005: wsfulton
[C] Various exception changes for the std::vector wrappers. These now more
accurately mirror the same exceptions that System.Collections.ArrayList throw.

03/07/2005: wsfulton
[C] Fix undefined behaviour after any of the std::vector methods
throw an exception.

03/07/2005: wsfulton
[C] When null is passed for a C++ reference or value parameter, the
exception thrown has been corrected to an ArgumentNullException instead
of NullReferenceException as recommended in the .NET Framework documentation.

The default throws typemaps turn a C++ exception into an ApplicationException,
not a SystemException now.

03/07/2005: wsfulton
[C] Numerous changes in C exception handling have been made over the past
few weeks. A summary follows:

The way in which C++ exceptions are mapped to C exceptions is quite different.
The change is to fix C exceptions so that the C++ exception stack is correctly
unwound as previously C++ exceptions were being thrown across the C PInvoke layer
into the managed world.

New typemap attributes (canthrow and excode) have been introduced to control the
mapping of C++ to C exceptions. Essentially a callback into the unmanaged world
is made to set a pending exception. The exception to throw is stored in thread local
storage (so the approach is thread-safe). The typemaps are expected to return
from unmanaged code as soon as the pending exception is set. Any pending exceptions
are checked for and thrown once managed code starts executing. There should
be minimal impact on execution speed during normal behaviour. Full details will be
documented in CSharp.html.

The SWIG_CSharpThrowException() function has been removed and replaced with the
SWIG_CSharpSetPendingExceptionArgument() and SWIG_CSharpSetPendingException()
functions. The original name has been deliberately changed to break old code as
the old approach was somewhat flawed. Any user defined exceptions that follow the
same pattern as the old approach should also be fixed.

Numerous new .NET framework exceptions are now available for easy throwing from
unmanaged code. The complete list is:

ApplicationException, ArithmeticException, DivideByZeroException,
IndexOutOfRangeException, InvalidOperationException, IOException,
NullReferenceException, OutOfMemoryException, OverflowException,
SystemException, ArgumentException, ArgumentNullException and
ArgumentOutOfRangeException.

*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***

05/05/2005: mmatus

Fix several memory leaks around. Even when we survive knowning
swig is a memory leak factory, it was a little out of
control. To run std_containers.i in the python test-suite,
swig was using ~260MB, now it uses 'only' ~40MB, which is
the same ammount that g++ uses, so, is not that bad.
In the process, I found a couple of extra Deletes, which
in some cases could trigger seg. faults and/or
DOH/asserts.

[python] Better support for directors + exception. More
verbose errors and added an unexpected exception handler.

[python] Fix memory leak for the

std::vector<std::vector<int> >

case,reported by Bo Peng.

[python] Fix SwigPyObject compare problem reporte by
Cameron Patrick.

[python] Fix several warnings in the generated code
for gnu-gcc, Intel and VC7.1 compilers.


02/25/2005: wuzzeb (John Lenz)
Update documentation to use CSS and <div> instead of <blockquote>
I used a script to convert the docs, and it set all the box classes
to be "code". There are actually 4 different classes,
"shell", "code", "targetlang", and "diagram". We need to go through
and convert the divs depending on what they contain.

02/23/2005: mmatus

[Python] Added option -nortti to disable the use of native
C++ RTTI with directors (dynamic_cast<> is not used).

Add more code for directors to detect and report errors in
the python side.

Extend the use of SWIGINTERN whenever is possible.

Remove template warnings reported by VC7.1.

Remove warnings reported by gcc/g++. Finally you can
compile using

g++ -W -Wall -c mymodule_wrap.cxx

and no spurious errors will be generated in the wrapper
code.

02/23/2005: wuzzeb (John Lenz)
Added -external-runtime argument. This argument is used to dump
out all the code needed for external access to the runtime system,
and it replaces including the files directly. This change adds
two new virtual functions to the Language class, which are used
to find the language specific runtime code. I also updated
all languages that use the runtime to implement these two functions.

02/22/2005: mmatus
Fix %template + private error SF1099976.

02/21/2005: mmatus

Fix swigrun.swg warnings reported when using "gcc -W -Wall"
(static/inline not used in front of a function
declaration), and add SWIGUNUSED attribute to avoid
unused warnings elsewhere.

Fix unused variable warnings.

[Python] Use new SWIGUNUSED attribute to avoid warnings in
SWIGINTERN methods.

[Python] Fix PyOS_snprintf for python versions < 2.2 (SF 1104919).

[Python] Fix map/multimap to allow empty maps (reported by
Philippe Hetroy).

[Docs] Add some documentation to Python.html and
SWIGPlus.html, including for example the fact that
'friends' are now supported.

02/21/2005: wsfulton
[PHP] Patch from Olly Betts, so that wrappers compile with Zend thread safety enabled.

02/17/2005: wsfulton
Memory leak fix in some of the scripting language modules when using default
arguments in constructors. The scripting language was not taking ownership of the
C++ object memory when any of the constructors that use default arguments was called.

02/16/2005: wsfulton
SF 1115055: Failed make install. Patch from Rob Stone.

02/16/2005: wsfulton
[Java] SF 1123416 from Paul Moore. Correct memory allocation for STRINGARRAY
typemaps in various.i.

02/15/2005: wsfulton
Disabled typemap search changes for now (see entry 19/12/2004). It breaks
old typemaps, lengthens the execution time by about 25% and introduces
inconsistencies.

02/15/2005: wsfulton
swig -help follows other software by printing to stdout instead of stderr now.
swig -version also displays to stdout instead of stderr now.
Behaviour reported by Torsten Landschoff.

02/15/2005: wsfulton
[Ruby] Fix for the less commonly used ordering of %include and include, so
that the generated code compiles. Bug reported by reported by Max Bowsher.
%include foo.h
%{
include foo.h
%}

02/15/2005: wsfulton
[C, Java] SWIG_exception macro will now return from unmanaged code / native code
as soon as it is called. Fixes possible JVM crashes and other code unexpectedly
being executed. Note SWIG_exception is only occasionally used by SWIG library
writers, and is best avoided by SWIG users.

02/15/2005: wsfulton
[C, Java] Typemaps can now be targeted at global variable names
and static member variable names. Previously the typemaps for
the setters were ignored, for example:

%typemap(in) int globalint "..."
int globalint;

02/13/2005: mkoeppe (Matthias Koeppe)
[Guile] Add %typecheck for SWIGTYPE, add %typecheck for ptrdiff_t, fix
typemaps for size_t.

[Pike] Merge patch from Torsten Landschoff for improved Pike configuration.

02/12/2005: mkoeppe (Matthias Koeppe)
New configure switches --without-tcl, --without-python etc. allow to
disable the search for installed languages.

01/31/2005: wuzzeb (John Lenz)
- Add DohSortList to DOH

- Improve the runtime type system:
+ Speed. Type loading is now O(n log n) instead of O(N^2), which
for large modules is a huge improvement.
+ A whole bunch of functions in swigrun.swg no longer need the
swig_type_list_handle passed to them. The only one left is
TypeQuery. This also makes runtime.swg a lot smaller.
+ Split up swig_type_info structure into two structures
(swig_type_info and swig_cast_info)
+ Store a pointer to a swig_type_info rather than just the type
name string in the linked list of casts. First off, this makes
the guile module a little faster, and second, the
SWIG_TypeClientData() function is faster too.
+ Add the idea of a module into the type system. Before, all the
types were stored in one huge linked list. Now, another level is
added, and the type system stores a linked list of modules, each
of which stores an array of types associated with it.
+ For more information of how the runtime type system now works,
please see Doc/Manual/typemaps.html and Doc/Devel/runtime.txt

- Update all language modules to use the new type system. The changes
to each language module are minor. All languages are now able to
use runtime.swg for external access to the type system. Before
only python and perl did.

- [guile, mzscheme, ocaml, and php4] These languages opened up the
init function inside the .cxx code, and any code in the .swg files
in the init section was inside this function. This was a problem
for swiginit.swg, which needs to be inserted before the SWIG_init
function is opened. Thus I changed these languages to be like
python or perl, where the init function is declared in the .swg
file.

- [Ruby] Instead of moving the init function to the .swg file, I
added a new section initbeforefunc, and then added
%insert(initbeforefunc) "swiginit.swg"

- [MzScheme] Fix enums and fix Examples/Makefile.in so that if
multiple -I arguments are specified in the INCLUDES variable, each
gets a ++ccf.

- [Guile GH] Update Guile GH to use the new type system. See
Doc/Manual/Guile.html for how smobs are now used.

01/11/2005: wsfulton
[C] New typemap called 'csconstruct'. The code in this typemaps was previously hard
coded and could not be customised by a user. This typemap contains the code that is
generated into a proxy class's constructor.

[Java] New typemap called 'javaconstruct'. The code in this typemaps was previously hard
coded and could not be customised by a user. This typemap contains the code that is
generated into a proxy class's constructor. Another typemap named 'javaconstruct_director'
is used instead when the proxy class is a director class.

[C, Java] If a C++ class did not have a default constructor, a protected default constructor
was automatically generated by SWIG. This seems is unnecessary and has been removed
and thereby giving the user almost complete control over the generated code along with the
new typemaps above.

19/12/2004: mmatus
[Disabled, see entry 02/15/2004]
- Fix typemap search, now the "out" typemap search is done as follows

int *Foo::foo(int bar) -> int *Foo::foo(int bar)
-> int *Foo::foo
-> int *foo(int bar)
-> int *foo
-> int *

then, now you can be more specific, and define

/* apply only for 'Foo::foo' method */
%typemap(out) int * Foo::foo(int *bar) ...;

/* apply for all 'foo' functions/methods */
%typemap(out) int * foo(int *bar) ...;

%inline {
struct Foo {
int *foo(int *bar);
};
}


15/12/2004: mmatus
- More fixes for templates and template default args.
See template_default.i for scary cases that now are
supported, besides the already ugly STL/std cases.

- Cosmetics and more use of 'const' where it was implicit.
- Other fixes for OSS, which is now working again with 1.3.25.

1.3.24

==================================

12/12/2004: wuzzeb (John Lenz)
[Chicken] Fix a bunch of bugs relating to -proxy support
+ non-class variables now export properly using -proxy
+ static member functions now export properly using -proxy
+ member class variables now export properly using -proxy
+ added a -nounit argument, which does not export the (declare (unit ...))
+ correctly install swigclosprefix.scm
+ constants (enums, defines) now correcly export when using -proxy

12/11/2004: wsfulton
configure fix for when more than one version of jni_md.h is found
in the Java include directory (was generating lots of sed error
messages).

12/08/2004: wsfulton
[Java] Fixes to arrays_java.i so that one can apply the array
typemaps to functions taking pointers as input, eg

%include "arrays_java.i"
%apply int[] {int*};
void foo(int *a);

12/05/2004: wsfulton
[Java] Director mods contributed by Scott Michel. New typemaps
directordisconnect and directordisconnect_derived for the
swigDirectorDisconnect() method. Also fix to get the javapackage
typemap working again.

12/05/2004: mmatus
- Finishing the fixes for templates + default template
args + specializations.

- [Python] Now we use the new templates + default template
args in the std/STL library. That means the internal
swig files are getting uglier since we now support the
original declarations:

template<class _Tp, class _Alloc = std::allocator< _Tp > >
class vector {
....
};

template<class _Key, class _Tp, class _Compare = std::less<_Key >,
class _Alloc = std::allocator<std::pair<const _Key, _Tp > > >
class map {
....
};

and the user can use the %template directive as

%template() std::vector<int>;
%template() std::vector<int, std::allocator<int> >;
%template() std::vector<int, MyAllocator<int> >;

Now we are closer to the cleaning/rewriting of the
python std/STL support, such that we recover support for
MSVC++ 6.0, and we can add support for other languages
too.


12/02/2004: wsfulton
[Java] Fix for directors when wrapping methods using a member enum
and typesafe/proper enums enabled.

12/01/2004: mmatus
- Fix typemaps to work with templates and default template
args, ie

template <class A, class B = int>
struct Foo {
};

%typemap(in) Foo<int> *{...}
%typemap(out) Foo<int,int> *{...}

Foo<int> * foo( Foo<int> *f1, Foo<int,int> *f2);

now 'f1', 'f2' and the return value resolve the provided
typemaps properly.

This is highly needed for proper STL support, see new
std_basic_string.i, std_sstream.i, etc.

- Added std_sstream.i, and fix std_basic_string.i to use
the new typemaps + template def. arg mechanism. Also,
added the needed std_alloc.i. Now, all the containers
can be modified to support std::allocator, like in:

template<class T, class A = std::allocator<T > >
class vector {
public:
....
};

This change is only completed by now for basic_string.

- Fix for smart pointers + members + extensions:

%extend Foo {
int extension(int i, int j) { return i; }
int extension() { return 1; }
}

%inline %{

class Foo {
public:
int y;
static const int z;
};

class Bar {
Foo *f;
public:
Bar(Foo *f) : f(f) { }
Foo *operator->() {
return f;
}
};

now you can

f = Foo()
f.y = 3
a = f.z
f->extension()

b = Bar(f)
b.y = 3
a = b.z
b->extension()

- Other small errors fixes, mostly python.

11/25/2004: wsfulton
[Java] Numerous director bug fixes so that the correct java types
and canonicalized types in the JNI code are emitted. Use of the
$javaclassname special variables in the director typemaps now
consistent with the non-director typemaps. The types used for
typemap lookups are also corrected in a few places. If you
previously had your own director typemaps, ensure they are using the
correct C++ type.

*** POTENTIAL INCOMPATIBILITY FOR JAVA DIRECTORS ***

11/25/2004: wsfulton
const enum SWIGTYPE & typemaps added. These wrap const enum references
as if they were passed by value. Const enum references thus work the
same as const reference primitive types such as const double &,
const int & etc. Typemaps added for Java, C, Ruby, Tcl, Perl and Pike.

11/25/2004: wsfulton
[Java, C] New special variable: $*javaclassname, similar to $javaclassname
and $&javaclassname. The new one removes a pointer from the C type before
obtaining the Java class name. One or more of $javaclassname,
$&javaclassname or $*javaclassname may now appear in a typemap. Likewise for
C using csclassname instead of javaclassname.

11/25/2004: wsfulton
The last vestiges of enums being handled as integers removed from the
internals. The wrapper methods use the enum type rather than an int
now. The net result is added type safety for enums when handled as
pointers, references etc. Previously in situations such as a method
taking a pointer to an enum, a pointer to an int or a pointer to an
enum of some other type could inadvertantly be passed to the method.
This is now fixed as the descriptor for an enum is no longer based on
an int, but the enum type instead. Anonymous enums are still handled
as integers.

The consequence for scripting language users in correct usage of enums
should not be noticeable. There is no change for any of the languages
where enums are passed by value - most of the scripting languages will
still accept an integer for an enum value and the strongly typed
languages still use either typesafe enums, integers or proper enums
depending on what the user configures. For Java and C users a change
in the typewrapper class name has occurred (for enum pointers,
references etc). For example:

enum Numbers { one=1, two };
enum Numbers* number();

In Java and C this must now be coded as

SWIGTYPE_p_Numbers n = modulename.number();

rather than

SWIGTYPE_p_int n = modulename.number();

*** POTENTIAL INCOMPATIBILITY ***

11/21/2004: wsfulton/mmatus
Added missing deprecated warning for %name and remove remaining %name
usage in the SWIG libraries.

11/21/04: mmatus
- [Python] Adding the PySwigObject to be used for carrying
the instance C/C++ pointers. This is used instead of
string and PyCObjects.

The new PySwigObject is even safer than PyCObject, and
more friendly than plain strings:

now you can do

print a.this
<Swig Object at _00691608_p_A>

print str(a.this)
_00691608_p_A

print long(a.this)
135686400

print "%s 0x%x" % (a.this, a.this)
_00691608_p_A 0x8166900

the last one is very useful when debugging the C/C++
side, since is the pointer value you will usually get
from the debugger.

Also, if you have some old code that uses the string
representation "_00691608_p_A", you can use it now again
using 'str(ptr)', or by calling 'str = PyObject_Str(obj)'
in the C/C++ side.

This change is mainly for nostalgic swig users that miss
the string representation, but also allows to say again

if a.this == b.this:
return "a is b"

and well, since the change were really simple, maybe in
the future we will be able to do

next = a.this + 1

or add native python iteration over native C/C++ arrays,
ie, no need to create/copy new tuples when returning and
array or vector.

Also, a PySwigPacked object was adding to carry a member
method pointer, but this is probably a temporary solution
until a more general object for methods is added.

Be aware that to simplify maintaining and compatibility
with other tools, the old string and PyCObjects
representation could disappear very soon, and the
SWIG_COBJECTS_TYPES or SWIG_NO_OBJECT_TYPES macros will
have no effect at compilation time. Still, the three
mechanisms are present in the code just for testing,
debugging and comparison purposes.

11/21/04: mmatus

- [Python] Adding back support for using the swig runtime code
inside the user code. We just allow the user to include
the minimal code needed to implement the runtime
mechanism statically, just as in done in the swig
modules.

To use the swig runtime code, for example with python,
the user needs include the following:

include <Python.h> // or using your favorite language
include <swigrun.swg>
include <python/pyrun.swg> // or using your favorite language
include <runtime.swg>

the files swigrun.swg, pyrun.swg and runtime.swg can
be checked out by using swig -co, or they can simply
be found by adding the swig lib directory to the
compiler include directory list, for example

SWIGLIB=`swig -swiglib`
c++ -I${SWIGLIB} ..

of better, using the CPPFLAGS, but that depends on your
environment.

This change can be ported to the other languages too,
you just need to isolate the needed runtime code in
a single file like 'pyrun.swg', and provide the
SWIG_Runtime_GetTypeList() method. Look at the
Lib/python/pyrun.swg file and the Examples/python/swigrun
example.

11/15/04: mmatus
- Fix mixed_types.i + gcc-3.4, ie, arrays + references +
typedefs

- Fix multidim arrays + typedefs,ie

typedef char character[1];
typedef character word[64];

- Process protected/private bases in the same way before
we process protected/private members, ie, we check
for constructors, operator new, virtual members, etc.

- Fix Ruby/Java to work (or ignore) multi-inheritance +
directors. Allow other languages to define if it is
supported or not.

- Now you can run

SWIG_FEATURES="-directors -dirprot"
make check-ruby-test-suite
make check-python-test-suite
make check-java-test-suite
make check-ocaml-test-suite

and you will get only 'real' errors. ruby and python
compile with no errors, java shows some problems.

1.3.23

==================================

11/05/2004: wsfulton
Patch 982753 from Fabrice Salvaire: Adds dependencies generation for
constructing makefiles. New command line options -MF -MD -MMD to work
with the current options -M and -MM. These options are named the same
and work the same as in gcc.

11/05/2004: wsfulton
%ignore/%rename changes for methods with default arguments to mirror
%feature behaviour. See previous entry.

*** POTENTIAL INCOMPATIBILITY ***

11/04/2004: wsfulton
%feature improvements for fine tuning when wrapping methods with
default arguments. Any %feature targeting a method with default arguments
will apply to all the extra overloaded methods that SWIG generates if the
default arguments are specified in the feature. If the default arguments are
not specified in the feature, then the feature will match that exact
wrapper method only and not the extra overloaded methods that SWIG generates.
For example:

%feature("except") hello(int i=0, double d=0.0);
void hello(int i=0, double d=0.0);

will apply the feature to all three wrapper methods, that is:

void hello(int i, double d);
void hello(int i);
void hello();

If the default arguments are not specified in the feature:

%feature("except") hello(int i, double d);
void hello(int i=0, double d=0.0);

then the feature will only apply to this wrapper method:

void hello(int i, double d);

and not these wrapper methods:

void hello(int i);
void hello();

This has been introduced to make %feature more powerful to ease the migration
to new default arguments wrapping approach.

*** POTENTIAL INCOMPATIBILITY ***

If you previously had a %feature and didn't specify the default arguments,
you will have to add them in now or you can obtain the original behaviour
by using %feature("compactdefaultargs").

11/04/2004: wsfulton
[C] Typemaps for std::vector added into std_vector.i. The proxy classes
generated are modelled on the .NET ArrayList class. This isn't quite
ready for general consumption yet, but will work with vectors of primitive
types and some classes.

10/3/2004: wuzzeb (John Lenz)
[GUILE] The -scm interface is now the default. The old GH interface can
still be enabled by passing -gh to SWIG.

10/2/2004: mmatus

- More fixes for namespace + class declarations.
As an extra bonus, we get %template support for static/members class
methods, ie, now you can say:

namespace space {
struct A
{
template <class Y>
static void fooT(Y y) { }
};
}

struct B
{
template <class Y>
void barT(Y y) {}
};

%template(foo) space::A::fooT<double>;
%template(foo) space::A::fooT<int>;
%template(foo) space::A::fooT<char>;

%template(bar) B::barT<double>;
%template(bar) B::barT<int>;
%template(bar) B::barT<char>;

and call

A.foo(1)
b = B()
b.bar(1)

note the methods are emitted inside the classes,
and hence, the %template name refers to the 'member'
method name, not a global namespace name.

10/31/2004: mmatus
- Solve namespace + class declarations, as in

namespace foo {
struct Bar;
struct Foo {
};
}

struct foo::Bar : Foo {
};

see namespace_class.i for more examples.

- Fix %template directive to properly use namespaces,
including the case:

namespace one
{
template <typename T>
struct Ptr {};
}

namespace one
{
struct Obj1 {};
typedef Ptr<Obj1> Obj1_ptr;
%template(Obj1_ptr) Ptr<Obj1>;
}

namespace two
{
struct Obj2 {};
typedef one::Ptr<Obj2> Obj2_ptr;
%template(Obj2_ptr) one::Ptr<Obj2>;
}

this is done by using the namespace name 'one' to create
a namespace node to emit the template instantiation,
just as before, but the template parameters are resolved
and qualified in the current namespace ('one' or 'two').
This is same way that typedef works.

This resolve the smart_pointer_namespace2.i case, and at
the same time, several other ones where before swig was
generating the

"Can't instantiate template 'xx' inside namespace 'yy'"

error message. In fact, that error doesn't exist
anymore. You can only get an error if you use a bad
namespace name or so.

10/30/2004: mmatus
- [ruby] Directors fixes:
- enums and std::strings are working now (several
reports in bug track system)
- added patch 1025861 for director + exceptions

*** Attention ***: ruby with directors + protected
members work with version 1.7+. Older versions seems to
have a broken signature for'rb_protect'.

If you need to use an old version, look at

http://excruby.sourceforge.net/docs/html/ruby__hacks_8hpp-source.html
for workarounds.

- [ruby] Fix memory allocation problem in typemap (bug 1037259)

- [tcl] Fix (enums|constants) + namespace option
(reported by jason.m.surpriseintel.com).

- [perl] Add patch 962168 for multiple inheretance

- Fix 'defined' as variable name.

10/29/2004: wsfulton
Seg fault fix for global scope operator used for friend methods:

class B {
friend void ::globalscope();
...
};

10/28/2004:mmatus
- Added module and swig option "templatereduce" to force swig
to reduce any type needed with templates, ie, in these cases

%module("templatereduce") test

template <class T> struct A { };

typedef int Int;
%template(A_Int) A<Int> ==> %template(A_Int) A<int>

typedef B* Bp;
%template(A_Bp) A<Bp> ==> %template(A_Bp) A<B*>

swig reduces the types Int and Bp to their primitives
int and B*. This is closer to the usual compiler
resolution mechanism, and it is really needed sometimes
when you mix templates + typedefs + specializations.

Don't use it if you don't have any problem already,
since the type reduction can interfere with some
user typemaps, specially if you defined something like

typedef int Int;
%typemap(in) Int ...;

in this case, when you use the "templatereduce" option,
swig will ignore the user typemap, since the "typedef int Int"
will take precedence, and the usual "int" typemap will be
applied.

Note that the previous case is not common, and should be
avoided, ie, is not recommended to use a typedef and a
typemap at the same time, specially if you are going to
use templates + specializations.

- Directors:

virtual destructor is always emitted now, this doesn't
cause any harm, and could solve some nasty and
mysterious errors, like the one mentioned by Scott.

also the destructor is not in-lined, so, that can solve
some other mysterious errors when mixing directors +
imports + embedded applications + some specific compilers.

10/27/2004: wsfulton
[C] typemaps.i library file with INPUT, OUTPUT and INOUT typemaps added.

10/27/2004: wsfulton
[Java] std::wstring typemap fixes in std_string.i from Russell Keith-Magee.

10/25/2004: mmatus

- Using + namespace is working now (using_namespace.i).

- Derived + nested classes is working now
(deriver_nested.i), but of course, we are still waiting
for the nested class support.

- Directors:
- unnamed parameters support,

- protected constructor support (automatic and with
dirprot mode),

- detection of really needed protected declarations
(members and constructors) now is done automatically.
Even if you don't use the 'dirprot' mode, swig will
wrap what is minimally needed (and protected) for the
code to compile.

what is public, as usual, is always wrapped, and if
you use the 'dirport'


- Final fixes for the OSS to compile with SWIG 1.3.23 (my
very very ugly C++ + templates + everything mounters wrap).

10/25/2004: wsfulton
[C] New commandline option -dllimport. This enables one to specify
the name of the DLL for the DllImport attribute. Normally this name
comes from the module name, so now it is possible to override this:

swig -csharp -dllimport xyz example.i

will generate for all the wrapped PInvoke methods:

[DllImport("xyz", EntryPoint="...")]
public static extern ...

The wrappers from many different SWIG invocations can thus be compiled
into one DLL.

A new special variable $dllimport can also be used in typemaps, pragmas,
features etc. This will get translated into the value specified by -dllimport
if specified, otherwise the module name.

10/22/2004: wsfulton
[Java] Patch 1049496 from Scott Michel fixes directors methods with
enums when wrapped with typesafe or proper Java enums.

10/21/2004: wsfulton
Fixes for default arguments in director constructors (Python, Ruby, Ocaml).

10/21/2004: mmatus
- [Python] Add the '-cpluscast' option to enable the 'new'
C++ casting operators, such as 'static_cast', inside the
typemaps. By default swig use the old C cast style, even
when parsing C++.

- [Python] Add the '-new_vwm' option to enable the new
SwigValueWrapper mode. Now this is mainly for testing
that the typemaps are really safe for any future
solution, but you can use it if you have a very strange
error with default cosntructors missing + %apply +
%typemap, and if everything else fails (see
valuwrapper_opaque.i for alternative and current
solutions). If you are a user that don't know what is
SwigValueWrapper, don't even try it.

- [Python] Add the '-noh' option to be used with directors
and when you prefer to disable the generation of the
director header file. If not used, swig will work as
usual generating both the wrap.cxx and wrap.h files. If
you use it, swig will only generate wrap.cxx.

10/21/2004: wuzzeb (John Lenz)
- If you define SWIG_TYPE_TABLE when compiling a wrapper file,
the runtime types will be stored in the given type table name.
Using this, you can seperate different modules to share their
own type systems. -DSWIG_TYPE_TABLE=Mytable

- [Python] If you define SWIG_STATIC_RUNTIME then the type information
will be static to this wrapper. Nothing will be shared with any
other modules

- [Python] If you define SWIG_LINK_RUNTIME, then instead of using
the new way of sharing type information, the wrapper will expect
to be linked against the Lib/linkruntime.c file. Any modules compiled
with SWIG_LINK_RUNTIME and linked against linkruntime.c will all
share type information.

10/20/2004: mmatus
- [Python] Initial fix for python/import example. Please
update the Makefile (autoconf, configure, etc, expert),
since now probably is only working with g++, icc and a
few other compilers that have the -shared option.

We need to create additional shared libraries for the
virtual destructors. Old and usually forgotten C++
requirement.

Same fix need to be used in perl, I think.

- [Python] Fix generation of header file for directors,
now directors.swg is also included, so, it can be really
used from C++, and it solves some problem with compiler
that require that, even with the simple swig inclusion.

- [Python] Reordering the methods and moving some bodies
outside the class declaration. This is needed due to
some gcc-2.96 internal compiler errors. It seems the
PYTHON class is getting too large to been declared and
defined at the same time.

- Add the -oh option to change the output header file name
if needed:

swig -c++ -python test.i -o test.CC -oh test.HH

this is mainly needed when using directors, and if the
current default header file name is not good for you,
which is generated as follow:

swig -c++ -python test.i => test_wrap.h
swig -c++ -python test.i -o test.CC => test.h


10/20/2004: wsfulton
1) Compact default arguments feature added. This feature allows one
to use the default argument code generation that was used in
SWIG-1.3.22 and earlier versions. It produces more compact wrappers
as only one wrapper method is generated for any method with default
arguments. So the advantage is it generates less code but has the
original limitations, like it it does not work with all default arguments
and default arguments cannot be taken advantage of in the strongly typed
languages (C and Java). It is implemented via the usual %feature mechanism:

%feature("compactdefaultargs");

2) Keyword arguments (kwargs) are working again for default arguments
in the languages that support it, ie, Python and Ruby. The new default
argument wrapping approach using overloaded methods cannot support kwargs
so the compact default argument feature is automatically turned on when
kwargs are specified, by %feature("kwargs").

3) Compact default arguments are also automatically turned on when wrapping
C (not C++) code. This is to support the bizarre notion of default arguments
for C code.

10/20/2004: wsfulton
Overloaded templated functions in namespaces also working now.
Templated functions with default arguments in namespaces too.

10/19/2004: mmatus

- Allow to disable the new SwigValueWrapper mechanism,
if you add the following line in your language main.

/* Turn on safe value wrapper use mode */
Swig_value_wrapper_mode(1);


Now is only active in python. All the other languages
are using the old resolution, but they can also use the
"valuewrapper"/"novaluewrapper" features to fix some
of the old broken cases. Note, however, that not all
the broken cases can be solved in that way.

The new mechanism seems to be working fine in perl, ruby
and tcl, but failing in some typemaps in java.

Hence, is upto the language maintainer to test it, and
decide to enable it or not.

Look at the valuewrapper_opaque.i for examples.

- Fix more SwigValueWrapper cases when the new mechanism
is active. Now it also check for local typemap
variables, see valuewrapper_opaque.i for an example when
this is needed. But again, this extra checking will only
be activated when using the new value wrapper mode.

- [Python] Fix variable wrapping of classes with private
assign operators. It should be easy to fix in all the
other modules, instead of checking

if (!Getattr(n,"immutable")) ...

you need to verify

if (is_assignable(n)) ...

Look at the private_assign.i for an example.

10/18/2004: mmatus
- %features "director"/"nodirector" now work as expected.
- General fixes in %feature to resolve function decl
properly,

%feature("hello") foo();
char foo() -> f() // was working
char *foo() -> f().p // it wasn't


- Template + specialization + default template args now is
working, (don't confuse with template + default arg
values, that was solved before), now this ugly case is
working:

template <class T, class A = Alloc<T> >
struct Vector
{
Vector(T a){}
};

template <>
struct Vector<double>
{
Vector(){}
int foo() { return 0; }
};

%template(V_c) Vector<char, Alloc<char> >;
%template(V_i) Vector<int>; // picks Vector<int,Alloc<int> >
%template(V_d) Vector<double>; // picks the specialization

this is needed for automatic STL support (later will
be).

- Fix the template + typedef errors in test-suite, which
probably will fix another group of strange template +
namespaces + typedefs errors.

- %warnfilter is working better now, parser.y tries to use
them when needed.

- **** New default type resolution method (stype.c) *****

It preserves the original mixed types, then it goes
'backward' first deleting the qualifier, then the inner
types, for example:

typedef A *Aptr;
const Aptr&;
r.q(const).Aptr -> r.q(const).p.SWIGTYPE
r.q(const).p.SWIGTYPE -> r.p.SWIGTYPE
r.p.SWIGTYPE -> r.SWIGTYPE
r.SWIGTYPE -> SWIGTYPE

enum Hello {};
const Hello& hi;
r.q(const).Hello -> r.q(const).enum SWIGTYPE
r.q(const).enum SWIGTYPE -> r.enum SWIGTYPE
r.enum SWIGTYPE -> r.SWIGTYPE
r.SWIGTYPE -> SWIGTYPE

int a[2][4];
a(2).a(4).int -> a(ANY).a(ANY).SWIGTYPE
a(ANY).a(ANY).SWIGTYPE -> a(ANY).a().SWIGTYPE
a(ANY).a().SWIGTYPE -> a(ANY).p.SWIGTYPE
a(ANY).p.SWIGTYPE -> a(ANY).SWIGTYPE
a(ANY).SWIGTYPE -> a().SWIGTYPE
a().SWIGTYPE -> p.SWIGTYPE
p.SWIGTYPE -> SWIGTYPE

before it always stops after finding ref/pointer/enum/array/etc.

Now, then, you can define (use and apply) 'higher' typemaps such as:

%typemap(in) SWIGTYPE* const&
%typemap(out) char FIXSIZE[ANY]
%typemap(in) SWIGTYPE* const&
%typemap(in) const enum SWIGTYPE&
%typemap(in) SWIGTYPE[ANY][ANY]
%typemap(in) const char (&)[ANY]

It is possible with this change that previous typemaps
that were defined (but ignored), now will start to work.

Also, it is necessary check for the '%typemap(varin) SWIGTYPE[]',
before it was usually not defined (but char[] was),
and that can produce some inconsistencies.

*** POTENTIAL INCOMPATIBILITY ***

This change was needed for STL, since std::vector<enum Hello>
std::vector<A*>, etc, will always generate methods that
mix const references with the vector type.

Now that is working, all the std::container<T*>
specialization will not be needed anymore, well, in
theory.

In the practice, everythin is working as before until
the proper mixed types are defined and the libraries
simplified to use them.

- Change the behavior of extern "java"/"fortran"/"etc",
now swig produces a warning, and use extern "C" instead.
The warning can also be disable with the "-w 313" flag.
(WARN_PARSE_UNDEFINED_EXTERN).

- SwigValueWrapper is now more selective (lang.cxx).

[Perl/Tcl]
- Fix some typemaps (perl/tcl) to work properly with
SwigValueWrapper. This was not a problem with
SwigValueWrapper, but with the typemaps that now are
safe to use with %apply.

[Python]

- Fix %callback/%pythoncallback work now as before after
the def args changes. Also, %callback now is an alias
for %pythoncallback, so, they do the same.

[Python/Ruby]
- %callback is more usable and uniform:

%callback("%s_cb") foo(); // for both, python/ruby
%callback("%s_cb"); // for both, python/ruby
%callback(1) foo(); // only in python.

10/17/2004: arty
[OCAML]
- Tweak to enum typing for soundness in the presence of multiple
modules.
- global functions are now unambiguous in multiple loaded modules.
- Fixed test case code to build multimodule test cases correctly.
- There is no way to share overload resolution across modules
because of soundness issues. If the user wants to call some
function foo from an arbitrary module bar, they will have to
use Bar._foo to call it correctly. Later I will fix the
camlp4 module to do something clever in this case.
- Promided performance overhaul of class mechanism.
- Removed symbol hack for ocaml-3.07 and below which is not needed
for ocaml-3.08 and above.

10/16/2004: wuzzeb (John Lenz)
[CHICKEN]
- Completly change how chicken.cxx handles CLOS and generic code.
chicken no longer exports -clos.scm and -generic.scm. The clos
code is exported directly into the module.scm file if -proxy is passed.
- The code now always exports a unit. Running the test-suite is now
majorly broken, and needs to be fixed.
- CLOS now generates virtual slots for member variables similar to how
GOOPS support works in the guile module.
- chicken no longer prefixes symbols by the module name, and no longer
forces all names to lower case. It now has -useclassprefix and -closprefix
similar to how guile handles GOOPS names.

10/16/2004: wsfulton
Templated functions with default arguments working with new default argument
wrapping approach. The new approach no longer fails with the following default
argument pattern (previously failed with some primitive types, like
unsigned primitive types):

template<typename T> int foo(const T& u = T());
%template(foo) foo<unsigned int>;

This relies on the templated function overloading support just added, so all
the combinations of overloading by template parameters and normal parameters
as well as overloading with default parameters works.

10/16/2004: wsfulton
Added support for the large range of templated function overloading that C++
supports.

- Overloaded templated functions, eg

template<typename T> int overload(T t);
template<typename T> int overload(T t, const T &r);

- Fixes where the templated type is not used in the parameter list, eg

template<typename T> void xyz();
template<> void xyz<double>();

- Fixes for overloading of plain functions by a templated function:

void abc(double d);
template<typename T> void abc(T t);

- Overloading by templated parameters fixed:

template<typename T> void foo(T t) {}
template<typename T, typename U> void foo(T t, U u) {}

%template(foo) foo<double, double>;

- All combinations of the above also working including specializations, eg:

void abc(double d);
template<typename T> void abc(T t);
template<> void abc<double>(double t);
template<> void abc(int t);

10/16/2004: wuzzeb (John Lenz)
- Remove the ability to share type information by using c linking.
All type sharing happens through a global variable in the target language.
+ Remove SWIG_NOIMPORT, SWIG_RUNTIME, and related defines.
+ Deprecate -runtime, -noruntime command line options
+ Update test-suite common.mk to correctly build multicpptest
+ Remove reference to precommon.swg
+ Update the guile_gh interface to share data by a global var instead
of c linkage.

- Remove Advanced.html, since everything in it is now obsolete

10/09/2004: mmatus
- Split the python std/STL C++ library files, now
all the language independent definitions are under
the directory

Lib/std

and hence, can be used from other languages.

- Add more documentation to the Python STL, and
clean unnecessary code.

- Add initial C99 complex support, and some fixes
for long double.

10/08/2004: mmatus
- Fix the SwigValueWrapper for opaque types, now it is
applied for opaque templates and classes, for which we
don't know if there is or not a default constructor, ie

struct A {
A(int);
};

Still, if you know that you class has a default
constructor, and for some very very particular reason
you want to avoid the SwigValueWrapper, and you don't
want or can't expose the class to swig, now you can
say

%feature("novaluewrapper") A;
class A;

or the other way around, if the class has a default
constructor, but you want to use the value wrapper, you
can say

%feature("valuewrapper") A;
struct A {
A();
....
};

- Fix for char > 128, ie

const char tilde_a = '\341';

- Add patch 1041858 for $lextype, which carries the
literal type of a symbol. See lextype.i in the
test-suite for more details.




10/07/2004: wsfulton
{Ruby, Java] Fix director + 'empty' throws

struct A {
A() throw();
virtual ~A() throw();
int foo() throw();
};


10/06/2004: wuzzeb (John Lenz)
[TCL]
- Fix bug reported by William A. Hoffman propagating clientdata
between modules. Added clientdata_prop.multicpptest to check for
this bug. The fix involved the following changes:
+ SwigType_clientdata_collect does not need to check
types in r_resolved because we only want to propagate clientdata
to typedefed classes, and r_mangled already takes care of typedefs.

+ SWIG_TypeRegister now copies the clientdata field correctly

+ Move SWIG_Guile_PropagateClientData function from guile module
into common.swg, because we need to call it from both guile and tcl.

+ Add base_names to swig_class to delay the lookup of bases. SWIG
now exports the base names and only when the base swig_class is
needed is SWIG_TypeQuery(name)->clientdata looked up.

- conversion_ns_template testsuite test was failing because
the name of the wrapped constructor function was not calculated
correctly for structs. Fixed.

10/06/2004: wsfulton
Fixes for default arguments used in directors - in virtual
methods and director constructors.

10/06/2004: mmatus
Fix the __cplusplus macro, and bug 1041170.
Now it is working as supposed, ie, you can safely use

ifdef __cplusplus
...

all over swig, including inside %defines and %{ %} bodies.


*** POTENTIAL INCOMPATIBILITY ***

The old trick of using

if __cplusplus

doesn't work any more. So, if you have your own typemaps
using that syntax, you will need to migrate them to use
"ifdef __cplusplus".

10/05/2004: wuzzeb (John Lenz)
- Reorganize how runtime type information is stored and shared
between modules. For chicken and mzscheme, I removed
the ability to use runtime libraries, while perl, tcl, python, and
ruby default to using the new method but can go back to the old
method by declaring SWIG_ALLOW_RUNTIME.

- line 582 in mzscheme.cxx was generating a segfault on
imports.multicpptest, so I fixed it.

10/05/2004: wsfulton
Fixes for %extend and overloaded static methods with default
arguments.

10/05/2004: mmatus
- [python] Fix director + method with 'empty' throw, ie

struct A {
virtual int foo() throw();
};

other languages should also easy to fix, look for
Getattr(n,"throw") in python.cxx.

- Fix director + destructor with 'empty' throw

struct A {
virtual ~A() throw();
};

- Now SWIG_FEATURES parse all and the same options you
can pass to swig in the command line.

- New command line flag: -features <list>, as in

swig -features autodoc=3,director

ie, any global feature can be initialized from the
command line. This is mainly for testing, but users
can also take advantage of it.

10/04/2004: mmatus
- Properly qualify type in syntax as 'long(2)' or 'Foo()',
this solve old problem with default args, and probably
other problems around. However, the default arg problem
was also already solved by William (see below).

- Fix feature_set and feature_get methods. Before
they look from particular to general and keep the first
feature found. This didn't work well with templates.
Now the methods look from general to particular, and
override any found feature.

- Previously a feature could not be applied to constructors
or destructors that weren't explicitly declared in the class.
This is now fixed, for example:

%feature("featurename") Foo() "..."
%feature("featurename") ~Foo() "..."
class Foo {
// implicit Foo() and ~Foo()
};

- Fix missing features for default const/dest, by really
'creating' the methods and applying the features.

- Fix return_const_value.i case by adding SwigValueWrapper<const T>
specialization.

- Fix %extend + overload, including overloading actual
class methods.

- Adding more cases in related files in the test-suite.

10/04/2004: wsfulton
Changes to the way default arguments are wrapped. Previously a single
method was generated for each method that had default arguments. If
a method had 5 arguments, say, of which 1 had a default argument
then the call to the wrapped method would pass 5 arguments. The default
value was copied into the wrapper method and used if the scripting
language passed just 4 arguments. However, this was flawed as the
default argument sometimes does not have global access, for example
SWIG would generate code that couldn't compile when wrapping:

class Tricky {
public:
void foo(int val = privatevalue);
void bar(int val = Tricky::getDefault());
private:
static int getDefault();
enum { privatevalue = 200 };
};

Also bugs in resolving symbols generated code that wouldn't compile, for example
(probably fixable though):

namespace Space {
class Klass {
};
Klass constructorcall(const Klass& k = Klass());
}

The approach also does not work for statically typed languages (C and Java)
as these languages do not allow methods to have variable number of arguments.
Although C has a mechanism to pass a variable number of arguments they
must be of the same type and are more like varargs.

The new approach solves the above problems and wraps methods with default
arguments as if the method was overloaded. So SWIG will now treat

void foo(int val=0);

as if it had parsed:

void foo(int);
void foo();

The code generated is then exactly the same as if SWIG had parsed the two
overloaded methods. The scripting languages count the arguments passed and call
the appropriate method, just like overloaded methods. C and Java are now able
to properly wrap methods with default arguments by generating extra methods,
again as if the method was overloaded, so for:

void bar(string s="hello", double d=10.0, int i=0);

the following proxy methods are generated:

void bar(string s, double d, int i);
void bar(string s, double d);
void bar(string s);
void bar();

The new approach comes with a couple of minor knock on effects.

1) SWIG support for default arguments for C (not C++) code no longer works.
Previously you could have this interface:

%{
void foo(int val);
%}
void foo(int val=0);

and call the wrapped method from a scripting language and pass no arguments
whereupon the default of 0 was used. You can get the same behaviour for C
code by using the "default" typemap:

%typemap(default) int val "$1 = 0;"
%{
void foo(int val);
%}
void foo(int val);

or you could of course compile your code as C++ if you want C++ features :) :

%{
void foo(int val=0);
%}
void foo(int val=0);

A couple of SWIG's libraries used this C extension and these have been modified
to use the "default" typemap. The "default" typemap is thus unchanged (and still
is not and is not fully supported by C and Java, and is likely to remain so).


2) All features (%feature, %rename, %ignore etc) no longer work as if the method
with default arguments is just one method. For example, previously

%ignore foo(int);

would have ignored the method completely. Now it will only ignore foo(int) but
not the extra foo() method. Instead use:

%ignore foo;

to ignore them all. or

%ignore foo(int);
%ignore foo();

This of course allows one to fine tune the wrapping, for example one could use:

%rename(fooint) foo(int);
%rename(foodefaults) foo();
void foo(int val=0);

and call them from any language like so:

fooint(200)
foodefaults()

or for example ignore the extra overloaded method, so the defaults cannot be used:

%ignore foo();
void foo(int val=0);

*** POTENTIAL INCOMPATIBILITY ***

10/2/2004: mmatus
[Python]
- More cleaning up and uniformation on the Python Lib

- Added Robin's docstring patch, plus some fixes, plus
some extensions, see autodoc.i example in the test-suite,
and try using %feature("autodoc","extended").

This patch is not a complete solution for the
documentation problem, just enough to inform python about
the parameter list.

The expected swig documentation support is far far away yet.


10/1/2004: mmatus
- Fix the %callback feature (only used in ruby and python examples,
by now, but it should be generic), now member callbacks
are working again

- Fix wrapping of functions pointers like

std::ostream& std::endl(std::ostream&);

ie, the ones that return references or enums.

[Python] Add the %pythoncallback directive, which is
an improved version of %callback, ie,

%pythoncallback(1) foo;
%pythoncallback(1) A::bar;
%pythoncallback(1) A::barm;

int foo(int a) {
return a;
}

struct A
{
static int bar(int a);
int barm(int a);

};

int foobar(int a, int (*pf)(int a));

in python you can use

foo(2)
foobar(2,foo)
A.bar(2)
foobar(2,A.bar)

ie, no additional pointer elements are created, and
the original 'foo' and 'A.bar' can be used as parameters.

In the case of member function however, still you need
to use the special variable Class::<fnc_name>_cb_ptr, ie:

foobarm(3, a, A.barm_cb_ptr)

we will try to fix this situation also, but later.

[Python] Add more elements from the STL library, now
you can use

import std
std.cout << "hello " << 123 << std.endl

[Python] Fix in/out return mechanism, now swig will behave
as 1.3.21 but using a python list when needed. The problem
is that the types std::pair,std::vector,etc, use tuples,
and they interfer with the previous inout tuple type.

By using lists we solve the conflicts, swig acts as before,
but returns a list when more than one parameter are using
the OUT typemap. See the new inout.i example in the
test-suite.

*** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***

[Python] Much better error messages for bad arguments, now
you always get the argument number where the error occurred.

09/27/2004: wsfulton
Patch from Bill Clarke -
1) Warning emitted when -importall and -includeall is used together,
with -includeall taking precedence.
2) Ensure SWIGIMPORTED is always defined when a file is being
imported with %import. Note that this is not the same as SWIGIMPORT,
which gets defined in all generated wrapper files.

09/26/2004: mmatus

- add %feature("exceptionclass") to identify a class used
as exception. Before swig identified and marked a class
using the "cplus:exceptionclass" attribute. However, the
class needed to appear on an throw() statement. Now
swig keeps trying to identify the exception classes, as
before, but it also allows the user to mark a class by
using the %feature explicitly. (mostly relevant for
python and chicken)

[Python]

- fix -modern option + exceptions, which mix old class
style with the new one. So, we always need to emit
the "nonmodern" python code.

- add the "python:nondynamic" feature and its handler

now if you have

%pythonnondynamic A;

struct A {
int a;
int b;
};

then, in the python side

aa = A()

aa.a = 1 ok
aa.b = 2 ok
aa.c = 3 error, the class can not be extended dynamically.


Since this is a feature, you can use

%pythonnondynamic;

or

%pythondynamic; [ Note: %pythondynamic since deprecated ]

to force all the wrapped classes to be "nondynamic" ones.

The default, as in regular python, is that all the wrapped
classes are dynamics. So, careful with your spelling.

09/14/2004: mmatus
- Support the -I- option.

- Differentiate between %include <file> and %include "file".
This fix several corner cases.


[Python] Several patches:

- Normalize the Lib file names:
*.swg internal files,
*.i user files.

- Fix Char[ANY] typemaps, so they also delete any extra '\0' chars,
now they behave as before (1.3.21). Still, you can use
the SWIG_PRESERVE_CARRAY_SIZE macro if you need to
preserve the original size (see pystrbase.swg).

- Add the Char FIXSIZE[ANY] typemaps, to preserve the
original C array sizes (see above). Though, you can't
use them yet since %apply and arrays are not working
together.

- Add pyfragments.swg, now the user can add fragments
to override the default ones.

09/10/2004: wsfulton
Patch from Bill Clarke which fixes spurious preprocessor bug which
shows on Solaris and gcc, eg:
Warning(202): Could not evaluate '!defined(SWIGJAVA) &&
!(defined(SWIGCSHARP)'
Also fixes a bug where 'if "a" == "b" == 1' wouldn't have worked

09/10/2004: wsfulton
Restored multiple build directories for the test-suite. Patch from
Bill Clarke.

09/06/2004: wsfulton
Added the missing runtime.dsp Visual Studio project files for the
import examples to work.

1.3.22

==================================

09/03/2004: wsfulton
The swig.m4 macro for use with the Autoconf/Automake/Libtool has
been removed and is no longer installed. Please use the new and better
maintained version derived from swig.m4 in the Autoconf macro archive.
See http://www.gnu.org/software/ac-archive/htmldoc/ac_pkg_swig.html and
http://www.gnu.org/software/ac-archive/htmldoc/ac_python_devel.html.

09/01/2004: wsfulton
[Perl] Applied patch 1019669 from Christoph Flamm. Adds support
for %feature("shadow") in the same way as it works in Python. This
enables one to override the generated shadow/proxy methods, including
constructors and destructors. For example:

/* Let's make the constructor of the class Square more verbose */

%feature("shadow") Square(double w)
%{
sub new {
my $pkg = shift;
my $self = examplec::new_Square(_);
print STDERR "Constructed an {[ref($self)]}\n";
bless $self, $pkg if defined($self);
}
%}

class Square {
public:
Square(double w);
...
};

08/31/2004: mmatus
[Python] Incompatibility reported by Bill Clarke (llibcomputer.org):

If you are using Sun Studio 8 (and possibly earlier
versions) to compile the output produced by swig
1.3.22rc1, and you are using C++ and STL templates then
you need to use either "-runtime" or "-noruntime". If you
use neither of these options then you will probably get
compiler errors when trying to compile the wrapper file;
the error message will be like this: The name
SWIG_Python_ConvertPtr[...] is unusable in static
swigpy::traits_asptr[...] If you get this error message,
you need to regenerate your wrapper file using 'swig
-runtime' or 'swig -noruntime'.

You shouldn't get this problem with Sun Studio 9.

*** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***

08/26/2004: wsfulton
[Perl] Applied 932333 from Ikegami Tsutomu. Fixes long long *OUTPUT
and unsigned long long *OUTPUT typemaps in typemaps.i.

08/26/2004: wsfulton
Applied patch 857344 from Art Yerkes. Workaround for autoconf bug when
running 'make install'.

08/26/2004: wsfulton
[Perl] Part of patch 982753 applied. This implements a %perlcode directive.
It allows one to add Perl code to the generated .pm file. Works the same
as %pythoncode.

08/26/2004: wsfulton
[Java] Fix for directors when wrapping virtual methods with exception
specifications that were not simple types. Previously code was generated that
didn't compile, for example when the exception specification was a pointer.

08/25/2004: wsfulton
[C] Typemap fix for methods that return char *. The CLR would incorrectly
delete the memory pointed to by char *. Also applied the same correction to
the char array typemaps.

08/24/2004: wsfulton
Fixes for -fmicrosoft error/warning message display:
- End of file (EOF) warning messages not displaying in correct format
- Some messages containing a file path were displaying a double backslash
instead of a single backslash

08/23/2004: wsfulton
Applied patch 1011604 submitted by Charles Schwieters. Fix for 64 bit tcl
interpreters.

08/23/2004: wsfulton
Fix for bug 875583 - enum forward declarations previously gave a syntax error.

08/23/2004: mkoeppe
[Allegro CL] Use typemaps "ffitype" and "lisptype" to determine the FFI type
specifiers from the C type. This makes it possible, for instance, to control
whether a C "char" argument takes a Lisp character or a Lisp integer value.
The default (taking Lisp characters) is done by these built-in typemaps:
%typemap(ffitype) char ":char"
%typemap(lisptype) char "character"
If char means an integer instead, use these typemaps:
%typemap(ffitype) char ":char"
%typemap(lisptype) char "integer"

08/22/2004: wsfulton
As discussed in bug 772453, the SWIG library directory is now installed
into a different default directory. The library used to be installed to
/usr/local/lib/swig1.3. It is now in the more usual architecture independent
directory and I have additionally used a version specific subdirectory as
the library will rarely work with older versions of SWIG. This release
will thus use /usr/local/share/swig/1.3.22 by default, which can be
tailored as before using './configure --swiglibdir'.

08/17/2004: mkoeppe
[MzScheme] Add support to create native MzScheme structures from C structures.
To convert a C structure to an MzScheme structure, use the new runtime macro
SWIG_NewStructFromPtr in a typemap. Patch from Dmitriy Zavin.

08/12/2004: wsfulton
Patch 837715 from Ben Reser to correctly detect Python lib directory
on 64 bit systems.

08/12/2004: wsfulton
[C and Java] Prevent memory leaks in the case of early return
from wrapper methods using const std::string & parameters. Modified
Mark Traudt patch 951565.

08/12/2004: wsfulton
Bug 943783 with patch fixes php char * out typemap NULL values.

08/03/2004: Ahmon Dancy <dancydancy>

[allegrocl] Additional case mode fixes. Also, make sure
foreign types are exported.

07/24/2004: mkoeppe
[Guile] In -scm mode, SWIG modules now exchange their pointer type
information via the Guile interpreter. It is no longer necessary to build a
runtime library or to use -noruntime and -runtime etc.

The module (Swig swigrun) which was introduced in the change of 05/17/2004 is
no longer automatically built. If you need it, run SWIG on the interface file
swigrun.i.

07/23/2004: wsfulton
[C] Bug 917601 Mapping C++ bool fix from Mark Traudt

07/23/2004: wsfulton
RPM fixes for latest CVS version including removal of runtime
library.

07/23/2004: wsfulton
Patch 908955 from Robert H De Vries.
RPM file generation fix for Fedore Core 1 and Redhat AS2.1.

07/12/2004: wsfulton
Patch 864689 from Robin Dunn:

This patch corrects two problems in the XML output of SWIG:

1. There were often extra '/>\n' in the output.

2. value attributes were output with '\n' in them but
since that is not technically legal most (all?) XML
parsers will strip them out. Replacing the '\n' with
the '&10;' entity reference solves this as that is
legal and XML parsers will convert it to a '\n' when
reading the values back in.

This patch also adds a new global command line option
that will allow the parse tree to be written out in XML
*after* some other language module has been run, in
order to be able to get extra info that the language
module puts in the tree. In this way the XML is a
post-processed version of the tree rather than a
pre-processed version.

Command line option is -dump_xml or -xmlout <file>

07/12/2004: wsfulton
[Java] Patch from Scott Michel to fix typesafe enums and proper enums
with directors.

07/12/2004: wsfulton
HTML documentation (makechap.py) file generator missing end of line
patch 908951 from Robert de Vries.

07/08/2004: wsfulton
The deprecated runtime library build has been removed. This also removes
the dependency on Libtool. Libtool is no longer required to build SWIG.
The associated -ldflags SWIG commandline option has also been removed.

The examples and test-suite testcases that used the runtime library have
been updated to use the replacement approach to using SWIG across
multiple modules, that is they use the -noruntime and -runtime commandline
options, see Modules.html. Effectively they build their own runtime
libraries using -runtime. The examples are import and import_template.
The test cases are in the imports and template_typedef_import directories.

Anyone who wants the original runtime libraries can either run the test-suite
or build the examples and use the appropriate shared object/DLL that is
generated with the -runtime commandline option. For example libimports_runtime.so
(Python calls it lib_imports_runtime.so) is generated after running the
'make imports.multicpptest' testcase in the Examples/test-suite/<lang>
directory. Or use libruntime.so / runtime.dll after building the import
examples in Examples/<lang>/import.

07/07/2004: mkoeppe
[Allegro CL] Convert character and string literals in constants to
CL syntax. Fix FF:DEF-FOREIGN-CALL for mixed-case C functions.

06/27/2004: wsfulton
[Java] New feature for Java exceptions with format %javaexception(exceptionclasses).
This feature is a slight enhancement to %exception and the only difference is the
addition of the exception classes which are generated into a throws clause.
The 'exceptionclasses' is a comma separated list of classes which will be
added to the associated proxy method's throws clause. The 'exceptionclasses'
are specified like the exception classes in the 'throws' attribute in the
typemaps. This feature should be used for correctly handling checked exceptions
thrown from JNI code. For example:

%javaexception("java.lang.Exception") throwException %{
... convert a std::logic_error into a java.lang.Exception using JNI code ...
%}

include <stdexcept>
void throwException() {
throw std::logic_error("Logic error!");
}

will generate a method with a throws clause in the module class:

public static void throwException() throws java.lang.Exception { ... }

06/27/2004: wsfulton
[C] New %csconstvalue(value) feature directive for use with constants and
enums. This works the same way as %javaconstvalue. For C, this directive
is the only way that one can fix wrapping of C/C++ enums with proper C
enums if the enum item's initialiser cannot compile as C code. This is
because Java enums can use a call into C code to initialise the enum item,
whereas in C, the enum value must be a compile time constant. That is,
using %csconst(0) cannot be used in C to initialise the C enum item via
a PINVOKE call.

06/27/2004: wsfulton
[Java] New %javaconstvalue(value) feature directive for use with constants and
enums. Sometimes the use of %javaconst(1) will produce code that won't compile
under Java. If a compile time constant is required, %javaconst(0) is not an
option. The %javaconstvalue directive achieves this goal and the value specified
is generated as Java code to initialise the constant. For example:

%javaconst(1);
%javaconstvalue(1000) BIG;
%javaconstvalue("new java.math.BigInteger(\"2000\")") LARGE;
%javaconstvalue(10) bar;
%{
const int bar = 10;
%}
%inline %{
define BIG 1000LL
define LARGE 2000ULL
enum Foo { BAR = ::bar };
%}

Generates:

public interface exampleConstants {
public final static long BIG = 1000;
public final static java.math.BigInteger LARGE = new java.math.BigInteger("2000");
}
public final class Foo {
public final static Foo BAR = new Foo("BAR", 10);
...
}

Previously, none of BIG, LARGE or BAR would have produced compilable code
when using %javaconst(1).

06/27/2004: wsfulton
%feature enhancements. Features can now take an unlimited number of attributes
in addition to the feature name and feature value. The attributes are optional
and are much the same as the typemap attributes. For example, the following
specifies two optional attributes, attrib1 and attrib2:

%feature(featurename, attrib1="attribval1", attrib2="attribval2") name "val";
%feature(featurename, val, attrib1="attribval1", attrib2="attribval2") name;

06/27/2004: wsfulton
%feature improvements for the syntax that takes the feature value within the
%feature() brackets. The value specified is no longer restricted to being just
a string. It can be a string or a number. For example, this is now acceptable
syntax:
%feature("featurename",20.0);
whereas previously it would have to have been:
%feature("featurename","20.0");
Useful for features that are implemented as a macro, for example:
define %somefeature(value) %feature("somefeature",value)
These will now work accepting either a string or a number:
%somefeature("Fred");
%somefeature(4);

06/06/2004: wuzzeb (John Lenz)
[Chicken, Guile]
- Created the Examples/test-suite/schemerunme directory, which holds all the
runme scripts for guile and chicken (and possibly mzscheme...). The guile
and chicken _runme files then (load "../schemerunme/foo.scm").
- In chicken module, fix a few bugs invlolving dynamic casts.

06/03/2004: wsfulton
Patch to fix wrapping of templated methods. ISO compliant compilers, like
Comeau and GCC-3.4.0, don't like the template specifier that SWIG was generating
when calling the method. This fix may break some non standard compliant compilers,
for example, Sun workshop compilers prior to version 6.2.p2. Patch submitted
by Bill Clarke.

06/03/2004: wsfulton
[Java, C] Undocumented special variable $imclassname removed.
New special variable $module is replaced by the module name, as specified
by %module or -module commandline option. $imclassname can be created from $module.

06/03/2004: wsfulton
[C] Same as for Java below. The new typemaps are named differently, namely,
csbody and csbody_derived. The deprecated typemaps are csgetcptr and
csptrconstructormodifiers.

*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***

06/03/2004: wsfulton
[Java] Typemap changes for the Java proxy / typewrapper and enum classes. A new
typemap called javabody contains the essential support code for generation into the body
of these classes. There is also a new javabody_derived typemap which is used instead for
wrapped classes that have a wrapped base class. The code is basically, the getCPtr()
method and swigCPtr and swigCMemOwn member variables. These used to be hard coded
with no way to modify the code. The introduction of this typemap makes it possible for
the user to tailor nearly every aspect of the code generation.
The exception now is the code for director classes.

The javagetcptr and javaptrconstructormodifiers typemaps are deprecated and are
no longer used as the code that these generated can be put in the more flexible
javabody and javabody_derived typemaps.

*** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***

The following macros contributed by Scott Michel may help you upgrade if you have used
the javagetcptr typemap:

/* Utility macro for manipulating the Java body code method attributes */
%define SWIGJAVA_ATTRIBS(TYPENAME, CTOR_ATTRIB, GETCPTR_ATTRIB)
%typemap(javabody) TYPENAME %{
private long swigCPtr;
protected boolean swigCMemOwn;

CTOR_ATTRIB $javaclassname(long cPtr, boolean cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = cPtr;
}

GETCPTR_ATTRIB static long getCPtr($javaclassname obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
%}

%typemap(javabody_derived) TYPENAME %{
private long swigCPtr;

CTOR_ATTRIB $javaclassname(long cPtr, boolean cMemoryOwn) {
super($moduleJNI.SWIG$javaclassnameUpcast(cPtr), cMemoryOwn);
swigCPtr = cPtr;
}

GETCPTR_ATTRIB static long getCPtr($javaclassname obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
%}
%enddef

/* The default is protected getCPtr, protected constructor */
SWIGJAVA_ATTRIBS(SWIGTYPE, protected, protected)

/* Public getCPtr method, protected constructor */
%define PUBLIC_GETCPTR(TYPENAME)
SWIGJAVA_ATTRIBS(TYPENAME, protected, public)
%enddef

/* Public getCPtr method, public constructor */
%define PUBLIC_BODYMETHODS(TYPENAME)
SWIGJAVA_ATTRIBS(TYPENAME, public, public)
%enddef

06/03/2004: wsfulton
[Java, C] The contents of the class modifier typemaps and pragmas have changed.
They must now include the class type. Previously 'class' was hard coded.
This change enables flexibility into what type of class is generated,
for example the proxy class could be an interface instead of a class.

For Java this affects the javaclassmodifiers typemap and the jniclassclassmodifiers
and moduleclassmodifiers pragmas.

For C this affects the csclassmodifiers typemap and the imclassclassmodifiers
and moduleclassmodifiers pragmas.

Unless you have overridden the default versions of these typemaps or pragmas, you
shouldn't be affected. However, if you have, upgrading is easy, for example

class Foo {};
%typemap(javaclassmodifiers) Foo "public final"

must now be:

class Foo {};
%typemap(javaclassmodifiers) Foo "public final class"


*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***
*** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***

05/31/2004: wsfulton
Fix for C++ exception specifications that are references. Problem reported by
Oren Miller. Also improves the generated exception declarations in the
catch handler for pointers - a pointer is used instead of a reference to
a pointer. Added default throws typemaps for SWIGTYPE &, SWIGTYPE * and
SWIGTYPE[ANY] (Java and C).

05/31/2004: wsfulton
[Java, C] Some minor typesafe enum improvements, including storing the name of
the enum item. The toSring() / ToString() methods are overridden to return this name.

05/30/2004: wuzzeb (John Lenz)
[Chicken]
- Update how examples and the test suite are built.
- Symbol names are no longer converted to lower case
- Added union_runme.ss, which was copied and modified from the guile module

05/26/2004: lballabio (Luigi Ballabio)
Committed on behalf of Marcelo (who still has problems with
the SourceForge CVS.)

Added Python typemaps for FILE* with (Python-only) test.

5/24/2004: dancy

* Allegro CL module: Now using some macros (defined in
Lib/allegrocl/allegrocl.swg), swig-defconstant and swig-defun, for
defining constants and foreign functions. This makes the
generated file a bit neater.

Now strips a layer of parenthesis from constants.

Uses (* :void) instead of :foreign-address now.

05/20/2004: wsfulton
Unnamed enum global variables are now supported in addition
to the recently added support for unnamed enum member variables.
For example:

struct Foo {
enum { enum1, enum2 } MemberInstance;
};
enum { enum3, enum4 } GlobalInstance;

The int typemaps are used for wrapping the get/set accessor methods.
If the sizeof an enum is not the same size as an int then setting the
variable will silently do nothing as the casts cannot be easily and portably
generated. If you need to solve this highly obscure situation, write
the assignment using the %exception feature.

05/20/2004: wsfulton
[C] C enum wrapping mods. Similar to the Java module, enums can be wrapped using
one of 3 approaches:

1) Proper C enums - use %include "enums.swg"
2) Typesafe enums - use %include "enumtypesafe.swg"
3) Simple constant integers (original approach) - use %include "enumsimple.swg"

See each of these files for further details. Each of these files use typemaps
and a new feature to control the generated code. The feature is:

%csenum(wrapapproach);

where wrapapproach should be one of: "proper", "typesafe", "typeunsafe" or "simple".
[No implementation deemed necessary for type unsafe enums].

The default approach is proper C enums. Anonymous enums are always wrapped by
constant integers.

*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***

05/20/2004: wsfulton
[Java] Java enum support added. There are now 4 ways in which enums can be wrapped:

1) Proper Java enums - use %include "enums.swg"
2) Typesafe enums - use %include "enumtypesafe.swg"
3) Type unsafe enums (constant integers) - use %include "enumtypeunsafe.swg"
4) Simple constant integers (original approach) - use %include "enumsimple.swg"

See each of these files for further details. Each of these files use typemaps
and a new feature to control the generated code. The feature is:

%javaenum(wrapapproach);

where wrapapproach should be one of: "proper", "typesafe", "typeunsafe" or "simple".
The default typemaps will handle enums that may or may not have specified initial
values, for example ten is specified:

enum Numbers { zero, ten(10) };

However, the amount of generated Java code can be cut down, by modifying these typemaps
if none of the enums have initial values (proper Java enums and typesafe enums approach).

The default approach is typesafe enums. Anonymous enums are always wrapped by
constant integers.

*** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***

05/11/2004: wsfulton
[Java, C] Fix bug using %rename on enum items and when using
%javaconst(1) / %csconst(1)
For example, the following used to generate code that wouldn't compile:

%rename(Obj) Object;
enum Grammar { Subject, Object };

04/28/2004: wsfulton
[Java, C] Minor fixes when using combinations of the
javainterfaces, javabase, csinterfaces and csbase typemaps.

05/18/2004: wsfulton
[Java] JVM link failure on some systems fixed when using std_vector.i.
Also adds default vector constructor for use from Java.

05/17/2004: mkoeppe (Matthias Koeppe)

[Guile] New runtime functions SWIG_PointerAddress,
SWIG_PointerType, SWIG_IsPointerOfType, SWIG_IsPointer.

[Guile] In -scm mode, wrap several SWIG runtime functions
and export them into the module (Swig swigrun). The
runtime module is now built with "module" linkage.

[Guile] GOOPS proxy objects now also print the pointer
address of the C object.

05/14/2004: lyle
Added Kou's patch for the Ruby %import directive so that modules
with "nested" names are handled properly. Consider an interface
file foo.i that has this %module declaration at its top:

%module "misc::text::foo"

Now consider another interface file spam.i that imports foo.i:

%import foo.i

Before this patch, this would result in the following code being
generated for spam_wrap.c:

rb_require("misc::text::foo");

With this patch, however, you'll get the correct path name
for the call to rb_require(), e.g.

rb_require("misc/text/foo");

See SourceForge Bug 928299.

05/12/2004: wsfulton
Patch for emitting directors when %feature("director") specified
for a class with no virtual methods, but does have a virtual destructor.
Submitted by Kevin Smith.

05/06/2004: mkoeppe (Matthias Koeppe)
New SWIG runtime function SWIG_TypePrettyName, which
returns an unmangled type name for a swig_type_info
object.

[Guile]: Use it for printing pointer objects.

05/03/2004: dancy (Ahmon Dancy)

* Lib/allegrocl/allegrocl.swg: Updated comments about identifer
conversion.

* Sources/Modules/allegrocl.cxx: Register /dev/null for "header"
target. Also, disregard "const" qualifiers during type
conversion.


05/02/2004: wuzzeb (John Lenz)
[Chicken] Fix bug 782468.
To fix this bug, the runtime code has been rewritten, and
pointers are now represented as a C_SWIG_POINTER_TYPE.

Chicken version > 1.40 is now required!

* Typemap incompatibility: typemaps no longer use chicken_words.
If a typemap needs some space, it should just call C_alloc

* argout typemaps no longer use the /* if ONE */ construct to
build an output list. A SWIG_APPEND_VALUE macro, exactly like
guile and mzscheme is now used.

04/25/2004: mkoeppe (Matthias Koeppe)
[Guile] In the generated GOOPS code, don't create methods
that would not specialize any arguments; simply re-export
the primitive functions. (This is a performance
optimization which reduces load time and execution time.)

[Guile] In -gh mode, fix the "too many initializers" error
which was caused by an incompatible swig_type_info layout.

[Guile] The typemap for FILE * in ports.i now also accepts
a regular FILE * pointer object. Also a bug with Scheme
file ports that are open for input and output has been
fixed.

04/25/2004: wsfulton
Change entry 03/21/2004 revoked. The change introduced another
inconsistency (reference typemaps beings used instead of
pointer typemaps for member variables as well as static
member variables and global variables for some languages,
but only for C++ and not C). This would break user's current
typemaps and introduce further inconsistencies. Alternative
solution required and being discussed.

04/10/2004: mmatus (Marcelo Matus)

Added the -directors flag. This enables the director
mode for the interface and all the classes that
don't set the "feature:nodirector" explicitly.

You can use this in your module if you want to use the
director feature in all your classes, but it is most
intended for testing purposes, like:

make check-python-test-suite SWIG="../../../swig -directors"
make check-ruby-test-suite SWIG="../../../swig -directors"
make check-java-test-suite SWIG="../../../../swig -directors"

These commands will run the entire test-suite using
directors, and not only the specific 'directors_*'
cases. This should be done from time to time.

04/10/2004: mmatus (Marcelo Matus)

[python] Added support for std::wstring and wchar_t,
for compiler and python versions that support them.

When needed, use

%inlcude std_string.i // 'char' strings
%inlcude std_wstring.i // 'wchar_t' strings


04/10/2004: mmatus (Marcelo Matus)

[python] Fix the default behaviour (seg. fault) when an
inplace operator (+=,-=,...) was wrapped, as reported by
Lucriz (lucrizsitilandia.it), when the most common
form was used:

A& A::operator+=(int i) { ...; return *this; }
^^^^ ^^^^^^


ie, an object is returned and its contains the same 'this'
value than the input object, which is deleted after the
operation "a += b", leaving the result with no real
object, but a seg. fault.

To fix it, we needed to introduce a new feature and use an
old one:

%feature("self:disown") A::operator+=;
%feature("new") A::operator+=;

here, "self:disown" disable the ownership of the 'self'
or input object, and the "new" feature transfers the
ownership to the result object.

The feature/solution could also be used in other languages
that use gc and implement the inplace operators, or other
operators, in a similar way.

*** POTENTIAL INCOMPATIBILITY FOR Python MODULE ***

If you already are using the inplace operators in python,
and you implemented some kind of workaround to the problem
fixed here, it is possible you could end with 'free'
objects that never get deleted. If that is the case, and
you want to disable the current fix, use:

%feature("self:disown","") A::operator+=;
%feature("new","") A::operator+=;


04/07/2004: cheetah (William Fulton)
[C] C++ enums are no longer wrapped by integers, they are now wrapped by
C enums. For Example, given C++:

enum AnEnum { foo, bar };
typedef AnEnum AnEnumeration;
void something(AnEnum e, AnEnumeration f);

The following is generated:

public enum AnEnum {
foo,
bar
}
public static void something(AnEnum e, AnEnum f) {...}

Note that a global enum like AnEnum above is generated into its own
file called AnEnum.cs. Enums defined within a C++ class are defined
within the C proxy class. Some of the typemaps for modifying C proxy
classes also work for enums. For example global enums can use

%typemap(csimports) to add in extra using statements.

Global enums and class enums can use

%typemap(csclassmodifiers) to make the enum private, public etc.
%typemap(csbase) to change the underlying enum type (enum base)

If we add this for the above example:

%typemap(csclassmodifiers) AnEnum "protected"
%typemap(csbase) AnEnum "long"

the following is generated:

protected enum AnEnum : long {
foo,
bar
}

*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***

04/07/2004: cheetah (William Fulton)
Seg fault fix for empty enums, like
enum Foo {};

03/21/2004: mmatus
[Note: this change revoked on 04/25/2004]
[Python] Makes the following 'var' cases more uniform:

std::string ga;

struct A {
static std::string sa;
std::string ma;
};


now the three variables (ga, sa, ma) can be assigned as:


cvar.ga = "hello";
A.sa = "hello";
a.ma = "hello";

ie, now 'ma' will also use a std::string typemap 'in' if
defined, before it was only accepting a 'p_std_string'
pointer. Note, however, that 'ma' will not use the
'varin/varout' typemaps (that probably could be more
natural), but it will pick up the 'in' typemap for const
std::string& (which is easier).

The changes in cwrap.c and lang.cxx will probably fix the
behaviour in other languages that do not overload the
membervarHandler method "too much".


03/21/2004: mmatus
[Python] Disabling the default instantiations like:

%template() std::pair<int,int>;

for all the primitive types and STL containers/classes.
They are expensive, specially for pair and map, and the
previous behaviour also requires the user to perform
manual instantiations. Still, if the speed difference is
not important, it can be re-enabled by defining the macro
SWIG_STD_DEFAULT_INSTANTIATION (see std_common.i).

Also, normalizing the INPUT/OUTPUT/INOUT typemaps. Now
they use the same conversors than the rest of the
typemaps, and you can use them for std::pair, std::string
and all the other STL types, like in:

void p_inoutd(std::pair<double, double> *INOUT);

Added the attribute.i and implicit.i files with macros to
transform functions pairs like 'set_x'/'get_x'
(or 'T& x()'/'const T& x() const') into an attribute,
and allowing the use of implicit constructors in typemaps
(see the files for more details).

03/21/2004: mkoeppe
[Guile] Fix the documentation strings of functions with
anonymous arguments.

03/18/2004: mmatus
[Python] More general std_string.i interface.
Now you can wrap it using

%template(string) std::basic_string<char>;

and use the std::string as a base class:

struct A : std::string {
};

But more important, swig will recognize
both std::basic_string<char> and std::string as
the same type.

03/16/2004: mmatus
Previously added, but not mentioned before:

- friend declaration support, swig now emits a global
function in the same class scope.

- ref/unref features: to mix ref counting C++ classes
and native script ref counting mechanisms (like in python).

Use it like:

%feature("ref") RCObj "$this->ref();"
%feature("unref") RCObj "$this->unref();"

And the class RCObj, and all the derived ones, will
perform the right ref/unref calls when a new pointer
is returned to the target language, or when the target
language attempts to delete the object.

See the refcount.i file in the test-suite for more
details.


03/16/2004: mmatus
[Python] Using the new %fragment support, major rewrote
of the python swig library, including:

- Almost automatic template/typemap instantiation for
the STL components. For example, now you can write:

%template(vector_i) std::vector<int>;

and a specialized vector_i class is emitted with all
the needed typemaps. No need to use the old
'specialize_vector' macros.

Note you can also define

%template(matrix_i) std::vector<std::vector<int> >;
%template(vector_pii) std::vector<std::pair<int,int> >;

- The empty template instantiation

%template() std::vector<int>;

defines the vector typemaps, but no proxy class. For all the
fundamental types, the empty template instantiation are
defined, so, you can say

%include std_vector

int func(const std::vector<int>& a);

where the proper typemap is applied to 'a', but no
std::vector<int> proxy is generated.


- All the STL containers present a more uniform behavior and
more complete interface declaration. The following are
now supported:

std::vector<T>
std::list<T>
std::deque<T>
std::set<T>
std::multiset<T>
std::map<T>
std::multimap<T>

not a container, but also supported:

std::pair<T,U>

also, more typemaps are defined for all of them,
including varin, varout, typecheck, etc.

- Initial attempt to implement the STL containers
considering allocators, ie:

std::vector<T,A>

it is partially working, but it is just a workaround
while swig improves its template type support.


Please test with your particular setup. It seems to be
working with g++ 3.2.2, g++ 2.96, Intel icc and SGI CC
compilers, plus python 1.5.2, 2.0 and 2.3, but since
we are using templates, there is a chance you can find
some problems when using with an old C++ compiler.

03/16/2004: mmatus

- Allowing the empty %template directive, such as

%template() std::vector<int>;

to process the class "typedef"s and "typemap"s. Before
only the internal "typedef"s were processed.

This makes possible to emit the default in/out
typemaps without the need of wrapping an specialized
vector instance.

- Adding the preprocessor extension which mangles the
following macro argument, like in:

define macro(X) X
macro(int) -> int
macro(std::string) -> std_s_s_string

- Fragments can now be "type specialized", as the typemaps. The
syntax is as follows

%fragment("name","header")
{ /* a type independent fragment (old syntax) */ }
%fragment("name" {Type}, "header")
{ /* the fragment is type dependent */}

Now fragments can also be used inside templates:

template <class T>
struct A {
%fragment("incode"{A<T>},"header") {
/* 'incode' specialized fragment */
}

%typemap(in,fragment="incode"{A<T>}) {
/*
here we use the 'type specialized'
fragment "incode"{A<T>}
*/
}
};


03/11/2004: cheetah (William Fulton)
[Java] Director bug which meant that some virtual functions overridden in
Java were not being called on some operating systems. Bug reported and fixed
by Robert de Vries and Scott Michel.

03/02/2004: mkoeppe (Matthias Koeppe)
[Guile] In -scm mode, don't forget to check the type of string arguments.

02/24/2004: cheetah (William Fulton)
[C] New commandline option -namespace <name>. This allows one to specify
a C namespace into which all C classes are generated.

02/23/2004: mkoeppe (Matthias Koeppe)
[MzScheme] Use FUNC_NAME rather than a bogus typemap variable for signalling
errors. Call scheme_wrong_type with a zero-based argument number.
Reported by Ondrej Pacovsky, SF 902621.

[Guile] Define FUNC_NAME also in the dispatch wrapper for overloaded
functions. Patch by John Lenz, SF 896255.

02/22/2004: mkoeppe (Matthias Koeppe)
[Guile] In -scm mode, don't try to invoke a null destructor function.

02/20/2004: cheetah (William Fulton)
Fixes so that the SWIG source will compile using the Digital Mars Compiler
(formerly Symantic compiler) on Windows. Submitted by Scott Michel.

02/13/2004: mkoeppe (Matthias Koeppe)
[MzScheme] New command-line argument -noinit. Use it for building
the runtime library, where we don't want to define the functions
scheme_initialize etc. Reported by Tim Brown, SF 891754.

[MzScheme] Don't produce invalid C code when invoked with the
-declaremodule option. Reported by Tim Brown, SF 891108.

[Guile] Build the runtime library with passive linkage, to rename
the SWIG_init function uniquely.

02/12/2004: cheetah (William Fulton)
[Java, C] Patch submitted by Bill Hoffman which prevents SWIG from crashing
when a file for the typewrapper class cannot be opened.

02/11/2004: cheetah (William Fulton)
[Java, C] Overloading changes:
- Methods which are overloaded in const only no longer generate Java
code that won't compile - the first method parsed is used and a
warning is displayed. Note that this behaviour is slightly different
to the scripting languages which always uses the non-const method.
- Warning messages 509 and 512 replaced by new warning number 516, which
is more relevant to these statically typed languages as the overloaded
methods aren't 'shadowed', they are ignored.

01/23/2004: mkoeppe (Matthias Koeppe)
[Guile] Replace the "known_classes" hash table by a node
attribute. Methods of classes in C++ namespaces now get
the proper specializer in the GOOPS declaration.
Reported by rmmh-freiburg.de.

01/23/2004: mkoeppe (Matthias Koeppe)
[Guile] Uniquify the argument names in GOOPS shadow method
declarations. Reported by rmmh-freiburg.de.

01/21/2004: sunshine (Eric Sunshine)
Revived the NextStep port of SWIG.

Fixed fatal problem in DohStrstr() caused by difference in strstr()
implementation which made %apply become entirely dysfunctional. On
NextStep, strstr("foo","") evaluates to NULL; whereas, on modern
platforms, it evaluates to "foo". %apply relies extensively upon
strstr("foo","") evaluating to non-NULL, therefore it failed
catastrophically when faced with NextStep's strstr().

Added `bool' check to configure.in since NextStep's C++ compiler
does not supply this type. swig.h now fakes up `bool' if needed.

Worked around NextStep C++ compiler bug in which C++ code is
disallowed inside extern "C" functions. This problem affected all
language modules, since they publish hook functions of the form:
extern "C" Language *swig_foo(void) { return new FOO(); }
Fixed by creating a C++ wrapper:
static Language *new_swig_foo() { return new FOO(); }
extern "C" Language *swig_foo(void) { return new_swig_foo(); }

Ensured that Swig_copy_string() is used in place of strdup() since
NextStep does not supply strdup().

Fixed detection of Ruby library name and location in configure.in.
Problem 1: Assumed that library always resided in Ruby's "archdir",
which was correct for Ruby 1.6.x, but which is incorrect for Ruby
1.8.x, in which case the library normally resides in Ruby's
"libdir". Problem 2: Assumed that the library could always be
linked via "-l"+RUBY_INSTALL_NAME (where RUBY_INSTALL_NAME
typically is "ruby"), however this failed for platforms, such as
NextStep, which do not support shared libraries. In this case, the
static library name in 1.8.x is libruby-static.a, thus
-lruby-static is required. The new logic works correctly for
static and shared libraries for 1.6.x and 1.8.x.

Fixed detection of Perl CFLAGS in configure.in for NextStep.
Detection code extracted CFLAGS from Perl's %Config hash but
neglected to add a newline to the value before passing it through
`sed'. NextStep's ancient `sed' discards input which is not
terminated with a newline, thus Perl CFLAGS always evaluated to the
empty string.

01/16/2004: cheetah (William Fulton)
Tidy up in the exception handling code that is generated when
C++ exception specifications are wrapped with the throws typemap.
This redundant code is no longer generated:

catch(...) {
throw;
}

01/12/2004: wsfulton on behalf of mmatus (marcelo matus)
if a method uses %exception and the method requires the use
of the throws typemap, the code in a throws typemap will be
generated inside the try body. For example:

%exception method {
try {
// method action
$action
} catch (int i) {
// method int catch handler
} catch (...) {
// method generic catch handler
}
}
%typemap(throws) Except %{
// throws typemap Except catch handler
%}

%inline %{
class Except {};
void method(int i) throw (Except);

Will generate:

{
try {
// method action
try {
method(arg1);
}
catch(Except &_e) {
// throws typemap Except catch handler

}

} catch (int i) {
// method int catch handler
} catch (...) {
// method generic catch handler
}
}


As can be seen, the inner try catch block is for the throws typemaps.
Previously, this was reversed so that the inner try catch block
was the %exception code. In the example above, it would have been
impossible to catch Except as the catch all (...) would catch the
exception instead.

1.3.21

=================================

01/10/2004: cheetah (William Fulton)
The output format for both warnings and errors can be selected for
integration with your favourite IDE/editor. Editors and IDEs can usually
parse error messages and if in the appropriate format will easily take you
directly to the source of the error. The standard format is used by
default except on Windows where the Microsoft format is used by default.
These can be overridden using command line options, for example:

$ swig -python -Fstandard example.i
example.i:4: Syntax error in input.
$ swig -python -Fmicrosoft example.i
example.i(4): Syntax error in input.

01/09/2004: beazley
Fixed [ 871909 ] simple namespace problem.
This was a problem using anonymous structures in a namespace.
For example:

namespace ns {
typedef struct {
int n;
} S;
};

Reported by Josh Cherry.

01/09/2004: beazley
Fixed some broken Perl examples.

12/28/2003: cheetah (William Fulton)
[Java and C] Fixes for wrapping covariant (polymorphic) return types.
For example:

struct Base {
virtual ~Base();
virtual Base* copy() const = 0;
};
struct Derived : Base {
virtual Derived* copy() const;
};

The Derived::copy proxy method returns Base not Derived. A warning is issued
about this. Previously the pointer used by the proxy class was incorrectly
treated as a Base* instead of a Derived*.

12/18/2003: cheetah (William Fulton)
Fix so that Windows paths are displayed correctly when reporting errors.
An error previously would have been shown something like:

.?xample.i:14: Syntax error in input.

instead of:

.\example.i:14: Syntax error in input.

1.3.20

==================================

12/17/2003: beazley
Last minute modifications. Perl5 module now generates shadow classes
by default like all of the other modules. PHP4 wrappers no longer
include "config.h".

12/14/2003: beazley
Weakened warning message related to constructor names so that an
unusual nested-class wrapping technique would work again (apparently
it worked in some older SWIG releases). For example:

class Scope {
class ClassA;
class ClassB;
};
class Scope::ClassA {
...
};
class Scope::ClassB {
...
}

Note: There is still some odd interaction with the SWIG symbol
table/type system that will need to be looked at in a future release.
Reported by Gustavo Niemeyer.


12/11/2003: cheetah (William Fulton)
[Java] Protected class methods are wrapped as protected Java methods
when using the dirprot director feature. This can be changed using
%javamethodmodifiers to something else should the need arise, for
example, private or package access.

12/11/2003: cheetah (William Fulton)
[Java, C]
%javamethodmodifiers (Java) and %csmethodmodifiers (C) operate slightly
differently. Previously this feature had to be present to set the method
modifiers. Now it is only used if it exists for the method being wrapped.
The default is "public" as previous however, when wrapping protected
director methods it is "protected". This change will not affect existing
use of the %javamethodmodifiers or %csmethodmodifiers.

12/11/2003: mmatus (Marcelo Matus)

This fix some recurring reports about keywords not been
properly identified and warned, and it solves the problem
of how to add a test file to the test-suite such that it
doesn't use any keyword of all the supported languages
(and doing it without compiling the test for all the
supported languages, thing that is not always possible,
and without requiring you to know all the supported
language keywords, thing that is always impossible).

So these are the changes globally speaking:

- Uniform the definition of the keyword warnings through
the supported languages: all the languages has now a
separate file that defines the keywords or bad names:

python/pythonkw.swg
chicken/chickenkw.swg
....

- Added keyword list for most of the languages that didn't
have one (using the new separated file).

- Added the "All keywords" warning support: -Wallkw option.

This option allows you to include all the known keywords
for all the supported languages, and can be used as:

swig -Wallkw ....

This will help to the process of adding a test-suite
file that can be compiled in all the swig supported
languages, and it will be also helpful for users who
want to create multi-language libraries.

And these are the detailed changes (mostly file addition):

- For the languages that already have some sort of keyword
warning list, move it to an external languagekw.swg
file, ie:

move keywords from python.swg -> pythonkw.swg
move keywords from chicken.swg -> chickenkw.swg
move keywords from tcl8.swg -> tclkw.swg

and re-include languagekw.swg from language.swg.

- For the language that didn't have a keyword list, and
for the ones that I could find a list, add the
languagekw.swg file, ie:

csharp/csharpkw.swg
java/javakw.swg
php4/phpkw.swg
pike/pikekw.swg
ruby/rubykw.swg


also add a line in language.swg to include
languagekw.swg, but now it is commented!!!, like in
java.swg:

/* java keywords */
/* please test and activate */
//%include "javakw.swg"

ie, there will be no change in how swig runs normally
until the language maintainer test and uncomment that
line.

So, please check each languagekw.swg file (I left the
link to the keyword list source for checking), and after
testing, uncomment the %include line.

- Added the file allkw.swg, which includes all the
languagekw.swg files.

For the languages that has no languagekw.swg file right
now, and if they need one, add the file into the
language directory, and add the corresponding include
line into the allkw.swg file.

- Added the -Wallkw that includes the allkw.swg file.
Note that the old -lallkw.swg option couldn't be used
since it include the file after it would be needed.


Hopefully, the -Wallkw option will be added to the default
rules in the related test-suite Makefiles, so, when
creating a new test, or adding a new swig library file
(like _std_deque.i), swig will warn you if you are using a
bad name, considering all the language where it needs to
run.

Right now you can test it by using:

make check-python-test-suite SWIG="swig -Wallkw"

or using your favorite target language, it doesn't matter.

And yes, there are several examples that are using
reserved keywords, specially from csharp.

*** Remember ****: the new keyword warning lists are not
included by default in any of language that before didn't
have one. To enable the keyword warnings as the default
behavior, the inclusion of the languagekw.swg file has to
be uncommented at each language.swg file.

So, all the language maintainers, please check the
keywords list.

Also, you can add buit-in names, and not only keywords, like
'True/False' in python. Remember that you can be more
specific and refer only to member names, like *::configure
or *::cget (see an example in the tcl8/tcl8kw.swg file),
or only global names, like ::range (see an example in the
python/pythonkw.swg file.

Just to be consistent, use the following codes:

- Use code 314 for keyword and/or fatal bad names.
- Use code 321 for buit-in and/or not fatal bad names.

so, they can't be disabled/enabled independently (see
python/pyhtonkw.swg for examples).

**** And don't add any new test file without checking it
with the -Wallkw option!! (that includes me) *****.


12/11/2003: cheetah (William Fulton)
SF bug 854634
Added support for accepting the Unix directory separator '/' on
Windows and the Mac in addition to the native one ( '\' on
Windows). This can be used in %import, %include and commandline
options taking a path, for example -I. On Cygwin, both the Windows
and Unix directory separator can now be used (was '/' only).

12/10/2003: mmatus (Marcelo Matus)

[python] Implementing the runtime "reprotected" director
members, if you have:

%feature("director") B;

class Bar {
public:
virtual ~Bar();
virtual int hello() { return do_hello();)

protected:
virtual int do_hi() {return 0;}
virtual int do_hello() {return 0;}
};

then, at the python side

import my_module

class Foo(my_module.Bar):
def do_hello(self):
return 1
pass

b = Bar() Pure C++ Director class
f = Foo() C++ Director + python methods

b.hello() Ok, and it calls C++ Bar::do_hello()
f.hello() Ok, and it calls Python Foo::do_hello()

b.do_hi() RuntimeError, do_hi() is protected!!
f.do_hi() RuntimeError, do_hi() is protected!!

b.do_hello() RuntimeError, do_hello() is protected!!
f.do_hello() Ok, since it its redefined in python.

Here Bar.do_hello is always protected, but Foo.do_hello
is "public", because it is redefined in python. Before,
all the 'do_hello' methods were public.

This seems to be a good compromise between C++ and python
philosophies, ie, all the director protected methods keep
protected at the user side (C++ way) until they are
redefined (python way, were all defined methods are always
public). And this is not only a good compromise, it also
seems to be the only way to do it :).

Now ruby has native director protected members, and python
pure runtime support. I guess these are the two possible
extreme cases. And hopefully, they could be used as
templates to modify the other languages that support
directors, so they can "reprotect" the protected director
members at the target language side.

This finished the director protected support for the
python language. Ocalm will need to add the
"reprotection" later.

12/10/2003: mmatus (Marcelo Matus)

The following case (reported by Lyle Johnson) was fixed:

%rename(x) Foo::y();

class Foo {
public:
void y();

protected:
int x;
};

swig warned that the symbol 'x' was already defined, and
the renaming fails. 'x' was not emitted, since it is
protected, but it was kept in the symbol table with too
much information.

Now swig works for all the cases (plain, director and
dirprot) again. This was fixed by allowing the parser.y to
decide much closer what to do with 'x'. Before all the
discarding or generation was resolved at the lang.cxx
stage. Also the changes in parser.y to implement the
director protected mode are now much more encapsulated, and
they get disabled if the mode is not enabled. Before the
deactivation was done at the generation stage (lang.cxx).

By the other hand, if the director mode is enabled, and
%rename is done, reusing a protected member name, there is
a pathological case:

%rename(x) Foo::y();

class Foo : public A {
public:
void y();

protected:
int x; /* works */
static int x; /* works */
static void x(); /* works */
typedef void x(); /* works */

virtual void x(); /* always fails, as it should, since
Foo::x() will be emitted in the
director */

void x(); /* always fails, but sometimes it shouldn't,
since the Foo::x() will not be emitted if
it is not virtual */

};

The last case is not always right because at the parser.py
stage it is not possible to decide if the protected member
Foo::x() could or not conflict with the renamed Foo::y(),
since Foo::x() could be virtual by inheritance.

I guess this just an intrinsic limitation, and no much can
be done about it without resorting into larger changes to
postpone, under certain conditions, the multiply symbol
detection (lang.cxx stage).

So, by now, it is just considered a well known "feature" in
the director protected mode. The good news is that it seems
to be a rare case, and it can be avoided by the user by
hiding 'x' before renaming 'y':

%rename(_x) Foo::x();
%rename(x) Foo::y();


12/08/2003: mmatus (Marcelo Matus)
The virtual method detections now properly
treats the following cases:

namespace foo { typedef int Int; }
struct A {};
typedef A B;

struct Foo {
virtual ~Foo() {}

virtual Foo* cloner() = 0;
virtual int get_value() = 0;
virtual A* get_class() = 0;
virtual void just_do_it() = 0;
};

struct Bar : Foo
{
Bar* cloner();
foo::Int get_value();
B* get_class();
void just_do_it();
};

All the Foo and Bar methods are virtual. A new attribute
"virtual:type" record the base polymorphic type. In the
previous cases we have:

type : Bar virtual:type : Foo
type : foo::Int virtual:type : int
type : B virtual:type : A
type : void virtual:type : void

This attribute is useful in languages (java+directors)
that could have problems redefining Bar* Bar::cloner().

If you never had code like the above, you will see no
effects. But if you have some code like that, you
will see some effects since some methods that
before were not properly treated as virtual,
will start to act like that. This could enlarge
your director classes.


12/08/2003: mmatus (Marcelo Matus)
The director protected member support (dirprot)
is disabled by default.

It can be enable by using '-dirprot' or by adding
the option to the module declaration, like:

%module(directors="1",dirprot="1") my_module

This module option was added to properly compile the
director_protected.i and director_nested.i examples.

The feature has been tested with python[2.2,2.3]
and ruby[1.6.7], both at compilation and runtime, and
java[j2sdk1.4.1_01], but only at compilation (my java
installation doesn't run any of the director examples,
olds nor news).

Please test for ocaml and java.

The errors reported by William and Scott were fixed,
except for a warning about SWIG_JavaThrowExecption()
multiply defined. I can't reproduce this error with my
examples. We will wait for Scott to send us a minimal
case.


12/07/2003: mmatus (Marcelo Matus)
The director protected member support has been
completly moved out from python.cxx, and now
resides in the common lang.cxx, emit.cxx and
allocate.cxx files.

This means it should work for all the other languages
that currently support directors, ie, python, java, ocalm
and ruby.

The change has been tested with python (compilation+runtime)
and java (just compilation).

Please add runtime tests for the missing languages
and test it.

The '-nodirprot' option was moved to the principal main,
and can be used from all the languages.

12/07/2003: cheetah (William Fulton)
[Java] Fixed and improved error checking of STRING_OUT typemaps in
various.i.

12/04/2003: mmatus (Marcelo Matus)

- Now the virtual members with no explicit declarator
are properly identified:

struct A {
virtual int f() = 0;
};

struct B : A {
int f();
};

Here, B::f() is virtual, and the director and the
virtual elimination mechanism now recognize that.

- [C] This fix also fixes the problem where 'override' was not being
used on any overridden virtual method, so for struct B above,
this C code is generated:

public class B : A {
...
public override int f() {
...
}
...
}

- Initial support for protected virtual methods. They are now
properly emitted when using with director (python only by
now).

%feature("director") A;
struct A {
protected:
virtual int f1() = 0;
};

%feature("director") B;
struct B : A{
protected:
int f1();
virtual f2();
};

This can be disabled by using the '-nodirprot' option.

- The feature 'nodirector' is working now at the top level,
so, it must work for all the languages:

%feature("director") A;
%feature("nodirector") A::f2;

struct A {
virtual int f1();
virtual int f2();
};

in this case, only 'f1' is exported to the director class.

- Added director support for const TYPE& arguments (python).

12/02/2003: cheetah (William Fulton)
[Java] Fix for INOUT and OUTPUT typemaps in typemaps.i for when the JNI type
is bigger than the C type. For example, unsigned long (32bits on most systems)
is mapped to jlong (64bits). Returned value was incorrect. Bug reported by
Brian Hawley.

12/02/2003: cheetah (William Fulton)
[C and Java] Better fix for entry dated 05/11/2003. Fixes the following
typemaps:

Java: javabase, javainterfaces, javaimports, javaclassmodifiers,
javaptrconstructormodifiers, javafinalize, javagetcptr & javacode.
C: csbase, csinterfaces, csimports, csclassmodifiers,
csptrconstructormodifiers, csfinalize, csgetcptr & cscode.

It also fixes bug in using arrays of C structs with arrays_java.i
as reported Scott Michel.

12/02/2003: beazley
[Perl] Fixed [ 852119 ] recursive inheritance in output .pm, perl5.
Reported by William Dowling.

12/02/2003: beazley
[Tcl] Fixed [ 755382 ] calling func(const vector<T>& p) evaluates p[0] in interp.
The Tcl type checker was improperly handling the interpreter result when
type violations were supposed to be ignored.
Reported by Flaviu Popp-Nowak.

11/30/2003: cheetah (William Fulton)
Fixed [ 545058 ] configure's --with-tclincl has no effect

11/30/2003: cheetah (William Fulton)
[Java] Fixed [ 766409 ] missing symbol SWIG_JavaThrowException during module load
SWIG's internal functions are all static as there is no need for different SWIG
generated modules to share any code at runtime.

11/30/2003: beazley
[Tcl] Added support for C++ pointers to members.

11/28/2003: cheetah (William Fulton)
Fixed [ 848335 ] Directors: include wrapper .h file - was incorrectly
adding a directory to the generated include "foo_wrap.h" statement
in some situations.

11/28/2003: cheetah (William Fulton)
[Java] Fixed [ 849064 ] JAVA : Access modifier for derived class wrong.
The delete() method is always public now. It used to be protected whenever a
destructor was non public. An UnsupportedOperationException runtime
exception is thrown instead of making delete() protected now.

11/28/2003: beazley
[Perl5] Added support for C++ pointers to members.

11/28/2003: beazley
Fixed [ 850151 ] PYVERSION with python2.3 in configure of SWIG 1.3.19 (Maybe).

11/28/2003: beazley
Fixed [ 850666 ] include extra line added.
This should fix some problems with getting correct line numbers on
error messages.

11/26/2003: beazley
Fixed another one of Marcelo's evil template bugs (infinite
recursion). [ 849504 ] template and typedef -> inf. recursion.

11/26/2003: beazley
Fixed parsing problem with declarations like this:

int *x = &somearray[0];

11/25/2003: beazley
Fixed [ 756552 ] missing default argument class scope with "|".
This is really only a band-aid fix for use of class-enums in
expressions. For example:

class A {
public:
enum Flag { flag1 = 0x1, flag2 = 0x2 };
void foo(int x = flag1 | flag2);
};

Note: there are still some (more subtle) cases that are broken,
but hard to fix due to an issue with template expansion. Will
address later.
Reported by Dmitry Mironov.

11/25/2003: beazley
Incorporated [ 840878 ] support for %inline { ... } (PATCH).
This adds support for the following:

%inline {
... some code ...
}

The difference between this and %inline %{ ... %} is that the
enclosed text is processed by the SWIG preprocessor. This
allows special macros and other processing to be used in
conjunction with %inline.
Contributed by Salvador Fandino Garcia.

11/25/2003: beazley
Fixed [ 836903 ] C++ inconsistency (with void arguments).
SWIG was having difficulty with f() vs f(void) in C++ programs.
For instance:

class A {
public:
virtual void f(void) = 0;
};

class B {
public:
virtual void f(); // Not matched to f(void) correctly
};

The parser now normalizes all declarations of the form f(void)
in C++ classes to f(). This should fix a variety of subtle
problems with inheritance, optimizations, overloading, etc.
Problem reported by Partho Bhowmick.

11/25/2003: beazley
[Perl5] Incorporated [ 841074 ] better croaking (PATCH). This fixes some problems
with strings and provides some new error functions.
Contributed by Salvador Fandino Garcia.

11/25/2003: beazley
Fixed [ 791835 ] Default argument with cast: txt = (char *)"txt" syntax Error.
The parser should now accept things like this:

void foo(char *s = (char *) "Hello");

Problem reported by Claudius Schnorr.

11/24/2003: beazley
[Tcl] Fixed problem with cross module linking. Previously modules referred
to base classes through a global variable. Now, the module looks up base
classes through the type system itself---avoiding the need to link to a global
like before. Caveat: modules with base classes must be loaded before
modules with derived classes.

11/24/2003: mkoeppe (Matthias Koeppe)
[Guile] In -scm mode, use () to represent null pointers,
as it is done in -gh mode.

11/23/2003: mkoeppe (Matthias Koeppe)
Add a generated script "preinst-swig", which can be used
to invoke SWIG before it has been installed. It arranges
that the runtime libraries from the source directory are
used.

11/23/2003: mkoeppe (Matthias Koeppe)
[Guile] In -gh mode, don't forget to call SWIG_Guile_Init.
Add a SWIG_contract_assert macro.

11/23/2003: mkoeppe (Matthias Koeppe)
[MzScheme] Update the configure check for the dynext object to work
with MzScheme 205.

11/20/2003: mmatus
Fixed the include/import error reported by Kerim Borchaev,
where two files with names like

'dir1/hello.i'
'dir2/hello.i'

can not be include at the same time. Swig was including
just the first one, assuming the second one was not a
different one, since it was checking/keeping just the
basename 'hello.i'.

11/19/2003: beazley
Changes to the SWIG runtime library support.
- The -c command line option has been renamed to -noruntime
- New command line option: -runtime. When supplied, this
inserts the symbol SWIG_GLOBAL into the wrapper code. This,
in turn, makes all of the runtime support functions globally
visible.
- New library file: swigrun.i. Used to create modules
for runtime library (if needed).

11/18/2003: cheetah (William Fulton)
'make srcrpm' rpmbuild fix - patch from Joe Cooper

11/18/2003: mkoeppe (Matthias Koeppe)
[Guile] Change meaning of configure option --with-guile to
the name of the Guile executable. The new option --with-guile-prefix
can be used to specify the tree where Guile is
installed. (However, usually it suffices to use the
single option --with-guile-config.)
When running the run tests test-suite, make sure to use the
version of Guile that SWIG was configured for.

11/17/2003: mkoeppe (Matthias Koeppe)
[Guile] Improvements to object-ownership management in
"-scm" mode. (They do not apply to the default "-gh" mode.)
* Renamed the smob type that indicates that the object can
be garbage collected from "collected swig" to "collectable
swig", which is more precise.
* Export the destructor functions again. It is now
allowed to explicitly call destructors, even for
garbage-collected pointer objects. A pointer object
that has been passed to a destructor is marked in a
special way using a new smob type, "destroyed swig".
(This helps avoid nasty memory bugs, where references to
dead C objects are still held in Scheme. Moreover, the
garbage collector will not try to free a destroyed
object once more.)
* Destructor-like functions can also mark their arguments
as destroyed by applying the typemap SWIGTYPE *DESTROYED.
(It calls the function SWIG_Guile_MarkPointerDestroyed.)
* Functions that "consume" their objects (or that "own"
them after the call) can mark their arguments as
not garbage collectable. This can be done by applying
the typemap SWIGTYPE *CONSUMED. (It calls the function
SWIG_Guile_MarkPointerNoncollectable.)
* The macro TYPEMAP_POINTER_INPUT_OUTPUT from library
pointer-in-out.i creates additional typemaps
PTRTYPE *INPUT_CONSUMED, PTRTYPE *INPUT_DESTROYED.
They mark the passed pointer object likewise.
The typemap PTRTYPE *OUTPUT creates a garbage-collectable
pointer object, like %newobject does for a returned
pointer. Use the new typemap PTRTYPE *OUTPUT_NONCOLLECTABLE
to create a pointer object that will not be garbage collected.

11/17/2003: mkoeppe (Matthias Koeppe)
[Guile] Handle $input in "freearg" typemaps.
Never qualify GOOPS slot names with the class name.
Handle optional arguments properly in the GOOPS methods.

11/16/2003: cheetah (William Fulton)
Fixes for installation to work with the upcoming Automake-1.8.
mkinstalldirs was being used by a non-Automake makefile.
mkinstalldirs is being phased out and so was not being
created by Automake. install-sh used instead.

11/16/2003: cheetah (William Fulton)
[Java] Numerous director improvements, tweaks and bug fixes since
the initial implementation have been contributed by Scott Michel.

11/12/2003: beazley
[Python] When %feature("shadow") is used to add code to shadow
classes, the special variable $action expands to the name of the
underlying wrapper function that would have been called normally.

11/12/2003: beazley
[Python] When generating proxy class code, SWIG emits a few
default methods for __repr__() and other Python special
methods. Some of these methods are emitted after all of the
contents of a class. However, this makes it hard to override
the methods using %pythoncode and some other directives that
allow code to be inserted into a class. These special methods
are now emitted into the code *before* all of the other methods.
Suggested by Eric Jones.

11/11/2003: beazley
Preprocessor enhancement. For include statements like this:

%include "foo/bar.i"

the directory "foo" is now added to the search path while
processing the contents of bar.i. Thus, if bar.i includes other
files in the same directory, they will be found. Previously,
you would have to add additional directories using -I to make this
work correctly. Note: the C preprocessor seems to behave in
an identical manner on many (most? all?) systems.
Suggested by Kerim Borchaev.

11/11/2003: beazley
Configuration changes to make SWIG work on Mac OS X 10.3.x (Panther).
Tested with Python, Tcl, Perl, and Ruby---all of which seem to work.

11/08/2003: cheetah (William Fulton)
[Java] Fixed the typemaps in various.i which were mostly broken.
char **STRING_IN and char **STRING_RET typemaps replaced with
STRING_ARRAY. float *FLOAT_ARRAY_RETURN typemap removed.

11/08/2003: beazley
[Tcl] Tcl module now emits a safe module initialization function by
default. It can be removed by running 'swig -nosafe'.

11/04/2003: mkoeppe (Matthias Koeppe)
[Guile] Only use the SCM_ API when the function
`scm_slot_exists_p' exists (needed for GOOPS support).
This function was renamed during the Guile 1.5 series
from `scm_slots_exists_p'.
Report the right runtime library when invoked with
-scm -ldflags.

11/03/2003: mkoeppe (Matthias Koeppe)
[Chicken] Fix 782052. The --with-chickencfg configure
option (and others) were not accepted.

11/02/2003: mkoeppe (Matthias Koeppe)
[Guile] Merge new set of GOOPS changes by John Lenz.
GOOPS objects are now manipulated directly by the C code.
Some fixes to typemap-GOOPS interaction.

11/02/2003: mkoeppe (Matthias Koeppe)
[Guile] Remove the file argument to -scmstub and -goops.
The Scheme files are now always called MODULE.scm or
MODULE-primitive.scm, where MODULE is the module name and
"primitive" can be changed by the -primsuffix option.
The Scheme files are now placed in the directory given by
the -outdir option, or the current directory.
(Patch by John Lenz, slightly modified.)

*** INCOMPATIBILITY [Guile] ***

11/02/2003: mkoeppe (Matthias Koeppe)
Unify the pointer-conversion runtime API. The standard
functions are:
* SWIG_NewPointerObj (POINTER, TYPE, FLAGS)
-- Create an scripting object that represents a typed
pointer. FLAGS are language specific.
* SWIG_ConvertPtr (INPUT, RESULT, TYPE, FLAGS)
-- Get a pointer from the scripting object INPUT and
store it in the place RESULT. When a type mismatch
occurs, return nonzero.
* SWIG_MustGetPtr (INPUT, TYPE, ARGNUM, FLAGS)
-- Get a pointer from the scripting object INPUT and
return it. When a type mismatch occurs, throw an
exception. If ARGNUM > 0, report it as the
argument number that has the type mismatch.
[Guile]: No changes.
[MzScheme]: No changes.
[Perl]: Add the function SWIG_NewPointerObj.
The function SWIG_MakePtr is kept.
The function SWIG_MustGetPtr is currently not
supported.
[Python]: Add the function SWIG_MustGetPtr.
[Ruby]: Add the function SWIG_MustGetPtr.
[Tcl]: Remove the "interp" argument of
SWIG_NewInstanceObj, SWIG_ConvertPtr,
SWIG_ConvertPacked, and SWIG_ConvertPtrFromString.
The function SWIG_MustGetPtr is currently
not supported.
No changes to Pike because its pointer conversion code did
not look complete. No changes to PHP4, because I did not
understand its runtime code. No changes to Chicken
because major changes are expected soon anyway. No
changes to Java, OCaml, C because they do not seem to
have a pointer-conversion runtime API.

*** INCOMPATIBILITY [Tcl] ***

11/02/2003: mkoeppe (Matthias Koeppe)
[Perl5, PHP4, Pike, Python, Ruby, Tcl]: Use the
preprocessor to rename external functions of the SWIG
runtime API to follow the naming convention
SWIG_<language>_<function>. This should allow linking
more than one interpreter into a program.

10/31/2003: cheetah (William Fulton)
[C] Fix since introducing the exception and std::string delegates.
The fix overcomes linker errors when using more than one SWIG module.
Problem reported by Andreas Sch�rk.

10/31/2003: beazley
Incorporated patch: [ 823302 ] Incr Tcl support.
Contributed by Alexey Dyachenko.
Note: needs documentation.

10/31/2003: beazley
Incorporated patch: [ 829325 ] new Python Module options and features.
Robin Dunn writes:

This patch makes a number of changes to the SWIG python module.

1. Add -apply option, and change the default code
output to use the foo(*args, **kw) calling syntax
instead of using apply(). If the -apply option is
given then code is generated as before. This is very
similar to Patch 737281 but the new -modern option
makes the second half of that patch unnecessary so it
is not included here.

2. Add -new_repr option. This is the same as my Patch
797002 which I will mark as closed since it is no
longer needed. When this new option is used then the
__repr__ methods that are generated for proxy classes
will be more informative and give details about the
python class and the C++ class.

3. Add %feature("addtofunc"). It allows you to insert
one or more lines of code inside the shadow method or
function that is already generated, instead of
replacing the whole thing like %feature("shadow") does.
For __init__ it goes at the end, for __del__ it goes
at the begining and for all others the code generated
is expanded out to be like

def Bar(*args, **kwargs):
val = _module.Foo_Bar(*args, **kwargs)
return val

and the "addtofunc" code is inserted just before the
return statement. If the feature is not used for a
particular method or function then the shorter code is
generated just like before.

4. A little bit of refactoring to make implementing
addtofunc a little easier.

5. Added a -modern command-line flag that will cause
SWIG to omit the cruft in the proxy modules that allows
it to work with versions of Python prior to 2.2. The
result is a simpler, cleaner and faster python proxy
module, but one that requires Python 2.2 or greater.

10/31/2003: beazley
Incorporated patch: [ 829319 ] XML module tweaks.
This adds a new command line option -xmllite that
greatly reduces the amount of emitted XML code by
eliminating some fields mostly used in SWIG's
internal processing. Contributed by Robin Dunn.

10/31/2003: beazley
Incorporated patch: [ 829317 ] Adds DohSplitLines function.
Contributed by Robin Dunn.

10/29/2003: beazley
Fixed [ 827907 ] argout objects not being wrapped properly (PATH).
Patch contributed by Salvador Fandi�o Garc�a.

10/29/2003: beazley
Fixed [ 826996 ] perl type checking ignores perl subclasses.
This enhancement makes it so wrapped classes and structs can
be subclassed in Perl and used normally.
Patch contributed by Salvador Fandi�o Garc�a.

10/16/2003: cheetah (William Fulton)
[C] IntPtr marshalled with a void* instead of int in C function
declarations. The casts thus look more conventional, for example:

// old
DllExport double SWIGSTDCALL CSharp_get_Shape_x(int jarg1) {
...
Shape *arg1 = (Shape *) 0 ;
arg1 = *(Shape **)&jarg1;
...
}
// new
DllExport double SWIGSTDCALL CSharp_get_Shape_x(void * jarg1) {
...
Shape *arg1 = (Shape *) 0 ;
arg1 = (Shape *)jarg1;
...
}


10/14/2003: beazley
Fixed a subtle problem with overloaded methods and smart pointers.
If a class has overloaded methods like this:

class Foo {
public:
int bar(int x);
static int bar(int x, int y);
};

and the class is used as a smart pointer:

class FooPtr {
public:
Foo *operator->();
};

The SWIG would try to expose the static member Foo::bar
through FooPtr---resulting bogus wrapper code and a compiler
error.

Due to the way in which overloading is handled, it is
extremely difficult to eliminate the static method in
this case. Therefore, it is still exposed. However,
the generated code now compiles and works.

10/05/2003: mkoeppe (Matthias Koeppe)
[Guile, MzScheme, Chicken]: Remove symbol clashes between
the runtime libraries by renaming all extern common.swg
functions with the preprocessor.

10/05/2003: mkoeppe (Matthias Koeppe)
[Guile] Added basic GOOPS support, contributed by John Lenz.
See the documentation for details.

*** NEW FEATURE ***

10/04/2003: mkoeppe (Matthias Koeppe)
[Guile] New option, -only-setters, which disables
traditional getter and setter procedures for structure slots.

10/03/2003: mkoeppe (Matthias Koeppe)
[Guile] Added run test for reference_global_vars by John Lenz.

09/30/2003: beazley
Partial solution to [ 792180 ] C++ smart-pointer/namespace mixup revisited.
The problem is not easy to fix (at least it doesn't seem so), but is
related to the instantiation of qualified templates inside of other
namespaces. SWIG now generates an error message in this case rather
than generating broken wrappers.

09/30/2003: beazley
Fixed [ 800012 ] ENTER macro from CORE/scope.h clashes with libc search.h.
Reported by Britton Leo Kerin.

09/30/2003: beazley
Fixed [ 811518 ] Casting ints to doubles (w/ solution?)
Addresses a problem with overloading in the Perl module.
Reported by Gerald Dalley.

09/28/2003: mkoeppe
[Guile with -scm option] Fix typo in generated code for
procedures-with-setters. Reported by John Lenz.

09/26/2003: beazley
Fixed [ 812528 ] externs not correct when throw is in signature.
Reported by Joseph Winston.

09/23/2003: cheetah (William Fulton)
SWIG was generating a number of symbols that didn't comply with
the ISO C/C++ standard, in particular ISO/IEC 14882:1998(E) 17.4.3.1.2
where double underscores are forbidden as well as symbols starting with
an underscore followed by an upper case letter. Most of these have
been rooted out. See new section added to internals.html development
manual 'Symbol Naming Guidelines for Generated C/C++ Code'.

09/23/2003: cheetah (William Fulton)
Director typemap name changes:
inv => directorin
outv => directorout
argoutv => directorargout

*** POTENTIAL INCOMPATIBILITY ***

09/19/2003: mrose (Mark Rose)
[Python] Director constructors now default to __disown = 0,
which is the intended behavior and fixes the director_finalizer
test case under python.

09/12/2003: cheetah (William Fulton)
[C] - Typemaps added for std::string and const std::string &.
- New delegate for creating a C string given a char *. It
can be used by calling SWIG_csharp_string_callback as shown
in the std::string 'out' typemap. Useful if the return type is
mapped to a C string and the calling function is responsible
for cleaning up memory as the C garbage collector doesn't
free the memory created in C/C++ and then returned as a C string.
- The exception delegates have moved into an inner class in the
intermediate class, thereby freeing up the static constructor.

09/11/2003: beazley
(Internals)
Major refactoring of iteration over lists and hashes. The
DOH library now uses iterators. They work like this:

List *l = (some list);

Iterator i;
for (i = First(l); i.item; i = Next(i)) {
// i.item contains the actual list item.
// i.item is NULL at end of list
...
}

Hash *h = (some hash);
Iterator j;
for (j = First(h); j.item; j = Next(j)) {
// j.item contains hash table item
// j.key contains hash table key
// Both j.item and j.key are NULL at end
...
}

The old iteration functions Firstitem(), Nextitem(), Firstkey(),
and Nextkey() are gone.

The new iterators are simpler, result in better memory use,
and may be faster. Also, there are no longer any problems
iterating over the same list/hash in multiple places at
the same time. For example, this is fine:

Iterator i,j;
for (i = First(l); i.item; i = Next(i)) {
for (j = First(l); j.item; j = Next(j)) {
...
}
}

(This never worked in previous versions).
*** POTENTIAL INCOMPATIBILITY ***. This will probably break
third party extensions to SWIG (or give them further encouragement
to join the SWIG CVS-tree :-).

09/10/2003: mkoeppe (Matthias Koeppe)
[Guile] Fix memory leaks in the "list-vector.i" typemaps.

09/09/2003: mkoeppe (Matthias Koeppe)
[Chicken] Use C_mk_bool rather than C_mkbool. This fixes
the wrapping of boolean values for Chicken 1.10 and newer.
Reported by Dave <hundoyahoo.com> / Felix Winkelmann
<felixproxima-mt.de>.

09/05/2003: cheetah (William Fulton)
[Java] Directors implemented for Java. In summary this is a big new feature
which supports upcalls from C++ to Java. Code is generated to support C++
callbacks to call into Java and true polymorphic behaviour for Java classes
derived from C++ classes. See java.html for details. Contributed by
Scott Michel.

09/05/2003: Tiger
Created contract example directory at /SWIG/Examples/contract
Added simple contract examples (simple_c & simple_cxx)
Modified contract module's output format

*** NEW FEATURE ***

09/01/2003: cheetah (William Fulton)
Test-suite build improvements:
- Multiple build directories working for the test suite, so it is now
possible to run configure in multiple subdirectories and run the test
suite in each of these sub directories.
- 'make distclean' fixed so it doesn't bomb out on the Examples directory
when using multiple subdiretory builds. Required the following directories
to be moved:
Examples/GIFPlot/Perl -> Examples/GIFPlot/Perl5
Examples/GIFPlot/Php -> Examples/GIFPlot/Php4
These new directories used to be symbolic links to the old directory.
Also the Examples/test-suite/Perl symbolic link has been removed.
- Running the test-suite, other than from the root directory, say
in Examples/test-suite/python will now display all the code being
executed.
- The following 3 C compilers are detected during configure and work with
the test-suite: Mono, Portable.NET and Microsoft.

09/01/2003: Tiger
Added inheritance support for design by contract feature.

09/01/2003: beazley
Fixed [ 794914 ] Wrong types in template specialization.
SWIG was not handling arguments correctly in template
partial specialization. For example,

template<class T> class Foo<T *> {
public:
T *blah();
};

%template(FooInt) Foo<int *>;

in this class, the return type of blah was set to
'int **', but it should really be 'int *'. This has been
fixed, but it will affect all prior uses of partial
specialization.

09/01/2003: beazley
Fixed [ 786394 ] Patch for generated perl code does not compile under RedHat9.
Reported by Scott Finneran.

09/01/2003: beazley
Fixed [ 791579 ] (unsigned) long long handled incorrectly (Tcl).
This was an error in the Tcl typemaps.i file.
Reported by Kjell Wooding.

09/01/2003: beazley
Fixed [ 797573 ] no way to rename classes coming from C structures.
This problem relates to renaming of anonymous structures with a
typedef. For example:

%rename(Bar) Foo;
typedef struct {
...
} Foo;

Reported by Britton Leo Kerin.

09/01/2003: beazley
Fixed [ 797576 ] -help seems to imply that only tcl-specific options exist.
Added a comment to alert user to other options.
Reported by Britton Leo Kerin.

09/01/2003: beazley
Fixed [ 798205 ] Segfault in SWIG_ConvertPtr.
Reported by Prabhu Ramachandran.

08/30/2003: mrose (Mark Rose)
Modified the director typemaps in python/std_complex.i to use the
new-style macro and conversion functions, which eliminated some
redundant code. Fixed a few bugs in these typemaps as well, although
more testing is needed.

08/29/2003: mrose (Mark Rose)
Completed initial support for wrapping abstract classes with directors.
Constructor wrappers will be generated for abstract classes that have
directors, and instances of the director classes will be created regardless
of whether the proxy class has been subclassed in the target language.
No checks are made during construction to ensure that all pure virtual
methods are implemented in the target language. Instead, calls to
unimplemented methods will throw SWIG_DIRECTOR_PURE_VIRTUAL_EXCEPTION
exceptions in C++.

Integrated Prabhu Ramachandran's typemap patches, which provide director
typemap support for enums and std::size_t, and fix a couple bugs in the
director std::vector<> typemaps.

08/29/2003: cheetah (William Fulton)
[C] Implemented exception handling for throwing C exceptions from C/C++ code.
A few delegate functions are available for calling which then throw the C
exception. Use the SWIG_CSharpThrowException function from C/C++ typemaps.
See the generated wrapper code or csharphead.swg for all available exceptions.
Example:

SWIG_CSharpThrowException(SWIG_CSharpException, "exception description");

The 'throws' typemaps are also now implemented, so code is automatically
generated to convert any C++ exception into a C System.Exception when the C++
method declares an exception specification such as:

int foo() throw(Bar);

Also any parameters that are references to a C++ class or a class passed by value
and are passed as a C null will now throw a C NullReferenceException.

08/29/2003: cheetah (William Fulton)
[C] Fix to match the calling convention of all pinvoke methods so that they
match the calling convention used by default in the C 'static extern' declarations
(__stdcall is used on Windows).

08/19/2003: cheetah (William Fulton)
[Java] Reworked std::string typemaps. Fixes a number of string in std namespace
problems. For example %template vector<string>. The templated class' get method
wasn't returning a Java String, but a SWIGTYPE_p_string. Reported
by Zach Baum.

08/15/2003: beazley
Fixed [ 763522 ] 1.3.19 segfault in SwigType_add_pointer/DohInsertitem.
Related to problem with unnamed class handling in Perl module.

08/15/2003: beazley
Fixed [ 763563 ] Missing indication of optional arguments.
Tcl module. Reported by Krzysztof Kozminski.

08/15/2003: beazley
Fixed [ 787432 ] long param handled as int. Tcl module
now uses Tcl_GetLongFromObj to convert integer values.

08/11/2003: beazley
Fixed [ 775989 ] numeric template parameters. There were
some errors in template expansion related to the use of
arrays where the array dimension was a template parameter.
It should work now. Reported by Bryan Green.

08/10/2003: mrose (Mark Rose)
Added a director typemap (outv) for return by value and cleaned up up a few
of the commented director typemaps.

08/10/2003: mrose (Mark Rose)
Fixed constructor generation for director classes to ignore private
constructors. Protected constructors are also ignored for now, pending
a solution to the problem of wrapping classes that only define protected
constructors.

08/07/2003: cheetah (William Fulton)
New commandline option -outdir <dir> to specify where the language specific
files are to be generated. This is useful for target languages like Python,
Java etc which generate proxy files in the appropriate language.
This option does not apply to the C/C++ wrapper file.

08/07/2003: cheetah (William Fulton)
On Windows the generated files (other than the _wrap.c or _wrap.cxx files)
were sometimes incorrectly being generated into the current directory unless
the input file used the Unix path separator. The Windows path separator
should now be used. Bug reported by Robert Davies.

08/07/2003: beazley
Added array variable set typemap to Perl module.

08/07/2003: beazley
Fixed [ 775677 ] Array init causes codegen bug..

08/07/2003: beazley
Fixed [ 779062 ] Class"\n"::foo not supported. SWIG
should now correctly handle whitespace in between
namespace qualifiers. For example "A :: Foo :: Bar".

07/31/2003: cheetah (William Fulton)
Fixes for parameters which are classes that are passed by value and have
a default value. A copy constructor for SwigValueWrapper is required
(SF 780056). Also fixed memory leak in these circumstances. These mods
also fix SF 780054.

07/28/2003: beazley
Improved run-time error message for pointers in Python module.
Contributed by Zooko.

07/10/2003: ballabio (Luigi Ballabio)
[Almost all languages] Wrappers for std::pair added.
Typemaps for Python, Ruby, Guile and MzScheme.

07/01/2003: mkoeppe (Matthias Koeppe)
[Chicken] Handle the case of more than one argout typemap
per function.

06/29/2003: cheetah (William Fulton)
[Java, C] SF 670949 request. The destructor wrapper function name is now
configurable. A new attribute called methodname in the
javadestruct/javadestruct_derived (Java) or csdestruct/csdestruct_derived (C)
typemaps specifies the method name. For example in Java the destructor is
wrapped by default with the delete method:

%typemap(javadestruct, methodname="delete") SWIGTYPE {...}

06/27/2003: cheetah (William Fulton)
[Java, C] The throws attribute for adding exception classes to the throws
clause also now works with the following typemaps:
newfree
javain, javaout (Java)
csin, csout (C)

For example, the 'AnException' will be added to the throws clause in the
proxy function:

%typemap(javaout, throws="AnException") int {
int returnValue=$jnicall;
if (returnValue==0) throw new AnException("Value must not be zero");
return returnValue;
}

06/25/2003: mrose (Mark Rose)
[Python] Director typemap marshalling checks for null pointers when
walking the parameter list instead of relying soley on the parameter
count. Cures a segfault that occurred for multiple argument inv typemaps.
Someone with more Swig experience should probably review this code.

06/24/2003: mkoeppe (Matthias Koeppe)
[Chicken] Don't emit calls to "C_check_for_interrupt",
which may result in an endless loop. Patch by felixproxima-mt.de.

06/20/2003: cheetah (William Fulton)
[C] Finalizers now use destructor syntax as the override which was used in
the Finalize method is not in the ECMA standards, spotted by the MS compiler.

06/10/2003: cheetah (William Fulton)
[C] A number of changes have been made to remove the Java naming
that was used in the C module.

Typemap name changes:
jni -> ctype
jtype -> imtype
jstype -> cstype
javain -> csin
javaout -> csout
javainterfaces -> csinterfaces
javabase -> csbase
javaclassmodifiers -> csclassmodifiers
javacode -> cscode
javaimports -> csimports
javaptrconstructormodifiers -> csptrconstructormodifiers
javagetcptr -> csgetcptr
javafinalize -> csfinalize

Feature name changes:
javaconst -> csconst
javamethodmodifiers -> csmethodmodifiers

Pragma changes:
pragma(java) -> pragma(csharp)
jniclassbase -> imclassbase
jniclassclassmodifiers -> imclassclassmodifiers
jniclasscode -> imclasscode
jniclassimports -> imclassimports
jniclassinterfaces -> imclassinterfaces

Special variable name changes:
$javaclassname -> $csclassname
$javainput -> $csinput
$jnicall -> $imcall

This will break SWIG interface files that use these typemaps, features
and pragmas. Please update your code or use macros for backwards
compatibility.

*** POTENTIAL INCOMPATIBILITY FOR C MODULE ***

06/10/2003: mkoeppe (Matthias Koeppe)
[MzScheme] Applied MzScheme module updates contributed by
John Lenz <jelenzstudents.wisc.edu>.

- Updated mzscheme to use SWIG's common runtime type
system from common.swg.

- The Lib/mzscheme directory has been reorganized to
standardize names across the language modules:
mzscheme.i was moved to mzscheme.swg, mzscheme.swg and
mzschemedec.swg have been removed, mzrun.swg (which
contains the runtime code) has been added.

- The swig_proxy structure was renamed to swig_mz_proxy.
swig_mz_proxy now contains a pointer to a swig_type_info
structure.

- Added varin and varout typemaps for SWIGTYPE [] and
SWIGTYPE &.

- Garbage collection by calling scheme_add_finalizer() has
been added.

*** NEW FEATURE [MzScheme] ***

06/10/2003: cheetah (William Fulton)
[Java] New typemaps: javadestruct and javadestruct_derived
for the C++ destructor wrapper. The javadestruct version gets used by
classes at the top of an inheritance chain and the javadestruct_derived
version gets used by other classes.

[C] cildispose and cildisposeoverride typemaps replaced by
csdestruct and csdestruct_derived typemaps. The delete()
method has been removed and its functionality put into these
typemaps designed for the Dispose() method.

- New typemaps csinterfaces and csinterfaces_derived replace
the javainterfaces typemap. Also fixes the peculiarity of all classes
in an inheritance chain individually deriving from the IDisposable
interface.

- New typemap csfinalize for finalizers. C++ destructors are now called
by garbage collector during finalization. Problem reported by
Andreas Sch�rk.

06/10/2003: Tiger
Modified contract code for error message output.
Contract code can now print out simple error message.
Modified contract code to prepare for inheritance

06/03/2003: mkoeppe
[Guile] Applied Guile module updates contributed by
John Lenz <jelenzstudents.wisc.edu>.

- SWIG currently uses Guile's gh_ API, which is marked as
deprecated in Guile 1.6 and will be removed in Guile
1.9. This change introduces a command-line flag "-scm"
which causes SWIG to generate wrappers that use Guile's
SCM API instead; this requires Guile >= 1.6.

- The Lib/guile directory has been reorganized to
standardize names across language modules: guiledec.swg
and guile.swg have been moved into guile_gh_run.swg,
guile.i has been moved to guile_gh.swg, guile_scm.swg
and guile_scm_run.swg which contain the SCM API stuff
have been added

- ghinterface.i, which contains the defines from the gh_
functions to the scm_functions has been added

- The API for dealing with pointer objects is now
SWIG_ConvertPtr, SWIG_MustGetPtr, SWIG_NewPointerObj.

- Added varin and varout typemaps for SWIGTYPE [] and SWIGTYPE &

- Garbage collection has been added.

*** NEW FEATURE [Guile] ***

06/01/2003: cheetah (William Fulton)
Dimensionless arrays such as

int foo[] = {1, 2};
extern int bar[];

produce a warning that the variable is read-only. Depending on the target
language, this used to cause compile errors or generate a setter that
generated a runtime error. A setter cannot be automatically generated
because the array size cannot be determined by SWIG. A varin, globalin
or memberin typemap (depending on the target language) must be written
by the user.

05/29/2003: beazley
Refinement to default typemap matching and arrays. When an
array is declared like this:

int foo[4];

The default typemap now resolves to

SWIGTYPE [ANY]

If no match is found for that, it then resolves to

SWIGTYPE []

If no array dimension is specified in the original declaration,
the SWIGTYPE [] is used right away.

Note: This change has been made to resolve problems related to
arrays with and without dimensions. For example, sometimes SWIG
was generating setter functions for array variables with no dimensions
(an error). Likewise, SWIG sometimes made arrays with dimensions
read-only (also an error). This fixes the arrays_global test
problem.

05/28/2003: beazley
Fixed subtle type handling bug with references and pointers.
If you had functions like this:

typedef Foo Bar;

Foo *func1();
void func2(Bar &x);

Then func2() wouldn't accept objects returned by func1()
because of a type error. It should work now.
Reported by Brian Yang.

05/21/2003: cheetah (William Fulton)
Fixes to some of the Visual C++ example project files which would not
work with spaces in the paths held in the environment variables used to
point to the target language's library / include directory.
SF bug 740769

05/21/2003: songyanf (Tiger)
Added -contracts option.
First try of the idea of "Wrap by Contract":
build up realiable cross-language module by wrapping with SWIG.
Implemented basic assertion
(preassertion & postassertion & invariant)
for simple C/C++ functions.

Current format of contracts are:
%contract class_name :: func_name (paras...) {
require:
boolean exprs;
exprs;
ensure:
boolean expr;
exprs;
invariant:
boolean expr;
exprs;
}

*** NEW FEATURE ***

05/19/2003: cheetah (William Fulton)
Build tweaks. There were a few preprocessor definitions which were
specified in the Makefile for passing on the commandline when compiling.
These are now all defined in swigconfig.h. Autoconf doesn't normally
allow installation directories to be defined in this config header file,
but an autoconf archive macro enables this. This macro along with future
autoconf macros are going to be put in the Tools/config directory.

'swig -version' now reports the target build platform.

05/11/2003: cheetah (William Fulton)
[C and Java] Fix to the following typemaps:

javabase, javainterfaces, javaimports, javaclassmodifiers,
javaptrconstructormodifiers, javafinalize, javagetcptr & javacode.

These are the typemaps for modifying/generating proxy classes.
Previously the typemaps would use the proxy class name and not the
C++ type, which was inconsistent with all other typemaps.

In most circumstances the proxy class name and the C++ class name/type
is the same except for classes in namespace, templated classes etc. so
this shouldn't affect most cases.

*** POTENTIAL INCOMPATIBILITY FOR JAVA and C MODULES ***

05/09/2003: cheetah (William Fulton)
Visual C++ Project files have been added so that the runtime libraries
can be built on Windows (for Tcl, Perl, Python and Ruby).

05/01/2003: beazley
Fixed problem with return by value, const, and private constructors.
For example:

class B {
private:
B();
public:
B(const B&);
};

class A {
...
const B returnB() const;
...
};

Problem and patch suggestion reported by Bill Hoffman.

04/29/2003: cheetah (William Fulton)
Build changes:
- Single autoconf invocation - autoconf in the Tools directory has gone.

- Libtool bootstrapped when running autogen.sh. This requires anyone
using the cvs version of SWIG to have libtool installed on their
machine. Suggest version 1.4.2 or higher, preferably the latest - 1.5.

- Automake is now used to build the runtime libraries in conjunction
with libtool.

- Runtime libraries are now successfully built as DLLs on Cygwin.

- Skipping languages is no longer just determined in the top level
makefile but in configure.in. This info is used for building
the runtime libraries and for running the examples and test-suite.

- These changes have fixed multiple build directory builds, that is
building from directories other than the top level directory.
Installation from multiple build directories also working. An initial
configure in the top level directory is no longer needed as described
in 04/02/2003 entry. A 'make distclean' will be needed before building
in a directory other than the top level directory if the autotools
have been run from this top level directory at some point, but
autoconf will tell you this. Note that 'make check' only works from
the top level directory at the moment.

04/28/2003: beazley
Fixed [ 723471 ] Wrapper_print() fails with preprocessor directives.

04/28/2003: beazley
Minor refinement of const static member variable handling
described in CHANGES 08/11/2002. Previously, SWIG merely
checked to see if there was an initializer in the declaration.
Now, SWIG additionally checks to make sure the static member
is const.

04/25/2003: ljohnson (Lyle Johnson)
[Ruby] Added a kind of limited support for multiple inheritance,
activated using the -minherit command-line option. I've also updated
the "C++ Inheritance" section of the Ruby documentation to discuss
how this works, and its limitations. Also also modified the minherit.i
test case to run against this.

04/25/2003: ljohnson (Lyle Johnson)
[Ruby] Added the -globalmodule command-line option for the Ruby
module, for wrapping stuff into the global module (Kernel) instead
of a nested module. Updated documentation accordingly.

04/23/2003: mrose (Mark Rose)
Fixed symname error in director calls to Python methods
that extend C++ operators.

Stopped director destructor wrappers from calling __set_up,
which was leaving the director flag in an inconsistent state.

04/23/2003: beazley
Fixed problem with namespace resolution and nested namespaces.
Reported by Alfred Lorber (and Marcelo Matus).

04/16/2003: cheetah (William Fulton)
Patch for Java examples and test-suite to run on Mac OS X.

04/15/2003: ljohnson (Lyle Johnson)
[Ruby] Incorporated Nobu Nakada's patches for supporting the Ruby
1.8 allocation framework.

04/15/2003: ljohnson (Lyle Johnson)
[Ruby] Replaced all uses of the deprecated STR2CSTR() macro with the
safer StringValuePtr() macro. For more information, see ruby-talk:67059
and follow-ups to that post.

04/11/2003: beazley
Fixed problem with preprocessor macro expansion. For example:

define min(x,y) ((x) < (y)) ? (x) : (y)
int f(int min);

Reported by Sebastien Recio.

04/10/2003: cheetah (William Fulton)
[Java] Added a runtime check to typemaps in arrays_java.i library to check
that the Java array passed in is the same size as the C array and throw an
exception if not.

Also fix to use delete instead of free for arrays created using new.

04/07/2003: cheetah (William Fulton)
Remove GCC3 warning when compiling the examples and test-suite:

cc1plus: warning: changing search order for system directory "/usr/include"
cc1plus: warning: as it has already been specified as a non-system directory

See SF patch 715531 submitted by Gerald Williams

04/03/2003: cheetah (William Fulton)
[C] Improved wrapping of enums and constants. These were previously
wrapped as C variables rather than constants. Either these are wrapped
as readonly (runtime) constants or compile time constants, depending on
the %javaconst directive (The directive is likely to change name soon).
For example wrapping:
%javaconst(0);
define ABC 22
%javaconst(1) XYZ;
define XYZ 33
is now:
public static readonly int ABC = examplePINVOKE.get_ABC();
public const int XYZ = 33;

04/03/2003: cheetah (William Fulton)
[Java] Global constants and enums are put in their own interface called
xxxConstants, where xxx is the module name. This is an improvement as
it is possible to derive (implement) a Java class from the xxxConstants
interface to improve the syntax; namely when wrapping:
enum {ONE=1, TWO, THREE};
accessing these from a Java class implementing xxxConstants is neater:
int number = ONE;
than the previous:
int number = xxx.ONE;

Patch submitted by Dave Dribin.

04/02/2003: cheetah (William Fulton)
Build improvements for multiple builds. This allows one to build
the SWIG executable and runtime libraries for different platforms/compilers
etc by running configure in different directories. This isn't 100% just
yet and won't be until libtool is better configured... a 'configure' and
'make distclean' needs to be run in the root directory before it all works.
For example:
$ ./configure
$ make distclean
$ mkdir config1; cd config1; ../configure CC=gcc CXX=g++; make; cd ..
$ mkdir config2; cd config2; ../configure CC=cc CXX=c++; make; cd ..

To be improved. A 'make check' does not work yet either.

04/01/2003: beazley
Fixed template partial specialization argument expansion bug.
This showed up when trying to use std_vector.i with vectors
of pointers.

03/31/2003: cheetah (William Fulton)
Fix for parallel make builds of SWIG, for example
make -j 4
Build failure reported by Bill Clarke.

03/28/2003: beazley
Released 1.3.19.

Page 9 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.