Here are the changes that have been made to SWIG-1.3.17:

1. in Lib/common.swg, I made some changes so that dll export/import can
work with the tcl wrappers on windows.

Here is my version :

#if defined(_WIN32) || defined(__WIN32__)
#       if defined(_MSC_VER)
#               if defined(STATIC_LINKED)
#                       define SWIGEXPORT(a) a
#                       define SWIGIMPORT(a) extern a
#               else
#                       define SWIGEXPORT(a) __declspec(dllexport) a
#                       define SWIGIMPORT(a) __declspec(dllimport) a
#               endif
#       else
#               if defined(__BORLANDC__)
#                       define SWIGEXPORT(a) a _export
#                       define SWIGIMPORT(a) a _export
#               else
#                       define SWIGEXPORT(a) a
#                       define SWIGIMPORT(a) a
#               endif
#       endif
#else
#       define SWIGEXPORT(a) a
#       define SWIGIMPORT(a) extern a
#endif

Here is the diff:
diff -r SWIG/Lib/common.swg /cygdrive/c/Hoffman/SWIG-1.3.17/Lib/common.swg
25c25
< #                       define SWIGIMPORT(a) __declspec(dllimport) a
---
> #                       define SWIGIMPORT(a) extern a
38c38
< #       define SWIGIMPORT(a) extern a
---
> #       define SWIGIMPORT(a) a


2. The next change is in tcl8.cxx, and it takes advantage of the above change, and
exports/imports the class structs for tcl wrapping.   This allows for %import to
work on windows with tcl:

diff -r SWIG/Source/Modules1.1/tcl8.cxx /cygdrive/c/Hoffman/SWIG-1.3.17/Source/Modules1.1/tcl8.cxx
12c12
---
>         
671,672c682,684
< 	String *bmangle = Swig_name_mangle(bname);
< 	Printv(f_wrappers,"SWIGIMPORT(swig_class) _wrap_class_", bmangle, ";\n", NIL);
---
> 	String *bmangle = Swig_name_mangle(bname); 
> //        printf("doing the wrap %s\n", Char(bmangle));
> 	Printv(f_wrappers,"extern swig_class _wrap_class_", bmangle, ";\n", NIL);
683c695
<     Printv(f_wrappers, "SWIGEXPORT(swig_class) _wrap_class_", mangled_classname, " = { \"", class_name,
---
>     Printv(f_wrappers, "swig_class _wrap_class_", mangled_classname, " = { \"", class_name,


3.   If a c++ symbol name is longer than 256, swig seg-faulted because of this
one:

diff -r SWIG/Source/Swig/stype.c /cygdrive/c/Hoffman/SWIG-1.3.17/Source/Swig/stype.c
13c13
---
1083c1083
<   char   tmp[1024];
---
>   char   tmp[256];


4. This next one helped with const class types as return by value.
Swig did not remove the qualifier and could not find const classname in
the type system, so SwigValueWrapper was not used when it should have been.


diff -r SWIG-1.3.17/Source/Modules1.1/lang.cxx /cygdrive/c/Hoffman/CableSwig/SWIG/Source/Modules1.1/lang.cxx
257,258c257,258
<   Node *n;
<   if (!CPlusPlus) return 0;
---
>   Node *n = 0;
>   if (!CPlusPlus) { return 0;}
260,262c260,264
<     SwigType *td = SwigType_typedef_resolve_all(t);
<     if ((n = Swig_symbol_clookup(td,0))) {
<       if ((Strcmp(nodeType(n),"class") == 0) && (!Getattr(n,"allocate:default_constructor") || (Getattr(n,"allocate:noassign")))) {
---
>     SwigType *td = SwigType_typedef_resolve_all(t); 
>     if ((n = Swig_symbol_clookup(td,0)))
>       {
>       if ((Strcmp(nodeType(n),"class") == 0) && (!Getattr(n,"allocate:default_constructor") || (Getattr(n,"allocate:noassign")))) 
>         {
265a268,282
>         }
>       }
>     else
>       {
>       SwigType* ltd = SwigType_ltype(td);
>       if ((n = Swig_symbol_clookup(ltd,0))) 
>         {
>         if ((Strcmp(nodeType(n),"class") == 0) && (!Getattr(n,"allocate:default_constructor") || (Getattr(n,"allocate:noassign"))))
>           {
>           SwigType* lt = SwigType_ltype(t);
>           String *s = NewStringf("SwigValueWrapper< %s >",lt);
>           Delete(td);
>           return s;
>           }
>         }
267d283
<     }
1305d1320
< 


5.  This next one I already sent to you, and is much the same as 4.
diff -r SWIG-1.3.17/Source/Swig/typesys.c /cygdrive/c/Hoffman/CableSwig/SWIG/Source/Swig/typesys.c

1029c1029
<     if (SwigType_istemplate(qtys)) {
---
>     if (!isclass && SwigType_istemplate(qtys)) {


