(XS) RFR: 8077674: BSD build failures due to undefined macros

David Holmes david.holmes at oracle.com
Thu Apr 16 07:28:09 UTC 2015


On 16/04/2015 4:49 PM, Dmitry Samersoff wrote:
> David,
>
> There are two different CPP styles
>
> One is
>
> #ifdef VAR
>
> Other one is
>
> #if defined(VAR)
>
> They are equivalent and either of them looks good for me, so I don't see
> a reason to change all defines across entire hotspot code but
>
> I would prefer to don't mix two styles within the single #if block.

Ah now I see your point. Okay.

But with the elif -> else if solution everything is ifdef so that is 
okay again.

Thanks,
David


> -Dmitry
>
> On 2015-04-14 23:25, David Holmes wrote:
>> Hi Dmitry,
>>
>> On 14/04/2015 9:25 PM, Dmitry Samersoff wrote:
>>> David,
>>>
>>> It's better to change
>>>
>>> #ifdef __APPLE__
>>>
>>> to
>>>
>>> #if defined(__APPLE__)
>>
>> Why? They seem 100% equivalent. Plus that would mean a lot of changes.
>> Plus we use that pattern in many, many, many places.
>>
>> Thanks,
>> David
>>
>>> -Dmitry
>>>
>>>
>>> On 2015-04-14 13:20, David Holmes wrote:
>>>> webrev:
>>>>
>>>> http://cr.openjdk.java.net/~dholmes/8077674/webrev/
>>>>
>>>>   From the original error report:
>>>>> "-Wundef option causes GCC to warn whenever it encounters an identifier
>>>>> which is not a macro in an ‘#if’. "
>>>>>
>>>>> Hence we should be using
>>>>>
>>>>> #elif defined(__FreeBSD__)
>>>>>
>>>>> etc in this context.
>>>>
>>>> I also founds similar suspect usages in os_linux.cpp and os_windows.cpp.
>>>>
>>>> Thanks,
>>>> David
>>>
>>>
>
>


More information about the hotspot-runtime-dev mailing list