Re: /bzr/squid3/trunk/ r10080: Portability fix: __FUNCTION__ is not available on all preprocessors.

View: New views
6 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: /bzr/squid3/trunk/ r10080: Portability fix: __FUNCTION__ is not available on all preprocessors.

by Henrik Nordstrom-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ons 2009-11-04 klockan 17:20 +0100 skrev Francesco Chemolli:

>   Portability fix: __FUNCTION__ is not available on all preprocessors.

> +#ifdef __FUNCTION__
> +#define _SQUID__FUNCTION__ __FUNCTION__

Do this really work?

__FUNCTION__ is not a preprocessor symbol, it's a magic compiler
variable.

Regards
Henrik


Re: /bzr/squid3/trunk/ r10080: Portability fix: __FUNCTION__ is not available on all preprocessors.

by Kinkie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It seems to work with __PRETTY_FUNCTION__ a few lines below, and it builds... :)
I'd guess that it works exactly because it's a magic variable, and
thus its binding is delayed to a later moment in the parsing chain.




On Thu, Nov 5, 2009 at 12:09 AM, Henrik Nordstrom
<henrik@...> wrote:

> ons 2009-11-04 klockan 17:20 +0100 skrev Francesco Chemolli:
>
>>   Portability fix: __FUNCTION__ is not available on all preprocessors.
>
>> +#ifdef __FUNCTION__
>> +#define _SQUID__FUNCTION__ __FUNCTION__
>
> Do this really work?
>
> __FUNCTION__ is not a preprocessor symbol, it's a magic compiler
> variable.
>
> Regards
> Henrik
>
>



--
    /kinkie

Re: /bzr/squid3/trunk/ r10080: Portability fix: __FUNCTION__ is not available on all preprocessors.

by Robert Collins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-11-05 at 01:00 +0100, Kinkie wrote:
> It seems to work with __PRETTY_FUNCTION__ a few lines below, and it builds... :)

Does it render right though?
-Rob


signature.asc (204 bytes) Download Attachment

Re: /bzr/squid3/trunk/ r10080: Portability fix: __FUNCTION__ is not available on all preprocessors.

by Kinkie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Nov 5, 2009 at 2:58 AM, Robert Collins
<robertc@...> wrote:
> On Thu, 2009-11-05 at 01:00 +0100, Kinkie wrote:
>> It seems to work with __PRETTY_FUNCTION__ a few lines below, and it builds... :)
>
> Does it render right though?

I still don't know, as squid-SunCC still doesn't build.
If you prefer, I can move this to development thread to a
feature-branch and merge later.


--
    /kinkie

Re: /bzr/squid3/trunk/ r10080: Portability fix: __FUNCTION__ is not available on all preprocessors.

by Robert Collins :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-11-05 at 07:49 +0100, Kinkie wrote:
>
> >> It seems to work with __PRETTY_FUNCTION__ a few lines below, and it
> builds... :)
> >
> > Does it render right though?
>
> I still don't know, as squid-SunCC still doesn't build.

I mean with gcc :)

-Rob



signature.asc (204 bytes) Download Attachment

Re: /bzr/squid3/trunk/ r10080: Portability fix: __FUNCTION__ is not available on all preprocessors.

by Henrik Nordstrom-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

tor 2009-11-05 klockan 20:19 +1100 skrev Robert Collins:

> On Thu, 2009-11-05 at 07:49 +0100, Kinkie wrote:
> >
> > >> It seems to work with __PRETTY_FUNCTION__ a few lines below, and it
> > builds... :)
> > >
> > > Does it render right though?
> >
> > I still don't know, as squid-SunCC still doesn't build.
>
> I mean with gcc :)

Same here, that #ifdef should always evaluate to false..