[prev in list] [next in list] [prev in thread] [next in thread] 

List:       webkit-dev
Subject:    Re: [webkit-dev] Proposal for a new way to handle porting #ifdefs
From:       Maciej Stachowiak <mjs () apple ! com>
Date:       2009-05-24 7:19:56
Message-ID: 906BE415-EB88-4E2C-99BD-387E378BB495 () apple ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On May 23, 2009, at 9:38 AM, David Kilzer wrote:

> Another aspect of this proposal is how to handle source files that  
> have #if ENABLE(FEATURE)/#endif guards around all of their source  
> code, for example:
>
> Bug 25756: Explicit guards for ENABLE_GEOLOCATION
> https://bugs.webkit.org/show_bug.cgi?id=25756
>
> There are essentially two options here:
>
> 1. Add #if/#endif guards to entire source files, but include every  
> file in every build system.
>
> 2. Make each build system smart enough to exclude source files that  
> implement a feature, thus pushing the policy decision down (up?)  
> into the build system (which is where most of the decisions are made  
> today anyway).
>
> I think #2 is a much cleaner way to handle this since it removes  
> clutter from the code (at the cost of duplicating knowledge of which  
> files go with with features into each build system).
>
> Does anyone else have an opinion on this?


I know there is a potential compile time tradeoff, but in some ways it  
would be nicer if all build systems built the same set of files, and  
we ifdef'd the contents. That would put the policy decisions all in  
one place (the port header).

Regards,
Maciej


[Attachment #5 (text/html)]

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space; "><br><div><div>On May 23, 2009, at 9:38 AM, \
David Kilzer wrote:</div><br class="Apple-interchange-newline"><blockquote \
type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: \
rgb(0, 0, 0); font-family: verdana; font-size: 13px; font-style: normal; \
font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: \
normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; \
white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: \
0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; \
-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><div \
style="font-family: verdana, helvetica, sans-serif; font-size: 10pt; margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><div style="margin-top: \
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Another aspect of \
this proposal is how to handle source files that have #if ENABLE(FEATURE)/#endif \
guards around all of their source code, for example:</div><div style="margin-top: \
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
">Bug 25756: Explicit guards for ENABLE_GEOLOCATION</div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span><a target="_blank" \
href="https://bugs.webkit.org/show_bug.cgi?id=25756">https://bugs.webkit.org/show_bug.cgi?id=25756</a></span></div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
"><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; \
margin-left: 0px; ">There are essentially two options here:</div><div \
style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; \
"><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; \
margin-left: 0px; ">1. Add #if/#endif guards to entire source files, but include \
every file in every build system.</div><div style="margin-top: 0px; margin-right: \
0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">2. Make each build system \
smart enough to exclude source files that implement a feature, thus pushing \
the&nbsp;policy decision down (up?) into the build system (which is where most of the \
decisions are made today anyway).</div><div style="margin-top: 0px; margin-right: \
0px; margin-bottom: 0px; margin-left: 0px; "><br></div><div style="margin-top: 0px; \
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I think #2 is a much \
cleaner way to handle this since it removes clutter from the code (at the cost of \
duplicating knowledge of which files go with with features into each build \
system).</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; \
margin-left: 0px; "><br></div><div style="margin-top: 0px; margin-right: 0px; \
margin-bottom: 0px; margin-left: 0px; ">Does anyone else have an opinion on \
this?</div></div></div></span></blockquote></div><div><br></div><div>I know there is \
a potential compile time tradeoff, but in some ways it would be nicer if all build \
systems built the same set of files, and we ifdef'd the contents. That would put the \
policy decisions all in one place (the port \
header).</div><div><br></div><div>Regards,</div><div>Maciej</div><div><br></div></body></html>




_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic