[C++-sig] Re: Do SWIP, SIP have a "cross-module" feature? (Ralf W. Grosse-Kunstleve)

David Beazley beazley at cs.uchicago.edu
Fri Dec 13 03:18:47 CET 2002


 > 
 > Thanks for the reply! Based on these hints I finally found the corresponding
 > SWIG documentation ( http://www.swig.org/Doc1.1/HTML/Advanced.html ).
 > 
 > I see that linking with the static runtime is a simple way of avoiding any
 > cross-module type conversion conflicts. The more interesting case however is if
 > there are two SWIG-based multi-extension-module packages where all modules are
 > linked against the central shared runtime (libswigpy.so). If package A
 > registers conversions for, say, std::vector<int>, and package B registers
 > different conversions for the same type, how does SWIG resolve the ambiguity?
 >

Modules don't register "conversions" in SWIG so I'm not entirely sure
what you're talking about here.  The shared runtime is only used to
manage cross-module type names (typedef, inheritance across modules,
etc.).  There's a big difference between a typename (a string) and a
conversion (code). If two modules have different conversions for the
same type, that's no big deal for SWIG.  Of course, the end result
might be confusing for the user (types in one module might produce
conversion errors in the other module).  However, that's a programmer
problem, not a SWIG problem.

Cheers,

Dave





More information about the Cplusplus-sig mailing list