[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
doc isinf isnan function portability
From: |
Kevin Ryde |
Subject: |
doc isinf isnan function portability |
Date: |
Thu, 05 Aug 2004 11:36:06 +1000 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) |
* doc/autoconf.texi (Function Portability): Add notes on isinf and
isnan as macros versus functions.
This arose in guile, where Andreas Vögele found AC_CHECK_FUNCS for
isinf and isnan insufficient on HP-UX. We ended up with an
AC_LINK_IFELSE that included <math.h>, which is what I've tried to
alude to in the words below. Not sure if that's as clear as it could
be.
@item @code{isinf}
@itemx @code{isnan}
@c @fuindex isinf
@c @fuindex isnan
@prindex @code{isinf}
@prindex @code{isnan}
The ISO C99 standard specifies that @code{isinf} and @code{isnan} are
macros. On some systems just macros are available (eg.@: HP-UX), on
some systems both macros and functions (eg.@: glibc 2.3.2), but on some
systems only functions (eg.@: IRIX 6 and Solaris 8).
For maximum portability therefore a function test with
@code{AC_CHECK_FUNCS} or similar should be used as well as
@code{#ifdef}. (@code{AC_CHECK_FUNCS} doesn't detect macros from
@code{<math.h>}. A custom @code{AC_LINK_IFELSE} test could be made to
detect both though, if single @code{HAVE_ISINF} and @code{HAVE_ISNAN}
conditions are easier to use.)
- doc isinf isnan function portability,
Kevin Ryde <=