|
From: Frederic B. <fre...@fr...> - 2006-02-18 15:53:25
|
Melchior FRANZ a =E9crit : > * Frederic Bouvier -- Saturday 18 February 2006 16:29: > =20 >> Modified Files: >> voice.cxx=20 >> Log Message: >> Not missing but at the wrong place >> =20 > > Ah, OK. (Normally, one should keep #includes away from header > files as much as possible, but as class definitions contain short > code parts, this CONFIG_H is better put there. So I'd rather > prefer to not have it in voice.cxx again, if it has no meaning > anyway.) > > > But frankly, I don't get this noise in all files: > > #ifdef HAVE_CONFIG_H > # include <config.h> > #endif > > Why the #ifdef? Is there a reasonable case where CONFIG_H is > *not* available? Isn't it created by the build system? Doesn't > its absence tell us that something went very wrong? So why do > we even think about compiling files without it? > > And *iff* it can be missing in some relevant case. Why don't we > have a much saner file fgfs.h that is to be included everywhere > *instead*, which contains just: > > /* fgfs.h */ > #ifdef HAVE_CONFIG_H > # include <config.h> > #endif > > m. > > =20 It has always been the practice to enclose #include <config.h> by #ifdef HAVE_CONFIG_H from the beginning of autoconf/automake. It is already included in global.hxx, but people aren't including it eith= er. I don't mind which form it has, but this file that include system peculiarities should be included at first place in every compiled c++ file one way or another. -Fred |