Mercurial > hg > octave-lyh > gnulib-hg
changeset 16605:65abd231dc80
remainderl: Don't override undeclared system function on IRIX 6.5.
* lib/math.in.h (remainderl): Test HAVE_DECL_REMAINDERL, not
HAVE_REMAINDERL.
* m4/remainderl.m4 (gl_FUNC_REMAINDERL): Don't assume remainderl() is
declared when it exists. Set HAVE_DECL_REMAINDERL.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize HAVE_DECL_REMAINDERL,
not HAVE_REMAINDERL.
* modules/math (Makefile.am): Substitute HAVE_DECL_REMAINDERL, not
HAVE_REMAINDERL.
* doc/posix-functions/remainderl.texi: Mention missing declaration
problem.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 08 Mar 2012 03:21:38 +0100 |
parents | 9ac8499fa137 |
children | c65f617394a7 |
files | ChangeLog doc/posix-functions/remainderl.texi lib/math.in.h m4/math_h.m4 m4/remainderl.m4 modules/math |
diffstat | 6 files changed, 38 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2012-03-07 Bruno Haible <bruno@clisp.org> + + remainderl: Don't override undeclared system function on IRIX 6.5. + * lib/math.in.h (remainderl): Test HAVE_DECL_REMAINDERL, not + HAVE_REMAINDERL. + * m4/remainderl.m4 (gl_FUNC_REMAINDERL): Don't assume remainderl() is + declared when it exists. Set HAVE_DECL_REMAINDERL. + * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Initialize HAVE_DECL_REMAINDERL, + not HAVE_REMAINDERL. + * modules/math (Makefile.am): Substitute HAVE_DECL_REMAINDERL, not + HAVE_REMAINDERL. + * doc/posix-functions/remainderl.texi: Mention missing declaration + problem. + 2012-03-07 Bruno Haible <bruno@clisp.org> rintf: Don't override undeclared system function on IRIX 6.5.
--- a/doc/posix-functions/remainderl.texi +++ b/doc/posix-functions/remainderl.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, OSF/1 4.0, Solaris 9, Cygwin, 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, OSF/1 4.0, Solaris 9, Cygwin, MSVC 9, Interix 3.5, BeOS. +@item +This function is not declared on some platforms: +IRIX 6.5. @end itemize Portability problems fixed by Gnulib module @code{remainderl-ieee}:
--- a/lib/math.in.h +++ b/lib/math.in.h @@ -1261,7 +1261,7 @@ _GL_FUNCDECL_RPL (remainderl, long double, (long double x, long double y)); _GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y)); # else -# if !@HAVE_REMAINDERL@ +# if !@HAVE_DECL_REMAINDERL@ _GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y)); # endif _GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y));
--- a/m4/math_h.m4 +++ b/m4/math_h.m4 @@ -1,4 +1,4 @@ -# math_h.m4 serial 86 +# math_h.m4 serial 87 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, @@ -183,7 +183,6 @@ HAVE_POWF=1; AC_SUBST([HAVE_POWF]) HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) - HAVE_REMAINDERL=1; AC_SUBST([HAVE_REMAINDERL]) HAVE_RINT=1; AC_SUBST([HAVE_RINT]) HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) HAVE_SINF=1; AC_SUBST([HAVE_SINF]) @@ -212,6 +211,7 @@ HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER]) + HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL]) HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF]) HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND]) HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
--- a/m4/remainderl.m4 +++ b/m4/remainderl.m4 @@ -1,4 +1,4 @@ -# remainderl.m4 serial 4 +# remainderl.m4 serial 5 dnl Copyright (C) 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, @@ -27,6 +27,11 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include <math.h> + extern + #ifdef __cplusplus + "C" + #endif + long double remainderl (long double, long double); long double (*funcptr) (long double, long double) = remainderl; long double x; long double y;]], @@ -37,7 +42,11 @@ ]) LIBS="$save_LIBS" if test $gl_cv_func_remainderl = yes; then + HAVE_REMAINDERL=1 REMAINDERL_LIBM="$REMAINDER_LIBM" + dnl Also check whether it's declared. + dnl IRIX 6.5 has remainderl() in libm but doesn't declare it in <math.h>. + AC_CHECK_DECLS([remainderl], , [HAVE_DECL_REMAINDERL=0], [[#include <math.h>]]) m4_ifdef([gl_FUNC_REMAINDERL_IEEE], [ if test $gl_remainderl_required = ieee && test $REPLACE_REMAINDERL = 0; then AC_CACHE_CHECK([whether remainderl works according to ISO C 99 with IEC 60559], @@ -51,6 +60,11 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include <math.h> +extern +#ifdef __cplusplus +"C" +#endif +long double remainderl (long double, long double); /* Compare two numbers with ==. This is a separate function because IRIX 6.5 "cc -O" miscompiles an 'x == x' test. */ @@ -85,6 +99,7 @@ ]) else HAVE_REMAINDERL=0 + HAVE_DECL_REMAINDERL=0 fi if test $HAVE_REMAINDERL = 0 || test $REPLACE_REMAINDERL = 1; then dnl Find libraries needed to link lib/remainderl.c.
--- a/modules/math +++ b/modules/math @@ -151,7 +151,6 @@ -e 's|@''HAVE_POWF''@|$(HAVE_POWF)|g' \ -e 's|@''HAVE_REMAINDER''@|$(HAVE_REMAINDER)|g' \ -e 's|@''HAVE_REMAINDERF''@|$(HAVE_REMAINDERF)|g' \ - -e 's|@''HAVE_REMAINDERL''@|$(HAVE_REMAINDERL)|g' \ -e 's|@''HAVE_RINT''@|$(HAVE_RINT)|g' \ -e 's|@''HAVE_RINTL''@|$(HAVE_RINTL)|g' \ -e 's|@''HAVE_SINF''@|$(HAVE_SINF)|g' \ @@ -180,6 +179,7 @@ -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \ -e 's|@''HAVE_DECL_LOG10L''@|$(HAVE_DECL_LOG10L)|g' \ -e 's|@''HAVE_DECL_REMAINDER''@|$(HAVE_DECL_REMAINDER)|g' \ + -e 's|@''HAVE_DECL_REMAINDERL''@|$(HAVE_DECL_REMAINDERL)|g' \ -e 's|@''HAVE_DECL_RINTF''@|$(HAVE_DECL_RINTF)|g' \ -e 's|@''HAVE_DECL_ROUND''@|$(HAVE_DECL_ROUND)|g' \ -e 's|@''HAVE_DECL_ROUNDF''@|$(HAVE_DECL_ROUNDF)|g' \