Add a check for FE_DIVBYZERO
Some architectures (namely Microblaze) do have fenv.h and
feenableexcept, but they don't have the FE_DIVBYZERO definition. This
patch adds a configure check for FE_DIVBYZERO, and only uses it if
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
===================================================================
AC_DEFINE(HAVE_FEENABLEEXCEPT, 1, [Whether we have feenableexcept()])
+AC_CHECK_DECL([FE_DIVBYZERO], [], [], [[#include <fenv.h>]])
+if test x$ac_cv_have_decl_FE_DIVBYZERO = xyes; then
+ AC_DEFINE(HAVE_FEDIVBYZERO, 1, [Whether we have FE_DIVBYZERO])
AC_CHECK_FUNC(gettimeofday, have_gettimeofday=yes, have_gettimeofday=no)
AC_CHECK_HEADER(sys/time.h, have_sys_time_h=yes, have_sys_time_h=no)
if test x$have_gettimeofday = xyes && test x$have_sys_time_h = xyes; then
===================================================================
#ifdef HAVE_FEENABLEEXCEPT
+#ifdef HAVE_FE_DIVBYZERO
feenableexcept (FE_DIVBYZERO);