Re: [gdome]RE: [gdome]on minimizing dependencies



On Tue, 9 Oct 2001, Daniel Veillard wrote:

> On Tue, Oct 09, 2001 at 11:52:38AM +0200, Uwe Fechner wrote:
> > Also it would make it easier to write pascal wrappers if the gdome
> > header file
> > would not incluce glib.h and libxml/tree.h.
>
>   What is the problem with including libxml/tree.h ?

There are two reasons not to include libxml/tree.h in gdome.h.

The first is a question of style. A library header file should not include
header files that their users do not need. libgdome is designed to hide
libxml's tree interface behind a DOM compliant interface. Users of
libgdome cannot even access the libxml tree nodes from the DOM nodes with
public methods. So there is simply no need for this inclusion, it is only
an unnecessary compile time dependency.

The second reason is that it may well cause problems. The libgdome user
has to set up the proper include path for libxml too, although he does not
need the headers. The xml2-config script does not work on systems without
a unix shell.

And if libxml was compiled with one compiler, and the application using
libgdome is compiled with another, different preprocessor symbols might
get defined and different include files might get included in different
#ifdef branches, resulting in uncompileable or unlinkable applications.

Don't get me wrong. You have done a great job in making libxml portable,
it compiled out of the box almost everywhere I tried it. (I'll send you an
updated Makefile.mingw when I rewrote it. It seems to be a bit out of
date, so I compiled libxml from the shell.)

Bye, Tobias.





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