From: Rainer Jung <rainer.j...@kippdata.de>

> The file defined "_POSIX_C_SOURCE 2", which results in strcasecmp no 
> longer being defined. Adding "-D__EXTENSIONS__" activates all compatible 
> extensions (on Solaris) and resolves this, if "_POSIX_C_SOURCE 2" is not 
> defined. The Configure entry for Solaris debug already contains 
> -D__EXTENSIONS__. One might only set "_POSIX_C_SOURCE 2" for the 
> platform that needs it. In apps.c it says:
> 
> /* On VMS, you need to define this to get
>     the declaration of fileno().  The value
>     2 is to make sure no function defined
>     in POSIX-2 is left undefined. */
> 
> but then sets it unconditionally for all platforms.

   For the record, on (my handy) VMS (system), <stdio.h> says:

[...]
/*
**  ISO POSIX-1 Extensions
*/
#if defined(_POSIX_C_SOURCE) || !defined(_ANSI_C_SOURCE)
    int (fileno) (__FILE *__stream);
    __FILE_ptr32 fdopen(int __file_desc, const char *__mode);
#endif
[...]

And <decc$types.h> (included by practically everything, including
<stdio.h> and <types.h>) says:

[...]
/*
** Set up feature test macros
*/
# if defined _XOPEN_SOURCE_EXTENDED && !defined _XOPEN_SOURCE
#   define _XOPEN_SOURCE
# endif

# if defined _XOPEN_SOURCE
#   if !defined _POSIX_C_SOURCE
#      define _POSIX_C_SOURCE 2
#   endif
#   if _POSIX_C_SOURCE < 2
#      undef  _POSIX_C_SOURCE
#      define _POSIX_C_SOURCE 2
#   endif
# endif

# if defined _POSIX_SOURCE
#   if !defined _POSIX_C_SOURCE
#      define _POSIX_C_SOURCE 1
#   endif
#   if _POSIX_C_SOURCE < 1
#      undef  _POSIX_C_SOURCE     /*  Use _POSIX_C_SOURCE with a value of 1 */
#      define _POSIX_C_SOURCE 1   /*  instead of _POSIX_SOURCE (obsolete)   */
#   endif
# endif

# if defined _POSIX_C_SOURCE && !defined _ANSI_C_SOURCE
#   define _ANSI_C_SOURCE
# endif
[...]

   I've tested nothing, so I know nothing, but it appears that defining
_XOPEN_SOURCE_EXTENDED (or _XOPEN_SOURCE) before processing any of the
system header files, for example, might be about as effective at
exposing fileno() as defining _POSIX_C_SOURCE directly.  Around here,
_XOPEN_SOURCE_EXTENDED seems usually to get more things enabled, not
disabled, so it might be safer eleswhere, too.

------------------------------------------------------------------------

   Steven M. Schweda               sms@antinode-info
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to