Merge branch 'develop' into 'develop'

fix inconsistent handling of floating point exceptions on android port

See merge request !82
This commit is contained in:
Daniel Kochmański 2017-08-13 07:08:42 +00:00
commit 2e4de64023
3 changed files with 75 additions and 30 deletions

View file

@ -21,18 +21,22 @@
#include <ecl/internal.h>
#include <ecl/impl/math_fenv.h>
#if defined(ECL_IEEE_FP) && defined(HAVE_FEENABLEEXCEPT)
#if defined(ECL_IEEE_FP)
# if defined(HAVE_FEENABLEEXCEPT)
/*
* We are using IEEE arithmetics and can rely on FPE exceptions
* to be raised when invalid operations are performed.
*/
# define DO_DETECT_FPE(f) ecl_detect_fpe()
# define DO_DETECT_FPE(f) ecl_detect_fpe()
# else
/*
* Floating point exceptions are disabled
*/
# define DO_DETECT_FPE(f)
# endif
#else
/*
* Either we can not rely on C signals or we do not want IEEE NaNs and
* infinities. The first case typically happens for instance under OS
* X, where the status of the FPE control word is changed by
* printf. We have two alternatives.
* We do not want IEEE NaNs and infinities
*/
# define DO_DETECT_FPE(f) do { \
unlikely_if (isnan(f)) ecl_deliver_fpe(FE_INVALID); \

87
src/configure vendored
View file

@ -737,7 +737,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@ -867,7 +866,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@ -1120,15 +1118,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@ -1266,7 +1255,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@ -1419,7 +1408,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@ -2217,6 +2205,52 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_find_uintX_t
# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
# ---------------------------------------------
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
# accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
as_decl_name=`echo $2|sed 's/ *(.*//'`
as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
#ifndef $as_decl_name
#ifdef __cplusplus
(void) $as_decl_use;
#else
(void) $as_decl_name;
#endif
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_decl
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@ -9400,17 +9434,24 @@ fi
done
for ac_func in feenableexcept
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
ac_fn_c_check_decl "$LINENO" "feenableexcept" "ac_cv_have_decl_feenableexcept" "#include <fenv.h>
"
if test "x$ac_cv_have_decl_feenableexcept" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_FEENABLEEXCEPT $ac_have_decl
_ACEOF
if test $ac_have_decl = 1; then :
$as_echo "#define HAVE_FEENABLEEXCEPT 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: feenableexcept not declared: disabling floating point exceptions" >&5
$as_echo "$as_me: WARNING: feenableexcept not declared: disabling floating point exceptions" >&2;}
fi
done
for ac_func in expf logf sqrtf cosf sinf tanf sinhf coshf tanhf \

View file

@ -750,7 +750,7 @@ AC_CHECK_FUNCS( [nanosleep alarm times select setenv putenv] \
[lstat mkstemp sigprocmask isatty tzset] \
[gettimeofday getrusage] )
AC_CHECK_FUNCS( [ feenableexcept ] )
AC_CHECK_DECLS([feenableexcept], [AC_DEFINE(HAVE_FEENABLEEXCEPT)], [AC_MSG_WARN(feenableexcept not declared: disabling floating point exceptions)], [#include <fenv.h>])
AC_CHECK_FUNCS( [expf logf sqrtf cosf sinf tanf sinhf coshf tanhf] \
[floorf ceilf fabsf frexpf ldexpf log1p log1pf log1pl] \