[PATCH] Extra #include options in kconfig_compiler

David Jarvie lists at astrojar.org.uk
Fri Oct 5 21:19:49 BST 2007


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 <xxx.h> 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

This would result in the following includes in the generated header file:

#include <kglobal.h>
#include "myfile.h"

and in the generated source file:

#include "project.h"
#include <kurl.h>


In the .kcfg file:

<include>kglobalsettings.h</include>
<include>"timeperiod.h"</include>

would generate in the header file:

#include <kglobalsettings.h>
#include "timeperiod.h"


There should be no impact on existing code. Comments?

-- 
David Jarvie.
KAlarm author and maintainer.
http://www.astrojar.org.uk/kalarm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: config.diff
Type: text/x-diff
Size: 4140 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071005/8fd3867d/attachment.diff>


More information about the kde-core-devel mailing list