[Mesa-dev] [PATCH:mesa 2/4] Avoid fighting with Solaris headers over isnormal()

Matt Turner mattst88 at gmail.com
Tue Feb 17 14:12:44 PST 2015


On Tue, Feb 17, 2015 at 1:59 PM, Connor Abbott <cwabbott0 at gmail.com> wrote:
> On Tue, Feb 17, 2015 at 4:41 PM, Alan Coopersmith
> <alan.coopersmith at oracle.com> wrote:
>> On 02/17/15 10:21 AM, Emil Velikov wrote:
>>>
>>> Hi Alan,
>>>
>>> On 16/02/15 02:41, Alan Coopersmith wrote:
>>>>
>>>> When compiling in C99 or C++11 modes, Solaris defines isnormal() as
>>>> a macro via <math.h>, which causes the function definition to become
>>>> too mangled to compile.
>>>>
>>> Is this series sufficient to get mesa working again with Solaris ?
>>
>>
>> No.  There are still two problems in src/glsl/nir/nir.h:
>>
>> 1) #pragma once needs to be replaced with a traditional header guard.
>>    Since gcc listed #pragma once as deprecated, the Solaris Studio
>>    compiler team decided it wasn't worth supporting, and this header
>>    causes failures if it's included twice.  (None of the other #pragma
>>    once headers seem to cause problems in the build.)
>>
>> @@ -25,6 +25,9 @@
>>   *
>>   */
>>
>> +#ifndef __NIR_H__
>> +#define __NIR_H__
>> +
>>  #pragma once
>
> Need to actually remove the pragma? I'm fine with this, using the
> pragma was a silly idea anyways since no one else uses it. I wish it
> were used more generally though.

I don't think so. We use #pragma once in lots of other places (it
typically goes before the #ifndef include guard). I think there was
some indication that when supported it improves compile speed over an
include guard.


More information about the mesa-dev mailing list