From e2557f2e22f05a20102a69a9989915f61f20ca67 Mon Sep 17 00:00:00 2001 From: ripley Date: Thu, 17 May 2012 14:40:40 +0000 Subject: [PATCH] add yet another exception for FreeBSD's lack of C99 compliance update Windows config.h git-svn-id: https://svn.r-project.org/R/trunk@59358 00db46b3-68df-0310-9c12-caf00c1e9a41 --- configure | 15 ++++++++------- configure.ac | 3 ++- src/gnuwin32/fixed/h/config.h | 24 +++++++++++++++++++++--- src/include/config.h.in | 3 +++ src/nmath/pnbeta.c | 13 +++++++++---- 5 files changed, 43 insertions(+), 15 deletions(-) diff --git a/configure b/configure index a7c9b982a3d..8245da881ac 100755 --- a/configure +++ b/configure @@ -26737,12 +26737,13 @@ _ACEOF ## C99 functions: ## not all C99 runtimes are complete, ## but we have substitutes for expm1 hypot log1p and (internally) nearbyint[l] +## FreeBSD 10 still lacks log1pl ## FreeBSD 8.2 lacks log2 ## FreeBSD 7.3 lacks nearbyintl/rintl (nearbyint appeared in 5.2) ## Apparently rint was once broken on HP-UX: undefine HAVE_RINT for such platforms ## Cygwin and FreeBSD lack powl ## Cygwin has rintl but not nearbyintl -for ac_func in expm1 hypot log1p log2 log10 nearbyint nearbyintl powl rint rintl +for ac_func in expm1 hypot log1p log1pl log2 log10 nearbyint nearbyintl powl rint rintl do as_ac_Symbol=`$as_echo "ac_cv_have_decl_$ac_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func exists and is declared" >&5 @@ -35931,11 +35932,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:35934: $lt_compile\"" >&5) + (eval echo "\"\$as_me:35935: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:35938: \$? = $ac_status" >&5 + echo "$as_me:35939: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -36030,11 +36031,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:36033: $lt_compile\"" >&5) + (eval echo "\"\$as_me:36034: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:36037: \$? = $ac_status" >&5 + echo "$as_me:36038: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -36082,11 +36083,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:36085: $lt_compile\"" >&5) + (eval echo "\"\$as_me:36086: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:36089: \$? = $ac_status" >&5 + echo "$as_me:36090: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized diff --git a/configure.ac b/configure.ac index ff24d510ca9..e874e8b7356 100644 --- a/configure.ac +++ b/configure.ac @@ -1764,12 +1764,13 @@ AC_CHECK_DECLS([alloca], , , ## C99 functions: ## not all C99 runtimes are complete, ## but we have substitutes for expm1 hypot log1p and (internally) nearbyint[l] +## FreeBSD 10 still lacks log1pl ## FreeBSD 8.2 lacks log2 ## FreeBSD 7.3 lacks nearbyintl/rintl (nearbyint appeared in 5.2) ## Apparently rint was once broken on HP-UX: undefine HAVE_RINT for such platforms ## Cygwin and FreeBSD lack powl ## Cygwin has rintl but not nearbyintl -R_CHECK_FUNCS([expm1 hypot log1p log2 log10 nearbyint nearbyintl powl rint rintl], [#include ]) +R_CHECK_FUNCS([expm1 hypot log1p log1pl log2 log10 nearbyint nearbyintl powl rint rintl], [#include ]) ## va_copy is C99: required as from R 2.13.0 R_CHECK_FUNCS([va_copy], [#include ]) if test "${ac_cv_have_decl_va_copy}" = "no"; then diff --git a/src/gnuwin32/fixed/h/config.h b/src/gnuwin32/fixed/h/config.h index fa6053f4e17..7704e9c690e 100644 --- a/src/gnuwin32/fixed/h/config.h +++ b/src/gnuwin32/fixed/h/config.h @@ -414,6 +414,9 @@ /* Define to 1 if you have the `readline' library (-lreadline). */ /* #undef HAVE_LIBREADLINE */ +/* Define to 1 if you have the `rt' library (-lrt). */ +#undef HAVE_LIBRT + /* Define to 1 if you have the `termcap' library (-ltermcap). */ /* #undef HAVE_LIBTERMCAP */ @@ -438,6 +441,9 @@ /* Define to 1 if you have the `log1p' function. */ #define HAVE_LOG1P 1 +/* Define to 1 if you have the `log1pl' function. */ +#define HAVE_LOG1PL 1 + /* Define to 1 if you have the `log2' function. */ #define HAVE_LOG2 1 @@ -586,6 +592,15 @@ /* Define to 1 if you have the `rl_completion_matches' function. */ /* #undef HAVE_RL_COMPLETION_MATCHES */ +/* Define to 1 if you have the `sched_getaffinity' function. */ +#undef HAVE_SCHED_GETAFFINITY + +/* Define to 1 if you have the header file. */ +#undef HAVE_SCHED_H + +/* Define to 1 if you have the `sched_setaffinity' function. */ +#undef HAVE_SCHED_SETAFFINITY + /* Define to 1 if you have the `setenv' function. */ /* #undef HAVE_SETENV */ @@ -885,6 +900,9 @@ /* Name of package */ #define PACKAGE "R" +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "https://bugs.r-project.org" + /* Define to the full name of this package. */ #define PACKAGE_NAME "R" @@ -936,9 +954,9 @@ /* Define this to be the canonical name (cpu-vendor-os) of your system. */ #ifdef WIN64 -#define R_PLATFORM "x86_64-pc-mingw32" +#define R_PLATFORM "x86_64-w64-mingw32" #else -#define R_PLATFORM "i386-pc-mingw32" +#define R_PLATFORM "i386-w64-mingw32" #endif /* Define this to be printing command on your system. */ @@ -951,7 +969,7 @@ #define R_SOCKLEN_T int /* Define this to be the name of the vendor of your system. */ -#define R_VENDOR "pc" +#define R_VENDOR "w64" /* Define this to be the extension used for shared objects on your system. */ #define SHLIB_EXT ".dll" diff --git a/src/include/config.h.in b/src/include/config.h.in index faf437ce452..31c64bca0cf 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -438,6 +438,9 @@ /* Define to 1 if you have the `log1p' function. */ #undef HAVE_LOG1P +/* Define to 1 if you have the `log1pl' function. */ +#undef HAVE_LOG1PL + /* Define to 1 if you have the `log2' function. */ #undef HAVE_LOG2 diff --git a/src/nmath/pnbeta.c b/src/nmath/pnbeta.c index 9ceca797162..ea52b9e780e 100644 --- a/src/nmath/pnbeta.c +++ b/src/nmath/pnbeta.c @@ -85,14 +85,19 @@ pnbeta2(double x, double o_x, double a, double b, double ncp, /* o_x == 1 - x but maybe more accurate */ int lower_tail, int log_p) { - long double ans= pnbeta_raw(x, o_x, a,b, ncp); + long double ans = pnbeta_raw(x, o_x, a,b, ncp); /* return R_DT_val(ans), but we want to warn about cancellation here */ - if(lower_tail) return (double) (log_p ? logl(ans) : ans); + if (lower_tail) return (double) (log_p ? logl(ans) : ans); else { - if(ans > 1 - 1e-10) ML_ERROR(ME_PRECISION, "pnbeta"); + if (ans > 1. - 1e-10) ML_ERROR(ME_PRECISION, "pnbeta"); if (ans > 1.0) ans = 1.0; /* Precaution */ - return (double) (log_p ? log1pl(-ans) : (1 - ans)); +#ifdef HAVE_LOG1PL + return (double) (log_p ? log1pl(-ans) : (1. - ans)); +#else + /* include standalone case */ + return (double) (log_p ? log1p((double)-ans) : (1. - ans)); +#endif } }