Mercurial > hg > octave-nkf > gnulib-hg
changeset 16606:c65f617394a7
expm1l: Don't override undeclared system function on IRIX 6.5.
* lib/math.in.h (expm1l): Test HAVE_DECL_EXPM1L, not HAVE_EXPM1L.
* m4/expm1l.m4 (gl_FUNC_EXPM1L): Don't assume expm1l() is declared when
it exists. Set HAVE_DECL_EXPM1L.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize HAVE_DECL_EXPM1L, not
HAVE_EXPM1L.
* modules/math (Makefile.am): Substitute HAVE_DECL_EXPM1L, not
HAVE_EXPM1L.
* doc/posix-functions/expm1l.texi: Mention missing declaration problem.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 08 Mar 2012 04:01:51 +0100 |
parents | 65abd231dc80 |
children | 8b3e493a6849 |
files | ChangeLog doc/posix-functions/expm1l.texi lib/math.in.h m4/expm1l.m4 m4/math_h.m4 modules/math |
diffstat | 6 files changed, 39 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2012-03-07 Bruno Haible <bruno@clisp.org> + + expm1l: Don't override undeclared system function on IRIX 6.5. + * lib/math.in.h (expm1l): Test HAVE_DECL_EXPM1L, not HAVE_EXPM1L. + * m4/expm1l.m4 (gl_FUNC_EXPM1L): Don't assume expm1l() is declared when + it exists. Set HAVE_DECL_EXPM1L. + * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize HAVE_DECL_EXPM1L, not + HAVE_EXPM1L. + * modules/math (Makefile.am): Substitute HAVE_DECL_EXPM1L, not + HAVE_EXPM1L. + * doc/posix-functions/expm1l.texi: Mention missing declaration problem. + 2012-03-07 Bruno Haible <bruno@clisp.org> remainderl: Don't override undeclared system function on IRIX 6.5.
--- a/doc/posix-functions/expm1l.texi +++ b/doc/posix-functions/expm1l.texi @@ -10,7 +10,10 @@ @itemize @item This function is missing on some platforms: -FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, IRIX 6.5, Solaris 9, Cygwin, mingw, MSVC 9, Interix 3.5, BeOS. +FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, Minix 3.1.8, AIX 5.1, HP-UX 11, older IRIX 6.5, Solaris 9, Cygwin, mingw, MSVC 9, Interix 3.5, BeOS. +@item +This function is not declared on some platforms: +IRIX 6.5. @end itemize Portability problems not fixed by Gnulib:
--- a/lib/math.in.h +++ b/lib/math.in.h @@ -579,7 +579,7 @@ #endif #if @GNULIB_EXPM1L@ -# if !@HAVE_EXPM1L@ +# if !@HAVE_DECL_EXPM1L@ _GL_FUNCDECL_SYS (expm1l, long double, (long double x)); # endif _GL_CXXALIAS_SYS (expm1l, long double, (long double x));
--- a/m4/expm1l.m4 +++ b/m4/expm1l.m4 @@ -1,4 +1,4 @@ -# expm1l.m4 serial 1 +# expm1l.m4 serial 2 dnl Copyright (C) 2010-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -22,6 +22,11 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include <math.h> + extern + #ifdef __cplusplus + "C" + #endif + long double expm1l (long double); long double (*funcptr) (long double) = expm1l; long double x;]], [[return funcptr (x) > 0.5 @@ -41,6 +46,11 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include <math.h> + extern + #ifdef __cplusplus + "C" + #endif + long double expm1l (long double); long double (*funcptr) (long double) = expm1l; long double x;]], [[return funcptr (x) > 0.5 @@ -53,9 +63,15 @@ EXPM1L_LIBM=-lm fi fi - if test $gl_cv_func_expm1l_no_libm = no \ - && test $gl_cv_func_expm1l_in_libm = no; then + if test $gl_cv_func_expm1l_no_libm = yes \ + || test $gl_cv_func_expm1l_in_libm = yes; then + HAVE_EXPM1L=1 + dnl Also check whether it's declared. + dnl IRIX 6.5 has expm1l() in libm but doesn't declare it in <math.h>. + AC_CHECK_DECL([expm1l], , [HAVE_DECL_EXPM1L=0], [[#include <math.h>]]) + else HAVE_EXPM1L=0 + HAVE_DECL_EXPM1L=0 dnl Find libraries needed to link lib/expm1l.c. if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then AC_REQUIRE([gl_FUNC_EXPM1])
--- a/m4/math_h.m4 +++ b/m4/math_h.m4 @@ -1,4 +1,4 @@ -# math_h.m4 serial 87 +# math_h.m4 serial 88 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -159,7 +159,6 @@ HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) - HAVE_EXPM1L=1; AC_SUBST([HAVE_EXPM1L]) HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) HAVE_FMA=1; AC_SUBST([HAVE_FMA]) @@ -203,6 +202,7 @@ HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF]) HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) + HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L]) HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
--- a/modules/math +++ b/modules/math @@ -127,7 +127,6 @@ -e 's|@''HAVE_EXPL''@|$(HAVE_EXPL)|g' \ -e 's|@''HAVE_EXPM1''@|$(HAVE_EXPM1)|g' \ -e 's|@''HAVE_EXPM1F''@|$(HAVE_EXPM1F)|g' \ - -e 's|@''HAVE_EXPM1L''@|$(HAVE_EXPM1L)|g' \ -e 's|@''HAVE_FABSF''@|$(HAVE_FABSF)|g' \ -e 's|@''HAVE_FABSL''@|$(HAVE_FABSL)|g' \ -e 's|@''HAVE_FMA''@|$(HAVE_FMA)|g' \ @@ -171,6 +170,7 @@ -e 's|@''HAVE_DECL_COPYSIGNF''@|$(HAVE_DECL_COPYSIGNF)|g' \ -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \ -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \ + -e 's|@''HAVE_DECL_EXPM1L''@|$(HAVE_DECL_EXPM1L)|g' \ -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \ -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \ -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \