adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] SWIG Advanced topics


From: Kai Sterker
Subject: Re: [Adonthell-devel] SWIG Advanced topics
Date: Mon, 24 Feb 2003 12:30:07 +0100

On Sun, 23 Feb 2003 18:09:06 +0100 Alexandre Courbot wrote:

> > Obviously we'll have multiple modules, but we would want them to
> > interoperate. So I imagine that we can't get around linking against
> > the SWIG runtime library.
> 
> Mmm. I did some tests about multiple modules with swig recently, and I
> had no problem. Of course I haven't done all the crazy things they
> suggest. But would we ever need in a module to inheritate from a class
> in another module? I don't think so.

Probably not :).

But what we'll do is using classes from other modules in a module. Which
means that plenty of classes will be wrapped a number of times.
Moreover, the SWIG code will be contained in each module. As long as all
SWIG functions are declared static, that doesn't hurt, but the new item
code for example already requires access to SWIG functions (so they
can't be static). I fear there will be conflicts when linking.
 

> > The downside of this is yet another dependence. But on the other
> > hand, we could easily replace our custome pass_instance code with a
> > call to the appropriate SWIG function (SWIG_ConvertPtr).
> 
> As long as the dependancy is on the developer side, and not the player
> side, that's ok I think.

That is the problem. It wouldn't be on the developer side :(. Unless we
include the code for the library like we did with SDL Mixer. Shouldn't
be a problem at all, I think. Look at SWIG-1.3.xx/Runtime/Makefile.in.
It's a single file that needs be assembled and compiled. We could easily
ship that file with Adonthell's source code.

That would remove the need to keep a copy of each module's dictionary
for our pass_instance method. That method could further use the
functions SWIG provides to do it's job, meaning it no longer needs be
changed when SWIG's internals change.

So I would be all for that solution.

Kai




reply via email to

[Prev in Thread] Current Thread [Next in Thread]