On Sun, Jun 20, 2004 at 11:37:08AM -0500, Bob Jamison wrote:
What is the purpose of require-config.h?
The verb enum in verbs.h contains
... #ifdef HAVE_GTK_WINDOW_FULLSCREEN SP_VERB_FULLSCREEN, #endif /* HAVE_GTK_WINDOW_FULLSCREEN */ SP_VERB_VIEW_NEW, ...
so the value of e.g. SP_VERB_VIEW_NEW depends on whether HAVE_GTK_WINDOW_FULLSCREEN is defined.
It could be bad if some translation units #included verbs.h without previously including config.h (which defines HAVE_GTK_WINDOW_FULLSCREEN iff appropriate). There are two possible fixes for this:
i) have verbs.h #include <config.h> (perhaps conditionally on HAVE_CONFIG_H, see below).
ii) have verbs.h #include <require-config.h>, which should force a compilation error iff <config.h> hasn't already been included.
Autoconf documentation (*see (autoconf)Configuration Headers) recommends that config.h be included before any other headers. If we heed this advice, then we should use approach (ii).
However, the reasons for its recommendations are not as important for C++ as for C. E.g. our config.h should never contain `#define const', as basic support for `const' (e.g. recognizing `T' and `T const' as distinct types) is fairly important for a C++ compiler.
Even so, the consistency of (ii) (having the config.h definitions present for all header files) does have some appeal.
The advantage of (i) over (ii) is having one less header file: developers don't ask themselves what require-config.h is.
config.h seems to be always required, so maybe we can instead get rid of the #ifdef HAVE_CONFIG_H switches?
Making `#include <config.h>' conditional on HAVE_CONFIG_H allows compiling even if configured without AC_CONFIG_HEADERS, i.e. having -D flags on the command-line instead of creating config.h (see the above-cited section of autoconf documentation). Not a big deal.
Where did src/config.h.win32 come from? I thought it was deleted. I someone intending on building Inkscape with MSVC?
Given that require-config.h triggered a compile error for you, I'm guessing that you're using config.h.win32: the macro tested by require-config.h wasn't present in config.h.win32 until about a day after require-config.h was introduced. Just a guess, I'm not very familiar with inkscape's compilation on windows.
pjrm.