From b58d6b568bf1da0fed453d13598720f5e8770dc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net>
Date: Wed, 22 Jul 1998 14:06:42 -0700
Subject: [PATCH] tests for fpsetmask() added

Rev: src/modules/math/configure.in:1.5
Rev: src/modules/math/math.c:1.13
---
 src/modules/math/configure.in |  5 ++++-
 src/modules/math/math.c       | 13 ++++++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/modules/math/configure.in b/src/modules/math/configure.in
index 9b71f616bd..6e837935f7 100644
--- a/src/modules/math/configure.in
+++ b/src/modules/math/configure.in
@@ -1,6 +1,7 @@
-# $Id: configure.in,v 1.4 1998/03/28 13:57:09 grubba Exp $
+# $Id: configure.in,v 1.5 1998/07/22 21:06:42 hubbe Exp $
 AC_INIT(math.c)
 
+
 sinclude(../module_configure.in)
 
 AC_CHECK_LIB(m, floor)
@@ -9,6 +10,8 @@ if test "${ac_cv_lib_m}" = "no" -a "${pike_cv_sys_os}" = "Linux"; then
   LIBS="${LIBS} -lc -lm"
 fi
 
+AC_CHECK_HEADERS(ieeefp.h fp_class.h floatingpoint.h)
+AC_CHECK_FUNCS(fpsetmask)
 
 AC_OUTPUT(Makefile,echo FOO >stamp-h )
 
diff --git a/src/modules/math/math.c b/src/modules/math/math.c
index 1c3875ca11..dd4d1a2c24 100644
--- a/src/modules/math/math.c
+++ b/src/modules/math/math.c
@@ -12,7 +12,15 @@
 #include "module_support.h"
 #include "operators.h"
 
-RCSID("$Id: math.c,v 1.12 1998/07/04 17:02:55 grubba Exp $");
+#ifdef HAVE_IEEEFP_H
+#include <ieeefp.h>
+#endif
+
+#ifdef HAVE_FLOATINPOINT_H
+#include <floatingpoint.h>
+#endif
+
+RCSID("$Id: math.c,v 1.13 1998/07/22 21:06:42 hubbe Exp $");
 
 #ifndef M_PI
 #define M_PI 3.1415926535897932384626433832795080
@@ -235,6 +243,9 @@ void f_sgn(INT32 args)
 
 void pike_module_init(void)
 {
+#ifdef HAVE_FPSETMASK
+  fpsetmask(0);
+#endif
   add_efun("sin",f_sin,"function(float:float)",0);
   add_efun("asin",f_asin,"function(float:float)",0);
   add_efun("cos",f_cos,"function(float:float)",0);
-- 
GitLab