Using config_xxx.h instead of -DHAVE_XXX

Norbert Thiebaud nthiebaud at
Fri Dec 7 10:17:05 PST 2012

On Fri, Dec 7, 2012 at 11:42 AM, Lubos Lunak <l.lunak at> wrote:
>  There are more such -D options that could be changed, although with some it'd
> be better be careful, e.g. OSL_DEBUG can't go there, because it can be
> overriden by command-line,

That is a case of addinf a guard in config.h
#ifndef HAVE_FOO
#define HAVE_FOO <0|1>

and always use these HAVE_xx
#if HAVE_  #if !HAVE_

rather than
#ifdef HAVE_
#ifndef HAVE_

>and I'm not sure if adding #include
> <config_global.h> to sal/config.h would be really included everywhere where
> needed.

One remark...
can we generate these in $WORKDIR   like $WORKDIR/inc/config/* or
something to that effect
and have
#include <config/vckplug.h>
rather than include <config_vclplug.h>

and we could also mandate that every source need to include
#include <config/lo.h>
or some some other thoroughly bikesheded name
which would in turn include  the global config, sal/config and other
fundamental includes



More information about the LibreOffice mailing list