Protect included headers with the proper autoconf macros

Jacek Caban jack at itma.pwr.wroc.pl
Wed Aug 10 03:35:04 CDT 2005


Mike McCormack wrote:

>
>> This patch causes the compile error for me. I have libxml2 headers
>> but I don't have a library. XML2INCL is defined only if the configure
>> script found library so gcc cannot find my headers at compile time.
>> If you want to change it, you'll have to change configure.ac as well,
>> but why do you want to include libxml if it won't be used anyway?
>
>
> Probably better to do:
>
> #ifdef HAVE_LIBXML2
>
> #ifdef HAVE_LIBXML_PARSER_H
> #include <libxml/parser.h>
> #endif
>
> ...
>
> #endif
>
> That way we have the right include guard and we'll only compile if we 
> have the library too.
>
> Mike

But it won't change anything as if HAVE_LIBXML2 is defined
then HAVE_LIBXML_PARSER_H is defined too, so
#ifdef HAVE_LIBXML_PARSER_H will be always true here.

Jacek



More information about the wine-devel mailing list