[haiku-development] Re: GCC 2.95 and certain #define macros

  • From: "Ryan Leavengood" <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 21 Aug 2007 10:52:56 -0400

On 8/21/07, Philippe Houdoin <philippe.houdoin@xxxxxxx> wrote:
>
> Did you try to simplify this silly macro to this:
>
> #define PLATFORM(WTF_FEATURE) WTF_PLATFORM_##WTF_FEATURE
>
> According to #if preprocessing directive specification, any undefined 
> identifier
> will be evaluated as 0.
>
> Which means "#if PLATFORM(DARWIN)" will give "#if WTF_PLATFORM_DARWIN" which,
> logically, should be evaluated to zero if such identifier is undefined.
>
> I failed to see why someone defining a macro as an expression will ever needs 
> to
> check if an identifier is defined before evaluating its value, as 0 is 
> specified
> as the default value for any undefined identifier...
>
> Anyway, maybe it worth a try.

You are right, based on what I've been reading. I agree it is kind of
silly and will investigate making this change tonight. Maybe all this
discussion about GCC 2.95.3 versus GCC 4 will be moot if the changes
needed actually FIX the WebKit code like the above :)

Ryan

Other related posts: