Re: [pcre-dev] More Windows-related/misc. tweaks
|This message is part of the following thread:|
|the complete thread tree sorted by date|
|Philip Hazel at|
|Philip Hazel at|
(1) It is indeed a local file, but remember that the behavior is slightly different for #include<> versus #include"". More on this in a moment.
(2) Not necessarily. The autotools configuration can easily be tweaked to pass all the preprocessor symbols as -Dfoo=bar directives on the compiler command line instead. Not that we would do that, but in cases where PCRE is being built using an alternative build system, it's helpful to have the flexibility of using a config header or not.
(3) This way, it's much easier to ensure that all the files are consistently/correctly #including config.h. What about those files that don't #include pcre_internal.h? Or that don't #include it as the first file? You have to do a lot more mental gymnastics in such cases to ensure that config.h is the first non-comment bit that the preprocessor sees.
The package should `#include' the configuration header file before any other header files, to prevent inconsistencies in declarations (for example, if it redefines const).
To provide for VPATH builds, remember to pass the C compiler a -I. option (or -I..; whichever directory contains config.h). Even if you use `#include "config.h"', the preprocessor searches only the directory of the currently read file, i.e., the source directory, not the build directory.
With the appropriate -I option, you can use `#include <config.h>'. Actually, it's a good habit to use it, because in the rare case when the source directory contains another config.h, the build directory should be searched first.
-- NAME = Daniel Richard G. ## Remember, skunks _\|/_ meef? EMAIL1 = skunk@??? ## don't smell bad--- (/o|o\) / EMAIL2 = skunk@??? ## it's the people who < (^),> WWW = http://www.******.org/ ## annoy them that do! / \ -- (****** = site not yet online)
|This message was posted to the following mailing lists:|
Mailing List Info | Nearby Messages
|Re: [pcre-dev] More Windows-related/misc. tweaks||[pcre-dev] [Bug 571] New: Availability of recursive and non-recursive functions in same library|
|Tahini and Hummus Development Archives administrated by Hummus Admins||Lurker (version 2.3)|