[openssl-dev] [openssl.org #4144] patch: Use '__sun' instead of 'sun' for strict ISO conforming, compiler/options

Richard PALO via RT rt at openssl.org
Sun Nov 22 13:23:21 UTC 2015


Le 22/11/15 14:08, Andy Polyakov via RT a écrit :
>>>> I'd like to propose the attached patch to 1.0.2d which avoids problems
>>>> with strict ISO conforming compiler/options, which do not define 'sun' only
>>>> '__sun' as usual... such as gcc/clang -std=c99
>>>>
>>>> This affects the build itself, but also any user of openssl/opensslconf.h
>>>
>>> I've commited only the part that applied to the master branch, but
>>> fixed that in all the branches.  Please let me know if you need
>>> other changes in the stable branches.
>>
>> ... If support [for SunOS 4] is not
>> disclaimed then correct approach would be to look at target system, not
>> what gcc/clang do on Linux.
> 
> In other words I argue in favour of reverting suggested change in
> 1.0.1/2. Because I can't find evidence that __sun is defined on said
> platform.
> 
> 
> 
> 
FWIW, the generally accepted and documented platform tests include:
>  #ifdef __sun
>  /* this is SunOS */
>  #endif
> 
>  #if defined(__sun) && defined(__SVR4)
>  /* this, in particular, is Solaris */
>  #endif

Naturally you can then add in hw architecture checks...
-- 
Richard PALO




More information about the openssl-dev mailing list