[webkit-dev] renaming ASSERT macro

Darin Adler darin at apple.com
Tue Jul 1 08:41:34 PDT 2008

On Jul 1, 2008, at 1:45 AM, Jörg Bornemann wrote:

> This solution is easy to do, leads to the smallest source diff but  
> is a very dirty hack, which will lead to problems on WinCE, because  
> we will include windows.h in public headers.

Adding <windows.h> to Assertions.h will not cause it to be included in  
public headers. Assertions.h is not designed to be used in public  
headers; it's for internal use inside the WebKit project.

And "is a very dirty hack" is not a technical argument.

> So what's your argument against the clean solution (renaming)?

For one thing, I don't like the other names you suggested.

We've used ASSERT for the lifetime of the WebKit project, many years.  
It appears in thousands of lines of code. I don't want to make a  
global change in that name because of a WinCE-specific issue unless  
there's no other solution.

There are numerous examples where internal WebKit things conflict with  
platform headers or macros and we've been able to resolve them without  
renaming the WebKit things. To give one small example, we use "id" in  
WebKit even though that's a special reserved word on Mac OS X in  
Objective-C. We also manage to use min and max despite the definitions  
in <windef.h>. We work around these bugs in platform header design in  
ways that don't require us to change the bulk of the WebKit code.

If your argument was that ASSERT is not a good name and you were  
making a case for a better name on the basis of clarity and coding  
style, I'd be happy to consider and debate that.

Lets do the local solution in Assertions.h. Then we will have code  
that compiles and works on WinCE, and then we can debate the concrete  
merits of other solutions at our leisure.

     -- Darin

More information about the webkit-dev mailing list