What I started doing over in the browser side is minimizing the ifdefs
with stub classes and functions. That way, the code is left mostly
unchanged and compiles as-is except you also have a record, in a
separate file called something like "temp_browser_scaffolding.h", that
lists every class that's been "mocked" this way. It's easy to see at a
glance what still needs filling in because it's still in that file.

The result has worked nicely, allowing browser_main() to compile with
only a small handful of idefs. This may not work with other files
bottom-up, it's clearly a top-down porting style.

On Thu, Jan 15, 2009 at 9:01 PM, Evan Martin <e...@chromium.org> wrote:
>
> When you #ifdef around some code to make things temporarily link, but
> know that you'll need to bring that code (or its functional
> equivalent) back at some point, please mark those points carefully.  I
> fear that we'll eventually have everything building and linking
> together at some point and it'll crash and there will be 30,000 #ifdef
> OS_WIN where 20 of them were temporary hacks.
>
> Here's the pattern I use:
> #if defined(OS_WIN)
>  // code as before
> #else
>  // TODO(port): <explanation of what is wrong with the above>
>  NOTIMPLEMENTED();  // so you get a run time error message rather
> than mystery crash
> #endif
>
> >
>



-- 
Mike Pinkerton
Mac Weenie
pinker...@google.com

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to