The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 1.1

Changes for version 1.1

Changes for version 1.1

  • Note : A *huge* number of changes related to ongoing modifications.

Changes for version 1.1

  • Note : SWIG 1.1b3 crashed and burned shortly after take off due to a few major run-time problems that surfaced after release. This release should fix most, if not all, of those problems.
  • 1/16/97 : Fixed major memory management bug on Linux
  • 1/14/97 : Fixed bug in functions returning constant C++ references.
  • 1/14/97 : Modified C++ module to handle datatypes better.
  • 1/14/97 : Modified parser to allow a *single* scope resolution operator in datatypes. Ie : Foo::bar. SWIG doesn't yet handle nested classes, so this should be sufficient for now.
  • 1/14/97 : Modified parser to allow typedef inside a C++ class.
  • 1/14/97 : Fixed some problems related to datatypes defined inside a C++ class. SWIG was not generating correct code, but a new scoping mechanism and method for handling datatypes inside a C++ class have been added.
  • 1/14/97 : Changed enumerations to use the value name instead of any values that might have appeared in the interface file. This makes the code a little more friendly to C++ compilers.
  • 1/14/97 : Removed typedef bug that made all enumerations equivalent to each other in the type checker (since it generated alot of unnecessary code).

Changes for version 1.1

  • 5/9/97 : Fixed bizarre NULL pointer handling bug in Perl5 module.
  • 5/8/97 : Fixed mysterious segmentation fault when running SWIG on an empty file.
  • 5/7/97 : The code generator will now replace the special symbol "$cleanup" with the cleanup code specified with the "freearg" typemap. This change needed to properly manage memory and exceptions.
  • 5/5/97 : Added the 'typemaps.i' library file. This contains a variety of common typemaps for input values, pointers, and so on.
  • 5/5/97 : Changed behavior of "argout" typemap in Python module. Old versions automatically turned the result into a Python list. The new version does nothing, leaving the implementation up to the user. This provides more flexibility but may break older codes that rely on typemaps.
    • POTENTIAL INCOMPATIBILITY ***
  • 5/5/97 : Fixed bug in Python module related to the interaction of "argout" and "ignore" typemaps.
  • 5/5/97 : Fixed bug in Python module that would generate incorrect code if all function arguments are "ignored".
  • 5/4/97 : Added %apply and %clear directives. These form a higher level interface to the typemap mechanism. In a nutshell, they can be used to change the processing of various datatypes without ever having to write a typemap. See the SWIG documentation for more details. ** NEW FEATURE **
  • 5/4/97 : Added a local variable extension to the typemap handler. For example :
    • %typemap(tcl,in) double *(double temp) { temp = atof($source); $target = &temp; }
    • In this case, 'temp' is a local variable that exists in the entire wrapper function (not just the typemap code). This mechanism provides better support for certain types of argument handling and also makes it possible to write thread-safe typemaps. Any number local variables can be declared by supplying a comma separated list. Local variables are guaranteed to be unique, even if the same typemap is applied many times in a given function.
    • Not currently supported in Perl4 or Guile modules.
  • 5/2/97 : Fixed processing of %ifdef, %endif, %if, etc... (These are SWIG equivalents of the C preprocessor directives that can pass through the C preprocessor without modification).
  • 5/2/97 : Fixed major (but subtle) bug in the run-time type checker related to searching and type-checking for C++ inheritance. To make a long story short, if you had two classes named "Foo" and "FooObject" the type checker would sometimes get confused and be unable to locate "Foo" in an internal table.
  • 5/2/97 : Fixed some bugs in the -co option.
  • 4/24/97 : Pointer library added to the SWIG library.
  • 4/19/97 : Added the %new directive. This is a "hint" that can be used to tell SWIG that a function is returning a new object. For example :
    • %new Foo *create_foo();
    • This tells SWIG that create_foo() is creating a new object and returning a pointer to it. Many language modules may choose to ignore the hint, but when working with shadow classes, the %new is used to handle proper ownership of objects.
    • %new can also be used with dynamically allocated strings. For example :
      • %new char *create_string();
    • When used, all of the language modules will automatically cleanup the returned string--eliminating memory leaks.
    • NEW FEATURE **
  • 4/19/97 : Added a new typemap "newfree". This is used in conjunction with the %new directive and can be used to change the method by which a new object returned by a function is deleted.
  • 4/19/97 : The symbol "__cplusplus" is now defined in the SWIG interpreter when running with the -c++ option.
  • 4/17/97 : Added support for static member functions when used inside the %addmethods directive.
  • 4/15/97 : Added a special typemap symbol PREVIOUS that can be used to restore a previous typemap. For example :
    • %typemap(tcl,in) int * = PREVIOUS;
    • This is primarily used in library files.
  • 4/13/97 : Added %pragma directive for Perl5 module. Two new pragmas are available :
    • %pragma(perl5) code = "string" %pragma(perl5) include = "file.pl"
    • Both insert code into the .pm file created by SWIG. This can be used to automatically customize the .pm file created by SWIG.
  • 4/13/97 : Scanner modified to only recognize C++ keywords when the -c++ option has been specified. This provides support for C programs that make use of these keywords for identifiers. SWIG may need to be explicitly run with the -c++ option when compiling C++ code (this was allowed, but not recommended in previous versions). **POTENTIAL INCOMPATIBILITY**
  • 4/11/97 : Fixed a rather nasty bug in the Perl5 module related to using variable linking with complex datatypes and pointers. On Unix, code would work (somehow), but would cause an access violation under Windows-NT. The fix should correct the problem, but there may still be a problem using global variables of complex datatypes in conjunction with shadow classes. Fortunately, this sort of thing seems to be relatively rare (considering that the bug has been around for more than a year - yikes!).
  • 4/11/97 : Fixed bizarre constant evaluation bug in Perl5 code generation when running under Windows-NT.
  • 4/8/97 : Bug when using default arguments and C++ references fixed.
  • 4/8/97 : Fixed code generation bugs in Python and Perl5 modules related to using class renaming (applying the %name directive to a class definition) and shadow classes.
  • 4/7/97 : Fixed minor bugs in swigptr.swg, tcl8ptr.swg, and perl5ptr.swg to prevent infinite loops when weird datatypes are passed.
  • 3/29/97 : 'Makefile.win' added. This is used to build most of the examples in the Examples directory under Windows NT/95.
  • 3/27/97 : Fixes to SWIG's error return codes. SWIG now returns non-zero exit codes for certain kinds of errors (which makes it more friendly to makefiles). An overhaul of the error handling is on the to-do list and will probably show up in a later release.
  • 3/25/97 : Bug fix. "freearg" and "argout" typemaps have been fixed in the Perl5 module. In previous versions, function input parameters and function output parameters shared the same memory space--causing all sorts of nasty problems when trying to pass perl values by reference. SWIG now internally makes a "copy" (which is really just a pointer) of affected parameters and uses that. This is done transparently so there is no noticable impact on any SWIG generated modules. This change is probably only noticable to expert users.
  • 3/25/97 : Added type-check to verbose and stat mode. SWIG will now generate a list of all datatypes that were used but undefined (useful for tracking down weird bugs). This is enabled with the -v option (which is now officially known as "overly verbose" mode) or the -stat option.
  • 3/25/97 : Slight change to the parser to make include guards work correctly. For example :
    • #ifndef INTERFACE_I #define INTERFACE_I %module foobar.i ... declarations ... #endif
  • 3/24/97 : %checkout directive added. This allows an interface file to extract files from the SWIG library and place them in the current directory. This can be used to extract scripts and other helper code that might be associated with library files. For example :
    • %checkout array.tcl
    • Will look for a file "array.tcl" in the library and copy it to the current directory. If the file already exists in the directory, this directive does nothing (it will not overwrite an existing file). This only an experimental feature for now.
  • 3/24/97 : SWIG will now look in the SWIG Library for a file if it can't find it in the current directory. As a result, it is easy to make modules from SWIG library files. For example, if you want to make a Python module from the SWIG timers library, just type this in any directory :
    • swig -python timers.i
    • You will get the files timers_wrap.c and timers_wrap.doc in the current directory that you can now compile. The file remains in the SWIG library (although you can check it out using the -co option). *** New Feature ***
  • 3/24/97 : -co option added to SWIG to allow easy access to the SWIG library. When used, this instructs SWIG to check out a library file and place it in the current directory. For example :
    • unix > swig -co array.i array.i checked out from the SWIG library unix >
    • Once in your directory you can customize the file to suit your particular purposes. The checkout option makes it easy to grab library files without knowing anything about the SWIG installation, but it also makes it possible to start including scripts, C code, and other miscellaneous files in the library. For example, you could put a cool script in the library and check it out whenever you wanted to use it.
    • New Feature ***
  • 3/24/97 : #pragma export directives added to Tcl output for compiling shared libraries on the Mac.
  • 3/24/97 : Minor changes to wish.i and tclsh.i library files to provide support for the Macintosh.
  • 3/19/97 : SWIG's policy towards NULL pointers has been relaxed. The policy of requiring a special compiler directive -DALLOW_NULL to use NULL pointers is no longer supported. While this may seem "unsafe", it turns out that you can use a "check" typemap to achieve some safety. For example :
    • %typemap(perl5,check) Node * { if (!$target) croak("NULL Pointers not allowed."); }
    • This prevents any NULL value of a "Node *" pointer to be passed to a function. (I think this is much cleaner than the old -DALLOW_NULL hack anyways).
  • 3/19/97 : Fixed pointer handling errors in Perl5 module. Modules no longer core dump when a Perl reference is inadvertently passed in as a C pointer.
  • 3/18/97 : Added a "check" typemap. This can be used to check the validity of function input values. For example :
    • %typemap(perl5,check) int posint { if ($target < 0) croak("Argument is not a positive integer"); }
  • 3/18/97 : Added an $arg variable to Tcl typemaps. This makes it easier to return argument values by "reference".
  • 3/18/97 : Fixed a code generation bug when using C++ references and the %addmethods directive.
  • 3/18/97 : Fixed a few glitches in the typemap module with respect to chaining. For example :
    • %typemap(tcl,in) int { $in // Inserts prexisting typemap printf("Received a %d\n", $target); }
    • This has been allowed for quite some time, but didn't work if no existing typemap was defined. Now, it still doesn't work if no existing typemap is defined, but it issues a warning message. There is some support using default typemaps, but none of the language modules take advantage of it. This should be considered experimental at this time.
  • Version 1.1b5 Patch 1 (March 16, 1997)
  • 3/16/97 : Fixed references bug with C++ code generation.
  • 3/16/97 : Fixed initialization bug in the documentation system that was causing weird problems.
  • 3/16/97 : Fixed fatal bug with -c option in the Python module.
  • 3/13/97 : Fixed bug in the documentation system involving the %text directive and sorting. In the old system, %text entries would float to the top of a section because they were "nameless". Now they are attached to the previous declaration and will stay in the proper location relative to the previous entry.
  • Version 1.1b5 (March 12, 1997)
  • 3/11/97 : Fixed compilation problems introduced by Tcl/Tk 8.0a2.
    • INCOMPATIBILITY *** SWIG no longer works with Tcl/Tk 8.0a1.
  • 3/10/97 : Fixed bug with ignored arguments and C++ member functions in the Python module.
  • 3/9/97 : Parsing bugs with nested class definitions and privately declared nested class definitions fixed.
  • 3/9/97 : Fixed a few minor code generation bugs with C++ classes and constructors. In some cases, the resulting wrapper code would not compile properly. SWIG now attempts to use the default copy constructor instead.
  • 3/8/97 : Added a -l option to SWIG that allows additional SWIG library files to be grabbed without having them specified in the interface file. This makes it easier to keep the interface file clean and move certain options into a Makefile. For example :
    • swig -tcl example.i # Build a normal Tcl extension swig -tcl -lwish.i example.i # Build it as a wish extension
      • by including the 'wish.i' file.
    • swig -python example.i # Build a dynamically loaded extension swig -python -lembed.i example.i # Build a static extension
    • These kinds of options could previously be accomplished with conditional compilation such as :
      • %module example ... #ifdef STATIC %include embed.i #endif
  • 3/8/97 : Incorporated changes to Guile module to use the new gh interface in FSF Guile 1.0. The older gscm interface used in Cygnus Guile releases is no longer supported by SWIG.
  • 3/8/97 : Cleaned up the Tcl Netscape plugin example. It should work with version 1.1 of the plugin now.
  • 3/8/97 : Added better array support to the typemap module. The keyword ANY can now be used to match any array dimension. For example :
    • %typemap(tcl,in) double [ANY] { ... get an array ... }
    • This will match any single-dimensional double array. The array dimension is passed in the variables $dim0, $dim1, ... $dim9. For example :
      • %typemap(tcl,in) double [ANY][ANY][ANY] { printf("Received a double[%d][%d][%d]\n",$dim0,$dim1,$dim2); }
    • Any typemap involving a specific array dimension will override any specified with the ANY tag. Thus, a %typemap(tcl,in) double [5][4][ANY] {} would override a double [ANY][ANY][ANY]. However, overuse of the ANY tag in arrays of high-dimensions may not work as you expect due to the pattern matching rule used. For example, which of the following typemaps has precedence?
      • %typemap(in) double [ANY][5] {} // Avoid this! %typemap(in) double [5][ANY] {}
  • 3/7/97 : Fixed a number of bugs related to multi-dimensional array handling. Typedefs involving multi-dimensional arrays now works correctly. For example :
    • typedef double MATRIX[4][4];
    • ... extern double foo(MATRIX a);
    • Typecasting of pointers into multi-dimensional arrays is now implemented properly when making C/C++ function calls.
  • 3/6/97 : Fixed potentially dangerous bug in the Tcl Object-oriented interface. Well, actually, didn't fix it but issued a Tcl error instead. The bug would manifest itself as follows:
    • % set l [List] # Create an object ... % set m [List -this $l] # Make $m into an object assuming $l
      • contains a pointer.
      • Since $m == $l, $l gets destroyed
      • (since its the same command name)
    • % $m insert Foo Segmentation fault # Note : the list no longer exists!
    • Now, an error will be generated instead of redefining the command. As in :
      • % set l [List] ... % set m [List -this $l] Object name already exists!
    • Use catch{} to ignore the error.
  • 3/3/97 : Better support for enums added. Datatypes of 'enum MyEnum' and typedefs such as 'typedef enum MyEnum Foo;' now work.
  • 3/3/97 : Parser modified to ignore constructor initializers such as :
    • class Foo : public Bar { int a,b; public: Foo(int i) : a(0), b(i), Bar(i,0) { }; };
  • 3/3/97 : Modified parser to ignore C++ exception specifications such as :
    • int foo(double) throw(X,Y);
  • 3/3/97 : Added %import directive. This works exactly like %extern except it tells the language module that the declarations are coming from a separate module. This is usually only needed when working with shadow classes.
  • 3/2/97 : Changed pointer type-checker to be significantly more efficient when working with derived datatypes. This has been accomplished by storing type-mappings in sorted order, using binary search schemes, and caching recently used datatypes. For SWIG generated C++ modules that make a large number of C function calls with derived types, this could result in speedups of between 100 and 50000 percent. However, due to the required sorting operation, module loading time may increased slightly when there are lots of datatypes.
  • 3/2/97 : Fixed some C++ compilation problems with Python embed.i library files.
  • 2/27/97 : Slight change to C++ code generation to use copy constructors when returning complex data type by value.
  • 2/26/97 : Fixed bug in Python module with -c option.
  • 2/26/97 : Slight tweak of parser to allow trailing comma in enumerations such as
    • enum Value (ALE, STOUT, LAGER, };
  • 2/25/97 : Fixed code generation bug in Tcl module when using the %name() directive on a classname.
  • 2/25/97 : Finished code-size optimization of C++ code generation with inheritance of attributes. Inherited attributes now only generate one set of wrapper functions that are re-used in any derived classes. This could provide big code size improvements in some scripting language interfaces.
  • 2/25/97 : Perl5 module modified to support both the Unix and Windows versions. The windows version has been tested with the Activeware port of Perl 5.003 running under Windows 95. The C source generated by SWIG should compile without modification under both versions of Perl, but is now even more hideous than before.
  • 2/25/97 : Modified parser to allow scope resolution operation to appear in expressions and default arguments as in :
    • void foo(int a = Bar::defvalue);
  • 2/25/97 : Fixed bug when resolving symbols inside C++ classes. For example :
    • class Foo { public: enum Value {ALE, STOUT, LAGER}; ... void defarg(Value v = STOUT);
    • };
  • 2/24/97 : Fixed bug with member functions returning void *.
  • 2/23/97 : Modified Python module to be better behaved under Windows
    • Module initialization function is now properly exported. It should not be neccessary to explicitly export this function yourself.
    • Bizarre compilation problems when compiling the SWIG wrapper code as ANSI C under Visual C++ 4.x fixed.
    • Tested with both the stock Python-1.4 distribution and Pythonwin running under Win95.
  • 2/19/97 : Fixed typedef handling bug in Perl5 shadow classes.
  • 2/19/97 : Added exception support. To use it, do the following :
    • %except(lang) { ... try part of the exception ... $function ... catch part of exception ... }
    • $function is a SWIG variable that will be replaced by the actual C/C++ function call in a wrapper function. Thus, a real exception specification might look like this :
      • %except(perl5) { try { $function } catch (char *& sz) { ... process an exception ... } catch(...) { croak("Unknown exception. Bailing out..."); } }
  • 2/19/97 : Added support for managing generic code fragments (needed for exceptions).
  • 2/19/97 : Fixed some really obscure typemap scoping bugs in the C++ handler.
  • 2/18/97 : Cleaned up perlmain.i file by removing some problematic, but seemingly unnecessary declarations.
  • 2/18/97 : Optimized handling of member functions under inheritance. SWIG can now use wrapper functions generated for a base class instead of regenerating wrappers for the same functions in a derived class. This could make a drastic reduction in wrapper code size for C++ applications with deep inheritance hierarchies and lots of functions.
  • 2/18/97 : Additional methods specified with %addmethods can now be inherited along with normal C++ member functions.
  • 2/18/97 : Minor internal fixes to make SWIG's string handling a little safer.
  • 2/16/97 : Moved some code generation of Tcl shadow classes to library files.
  • 2/16/97 : Fixed documentation error of '-configure' method in Tcl modules.
  • 2/16/97 : Modified Perl5 module slightly to allow typemaps to use Perl references.
  • 2/12/97 : Fixed argument checking bug that was introduced by default arguments (function calls with too many arguments would still be executed). Functions now must have the same number of arguments as C version (with possibility of default/optional arguments still supported).
  • 2/12/97 : Fixed default argument bug in Perl5 module when generating wrapper functions involving default arguments of complex datatypes.
  • 2/12/97 : Fixed typemap scoping problems. For example :
    • %typemap(tcl,in) double { .. get a double .. }
    • class Foo { public: double bar(double); }
    • %typemap(tcl,in) double { .. new get double .. }
    • Would apply the second typemap to all functions in Foo due to delayed generation of C++ wrapper code (clearly this is not the desired effect). Problem has been fixed by assigning unique numerical identifiers to every datatype in an interface file and recording the "range of effect" of each typemap.
  • 2/11/97 : Added support for "ignore" and "default" typemaps. Only use if you absolutely know what you're doing.
  • 2/9/97 : Added automatic creation of constructors and destructors for C structs and C++ classes that do not specify any sort of constructor or destructor. This feature can be enabled by running SWIG with the '-make_default' option or by inserting the following pragma into an interface file :
    • %pragma make_default
    • The following pragma disables automatic constructor generation
      • %pragma no_default
  • 2/9/97 : Added -make_default option for producing default constructors and destructors for classes without them.
  • 2/9/97 : Changed the syntax of the SWIG %pragma directive to %pragma option=value or %pragma(lang) option=value. This change makes the syntax a little more consistent between general pragmas and language-specific pragmas. The old syntax still works, but will probably be phased out (a warning message is currently printed).
  • 2/9/97 : Improved Tcl support of global variables that are of structures, classes, and unions.
  • 2/9/97 : Fixed C++ compilation problem in Python 'embed.i' library file.
  • 2/9/97 : Fixed missing return value in perlmain.i library file.
  • 2/9/97 : Fixed Python shadow classes to return an AttributeError when undefined attributes are accessed (older versions returned a NameError).
  • 2/9/97 : Fixed bug when %addmethods is used after a class definition whose last section is protected or private.
  • 2/8/97 : Made slight changes in include file processing to support the Macintosh.
  • 2/8/97 : Extended swigmain.cxx to provide a rudimentary Macintosh interface. It's a really bad interface, but works until something better is written.
  • 1/29/97 : Fixed type-casting bug introduced by 1.1b4 when setting/getting the value of global variables involving complex data types.
  • 1/29/97 : Removed erroneous white space before an #endif in the code generated by the Python module (was causing errors on DEC Alpha compilers).
  • 1/26/97 : Fixed errors when using default/optional arguments in Python shadow shadow classes.
  • 1/23/97 : Fixed bug with nested %extern declarations.
  • 1/21/97 : Fixed problem with typedef involving const datatypes.
  • 1/21/97 : Somewhat obscure, but serious bug with having multiple levels of typedefs fixed. For example :
    • typedef char *String; typedef String Name;

Changes for version 1.1

  • 6/24/97 : Fixed Objective-C constructor bug when working with Perl5 shadow classes.
  • 6/23/97 : Fixed some parsing problems with Objective-C. Declarations such as the following should work now :
    • foo : (int) a with: (int) b;
  • 6/22/97 : Added SWIG Runtime library. This library contains the SWIG pointer type-checker and support functions that are normally included in every module. By using the library, it is easier to work with multiple SWIG generated modules.
  • 6/22/97 : Fixed minor bug in Perl5 module related to static linking of multiple modules.
  • 6/22/97 : Fixed some bugs with the %import directive. When used with Perl5 shadow classes, this generates a 'require' statement to load in external modules.
  • 6/22/97 : Added -swiglib option. This prints out the location of the SWIG library and exits. This option is only really useful to configuration tools that are looking for SWIG and its library location (e.g. autoconf, configure, etc...).
  • 6/21/97 : Fixed export bug with Perl5.004 on Windows-NT.
  • 6/20/97 : Minor change to code generation of class/structure members in order to work better with typemaps. Should have no noticable impact on existing SWIG modules.
  • 6/19/97 : Added -t option. This allows SWIG to load a typemap file before processing any declarations. For example :
    • swig -t typemaps.i -python example.i
    • At most, only one typemap file can be specified in this manner.
    • NEW FEATURE ***
  • 6/18/97 : Need a Makefile fast? Type
    • swig [-tcl, -perl5, -python] -co Makefile
    • and you will get a Makefile specific to that target language. You just need to modify it for your application and you're ready to run.
  • 6/18/97 : Completed the -ci option. This option checks a file into the SWIG library. It should be used in conjunction with a language option. For example :
    • swig -tcl -ci foobar.i
    • Checks the file foobar.i into the Tcl part of the library. In order to check a file into the general library (accessible to all languages modules), do the following
      • swig -ci -o ../foobar.i foobar.i
    • (Admittedly this looks a little strange but is unavoidable). The check-in option is primarily designed for SWIG maintenance and library development. The command will fail if the user does not have write permission to the SWIG library. Third party library extensions can easily install themselves by simply providing a shell script that uses 'swig -ci' to install the appropriate library files. It is not necessary to know where the SWIG library is located if you use this mechanism.
    • NEW FEATURE ***
  • 6/16/97 : Fixed a bug in shadow class generation when %name() was applied to a class definition. Unfortunately, fixing the bug required a change in the Language C API by adding an extra argument to the Language::cpp_class_decl() function. This may break SWIG C++ extensions.
    • POTENTIAL INCOMPATIBILITY ***
  • 6/15/97 : Added a warning message if no module name is specified with the %module directive or -module option.
  • 6/15/97 : Fixed line number bug when reporting errors for undefined base classes.
  • 6/15/97 : Added new %rename directive. This allows the forward declaration of a renaming. For example :
    • %rename OldName NewName;
    • .... later ... int OldName(int);
    • Unlike %name, %rename will rename any occurence of the old name. This applies to functions, variables, class members and so forth. There is no way to disable %rename once set, but you can change the name by redeclaring it to something else.
    • NEW FEATURE ***
  • 6/15/97 : Improved the implementation of the %name directive so that it could be used with conditional compilation :
    • #ifdef SWIG %name(NewName) #endif int OldName(int);
  • 6/15/97 : Added support for functions with no return datatype. In this case, SWIG assumes a return type of 'int'.
  • 6/11/97 : Improved error reporting in the parser. It should be a little less sensitive to errors that occur inside class definitions now. Also reports errors for function pointers.
  • 6/11/97 : Made '$' a legal symbol in identifiers. This is to support some Objective-C libraries. Some compilers (such as gcc) may also allow identifiers to contain a $ in C/C++ code as well (this is an obscure feature of C). When '$' appears in identifier, SWIG remaps it to the string '_S_' when creating the scripting language function. Thus a function 'foo$bar' would be called 'foo_S_bar'.
  • 6/11/97 : Fixed bug in Python shadow classes with __repr__ method. If supplied by the user, it was ignored, but now it should work.
  • 6/9/97 : Fixed the Tcl 8.0 module to work with Tcl 8.0b1. SWIG is no longer compatible with *any* alpha release of Tcl 8.0.
    • POTENTIAL INCOMPATIBILITY ***
  • 6/7/97 : Put a maximal error count in (currently set to 20). SWIG will bail out if it generates more errors than this (useful for preventing SWIG from printing 4000 syntax errors when it gets confused).
  • 6/7/97 : Fixed segmentation fault when parsing variable length arguments.
  • 6/7/97 : Minor change to Perl5 module. C++ static functions are now put in the same package as their class when using shadow classes.
  • 6/7/97 : Centralized the naming of functions, members, wrappers etc... By centralizing the naming scheme, it should be possible to make some multi-file optimizations. Also, it should be possible to change SWIG's naming scheme (perhaps a new feature to be added later).
  • 6/2/97 : Added 'arginit' typemap. This can be used to assign initial values to function arguments. Doing so makes it somewhat easier to detect improper argument passing when working with other typemaps.
  • 6/2/97 : Fixed code generation bug when read-only variables were inherited into other classes. Under inheritance, the variables would become writable, but this has now been corrected.
  • 5/30/97 : An empty %name() directive is no longer allowed or supported. This directive was originally used to strip the prefix off of a class or structure. Unfortunately, this never really seemed to work right and it complicated the C++ code generator significantly. As far as I can tell no one uses it, so it is now history. *** POTENTIAL INCOMPATIBILITY ***
  • 5/28/97 : Fixed a parsing bug with #define and C++ comments. Declarations such as the following now work properly :
    • #define CONST 4 // A Comment
  • 5/28/97 : Made some performance improvements to the SWIG String class. (only affects the SWIG compiler itself).
  • 5/28/97 : Modified the parser to skip template definitions and issue a warning message.
  • 5/28/97 : Preliminary support for parameterized types added (ie. templates). Types such as the following should pass through the SWIG compiler
    • void foo(vector<complex> *a, vector<double> *b);
    • When used, the entire name 'vector<complex>' becomes the name of the datatype. Due to space limitations in datatype representations, the name should not exceed 96 characters.
    • Note : This is only part of what is needed for template support. Template class definitions are not yet supported by SWIG.
    • The template notation above may also be used when specifying Objective-C protocol lists.
    • NEW FEATURE ***
  • 5/24/97 : First cut at Objective-C support added. As it turns out, almost everything can be handled with only a few minor modifications to the C++ module.
    • NEW FEATURE ***
  • 5/23/97 : Fixed repeated definition bug in multiple inheritance handling when multiple base classes share a common base class (ie. the evil diamond).
  • 5/21/97 : Fixed rather embarrassing typo that worked its way into the Tests/Build directory.
  • 5/19/97 : Fixed code generation bug when using native methods and shadow classes with Python and Perl5 modules.
  • 5/19/97 : Modified the %apply directive slightly so that it would work with pointers a little better. For example :
    • %apply unsigned long { DWORD };
    • Applies *all* typemaps associated with "unsigned long" to "DWORD". This now includes pointers to the two datatypes. For example, a typemap applied to "unsigned long **" would also be applied to any occurrence of "DWORD **" as well.
  • 5/19/97 : Fixed an ownership assignment bug in the Perl5 module when class members were returning new objects belonging to different classes.
  • 5/17/97 : Added a few more typemap variables.
    • $name - Name of function/variable/member $basetype - Base datatype (type without pointers) $argnum - Argument number
  • 5/16/97 : Fixed embarrassing underscore error in local variable allocator.
  • 5/16/97 : Fixed namespace clash bug in parameterized typemaps when creating arrays as new local variables.
  • 5/15/97 : Fixed some bugs with inheritance of added methods across multiple files. SWIG now uses names of base classes when generating such functions.
  • 5/14/97 : Finished support for default typemaps. Primarily used internally, they can be used to match the basic built-in datatypes used inside of SWIG. You can specify them in interface files as well like this :
    • %typemap(tcl,in) int SWIG_DEFAULT_TYPE { $target = atoi($target); }
    • Unlike normal typemaps, this default map will get applied to *all* integer datatypes encountered, including those renamed with typedef, etc...
  • 5/13/97 : Fixed substring bug in type checker.
  • 5/12/97 : Fixed bug in parameterized typemaps when declaring local variables of structures.

Provides

in Examples/perl5/filedialog/FileSelect.pm
in Examples/tcl/objc/list.pm
in Examples/perl5/SWIGtoXS/produce.pm
in Tests/Doc/swig.pm
in Tests/Doc/text.pm

Examples

Other files