[webkit-dev] Re: [webkit-changes] [29033] trunk

Alp Toker alp at atoker.com
Tue Jan 1 00:19:46 PST 2008


Darin Adler wrote:
> The #if at include sites approach is better for people who want to omit 
> the code entirely for features that are not enabled. You don't even need 
> the headers in your patch. But the #if in headers approach is probably 
> lower maintenance, since there are usually multiple includes for each 
> header.

I have a slight preference for Jan's convention, B:

(A)
     #include "DatabaseTracker.h"

(B)
     #if ENABLE(DATABASE)
     #include "DatabaseTracker.h"
     #endif

  * B avoids triggering rebuilds every time DatabaseTracker.h is 
changed, saving time for developers who track TOT.

  * B cuts down stat() calls at build time. Makes a difference when 
building on Windows where this operation is slow.

  * A doesn't make it clear that DATABASE is optional so it's more 
likely to lead to build breakage by new developers who may be unaware 
the these features can be disabled. B makes it very clear that database 
code needs to be guarded.

So while there's precedent for both A and B in WebCore I think we've 
made a improvement here.

Still no strong objections if you want to back this out.


More information about the webkit-dev mailing list