[webkit-dev] WTF USE(...) macro

Maciej Stachowiak mjs at apple.com
Wed Apr 29 12:15:44 PDT 2015


> On Apr 29, 2015, at 9:56 AM, Martin Robinson <mrobinson at webkit.org> wrote:
> 
> Hi, please forgive my continuing quest into the realm of small build cleanups.
> 
> We have some handy WTF macros to deal with build variables. For example
> 
> #if ENABLE(WHATEVER)
> 
> will be true if ENABLE_WHATEVER is defined and not 0. There are a few
> others such as PLATFORM(...) and USE(...). One irregularity in the
> current system is that USE(WHATEVER) looks for WTF_USE_WHATEVER
> instead of USE_WHATEVER. Is this an important distinction? Would there
> be any reason to not have this look for USE_WHATEVER instead? I
> believe this would simplify the CMake build system slightly and
> prevent some simple mistakes in the future.

I don’t remember why it was this way originally. It seems like HAVE and ENABLE don’t expect a prefix, but USE, OS, CPU, PLATFORM, COMPILER, COMPILER_SUPPORTS and COMPILER_QUIRK all expect a WTF prefix.

I think the intent was to avoid polluting the global namespace (so prefix most things), but try to be compatible with macros that might be defined by a “configure” script. Based on that, it seems like HAVE, ENABLE and USE should all expect prefix-less macros.

Regards,
Maciej



More information about the webkit-dev mailing list