From kde-core-devel Tue Nov 06 22:30:55 2007 From: David Jarvie Date: Tue, 06 Nov 2007 22:30:55 +0000 To: kde-core-devel Subject: Re: [PATCH] Extra #include options in kconfig_compiler Message-Id: <200711062230.55640.lists () astrojar ! org ! uk> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=119438829313396 On Tuesday 06 November 2007 21:30:47 David Faure wrote: > On Friday 05 October 2007, David Jarvie wrote: > > Attached is a patch to allow the specification of #include's in the > > source file generated by kconfig_compiler (as opposed to #include's in > > the header file which are currently catered for), by the addition of a > > SourceIncludeFiles keyword in the .kcfgc file. It seems sensible not to > > force the inclusion of unneeded #include statements in the generated > > header if they are only needed in the source. This will enable me to > > easily fix a circular #include chain in code I'm writing, which would > > need much more work to solve by other means. (The problem isn't because > > of lack of include guards, but due to classes needing each other to be > > defined.) > > > > The patch also allows the specification of #include "xxx.h" instead of > > #include by enclosing the name of the header file in double > > quotes. For example, in the .kcfgc file: > > > > IncludeFiles=kglobal.h,\"myfile.h\" > > SourceIncludeFiles=\"project.h\",kurl.h > > I see this was committed; good feature. > > A related question: the .kcfg file can have tags; this is > redundant (equivalent) with IncludeFiles in the kcfgc, right? However the > .kcfg file seems like a better place for include specification to me, since > it's closer to where the includes are needed (e.g. when a default value > needs a #include to compile). The problem is that in the .kcfg there is no > way to specify "source includes", it seems? > > What do I miss? Is there a good reason for specifying includes in the > .kcfgc rather than in the .kcfg, assuming we add a or > or something to kcfg files? There was no particularly good reason - in fact I started writing the patch to allow their specification in the .kcfg, but then discovered the relatively new IncludeFiles statement in the .kcfgc, and patched it instead. It doesn't really seem necessary to be able to specify includes in both files, and I agree that on balance it is probably cleaner to have them only in the .kcfg. -- David Jarvie. KAlarm author and maintainer. http://www.astrojar.org.uk/kalarm