Re: [libxml++] [patch] Global initialization code



Good morning,

Le Vendredi 17 Juin 2005 09:39, Thomas Jarosch a écrit :
> > > I was typing faster than thinking... doing nothing is not possible
> > > as libxml2 needs to be initialized. IMHO there is no ABI compatible
> > > way of replacing the global initialization code, is there?
> >
> > I think so, with the global init doing nothing IF an environnement
> > variable "LIBXMLPP_NO_STATIC_INIT" has been defined.
>
> This still requires recompilation and is therefore not ABI compatible,
> IMHO.

I think I disagree : the current global initialisation is done by Init::Init. 
We can, without breaking the ABI, change its behavior so it does nothing when 
a particular environment variable is set.
We can add another class, let's say InitNG, which does what you suggested for 
Init.
This way people who want to do manual initialisation can do it by setting this 
variable.

Another way I just thought about is not to change Init::Init behavior, but 
adding both another init class and a free function (probably a static 
function of the new init class) which undo what Init have done and forces 
it's destructor not to do anything.
The advantage is that the proper behavior of the program does not depend on a 
user intervention.

Christophe

Attachment: pgpGGWqDaDTxk.pgp
Description: PGP signature



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