Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 12 Jul 2008 17:41:34 +0000 (10:41 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 12 Jul 2008 18:27:12 +0000 (11:27 -0700)
32 files changed:
ChangeLog
NEWS
lib/frexp.c
lib/isfinite.c
lib/isnand-nolibm.h [new file with mode: 0644]
lib/isnand.h [deleted file]
lib/isnanf-nolibm.h [new file with mode: 0644]
lib/isnanf.h [deleted file]
lib/signbitd.c
lib/signbitf.c
lib/vasnprintf.c
modules/isnand-nolibm
modules/isnand-nolibm-tests
modules/isnanf-nolibm
modules/isnanf-nolibm-tests
tests/test-ceilf1.c
tests/test-ceilf2.c
tests/test-floorf1.c
tests/test-floorf2.c
tests/test-frexp.c
tests/test-isnand-nolibm.c [new file with mode: 0644]
tests/test-isnand.c [deleted file]
tests/test-isnanf-nolibm.c [new file with mode: 0644]
tests/test-isnanf.c [deleted file]
tests/test-round1.c
tests/test-round2.c
tests/test-roundf1.c
tests/test-strtod.c
tests/test-trunc1.c
tests/test-trunc2.c
tests/test-truncf1.c
tests/test-truncf2.c

index 68902fd..b68b33f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,33 @@
+2008-07-10  Ben Pfaff  <blp@gnu.org>
+
+       * lib/isnanf.h: Rename lib/isnanf-nolibm.h.
+       * lib/isnand.h: Rename lib/isnand-nolibm.h.
+       * tests/test-isnanf.c: Rename tests/test-isnanf-nolibm.c.
+       * tests/test-isnand.c: Rename tests/test-isnand-nolibm.c.
+       * modules/isnanf-nolibm: Update references to renamed files.
+       * modules/isnand-nolibm: Likewise.
+       * modules/isnanf-nolibm-tests: Likewise.
+       * modules/isnand-nolibm-tests: Likewise.
+        * lib/frexp.c: Likewise.
+       * lib/isfinite.c: Likewise.
+       * lib/signbitd.c: Likewise.
+       * lib/signbitf.c: Likewise.
+       * lib/vasnprintf.c: Likewise.
+       * tests/test-ceilf1.c: Likewise.
+       * tests/test-ceilf2.c: Likewise.
+       * tests/test-floorf1.c: Likewise.
+       * tests/test-floorf2.c: Likewise.
+       * tests/test-frexp.c: Likewise.
+       * tests/test-round1.c: Likewise.
+       * tests/test-round2.c: Likewise.
+       * tests/test-roundf1.c: Likewise.
+       * tests/test-strtod.c: Likewise.
+       * tests/test-trunc1.c: Likewise.
+       * tests/test-trunc2.c: Likewise.
+       * tests/test-truncf1.c: Likewise.
+       * tests/test-truncf2.c: Likewise.
+       * NEWS: Mention the renamed header files.
+
 2008-07-11  Jim Meyering  <meyering@redhat.com>
 
        vc-list-files: make the last-resort awk code more portable
diff --git a/NEWS b/NEWS
index 75735e5..74ca234 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,11 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2008-07-07  isnanf-nolibm   The include file is changed from "isnanf.h"
+                            to "isnanf-nolibm.h".
+            isnand-nolibm   The include file is changed from "isnand.h"
+                            to "isnand-nolibm.h".
+
 2008-06-10  execute         The execute function takes an additional termsigp
                             argument. Passing termsigp = NULL is ok.
             wait-process    The wait_subprocess function takes an additional
index 4fd0819..7e1f5d1 100644 (file)
@@ -27,7 +27,7 @@
 # include "isnanl-nolibm.h"
 # include "fpucw.h"
 #else
-# include "isnand.h"
+# include "isnand-nolibm.h"
 #endif
 
 /* This file assumes FLT_RADIX = 2.  If FLT_RADIX is a power of 2 greater
index e648929..b7baff4 100644 (file)
@@ -19,8 +19,8 @@
 
 #include <config.h>
 
-#include "isnanf.h"
-#include "isnand.h"
+#include "isnanf-nolibm.h"
+#include "isnand-nolibm.h"
 #include "isnanl-nolibm.h"
 
 int gl_isfinitef (float x)
diff --git a/lib/isnand-nolibm.h b/lib/isnand-nolibm.h
new file mode 100644 (file)
index 0000000..d248b2f
--- /dev/null
@@ -0,0 +1,33 @@
+/* Test for NaN that does not need libm.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#if HAVE_ISNAND_IN_LIBC
+/* Get declaration of isnan macro.  */
+# include <math.h>
+# if __GNUC__ >= 4
+   /* GCC 4.0 and newer provides three built-ins for isnan.  */
+#  undef isnand
+#  define isnand(x) __builtin_isnan ((double)(x))
+# else
+#  undef isnand
+#  define isnand(x) isnan ((double)(x))
+# endif
+#else
+/* Test whether X is a NaN.  */
+# undef isnand
+# define isnand rpl_isnand
+extern int isnand (double x);
+#endif
diff --git a/lib/isnand.h b/lib/isnand.h
deleted file mode 100644 (file)
index d248b2f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test for NaN that does not need libm.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if HAVE_ISNAND_IN_LIBC
-/* Get declaration of isnan macro.  */
-# include <math.h>
-# if __GNUC__ >= 4
-   /* GCC 4.0 and newer provides three built-ins for isnan.  */
-#  undef isnand
-#  define isnand(x) __builtin_isnan ((double)(x))
-# else
-#  undef isnand
-#  define isnand(x) isnan ((double)(x))
-# endif
-#else
-/* Test whether X is a NaN.  */
-# undef isnand
-# define isnand rpl_isnand
-extern int isnand (double x);
-#endif
diff --git a/lib/isnanf-nolibm.h b/lib/isnanf-nolibm.h
new file mode 100644 (file)
index 0000000..774942c
--- /dev/null
@@ -0,0 +1,33 @@
+/* Test for NaN that does not need libm.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#if HAVE_ISNANF_IN_LIBC
+/* Get declaration of isnan macro or (older) isnanf function.  */
+# include <math.h>
+# if __GNUC__ >= 4
+   /* GCC 4.0 and newer provides three built-ins for isnan.  */
+#  undef isnanf
+#  define isnanf(x) __builtin_isnanf ((float)(x))
+# elif defined isnan
+#  undef isnanf
+#  define isnanf(x) isnan ((float)(x))
+# endif
+#else
+/* Test whether X is a NaN.  */
+# undef isnanf
+# define isnanf rpl_isnanf
+extern int isnanf (float x);
+#endif
diff --git a/lib/isnanf.h b/lib/isnanf.h
deleted file mode 100644 (file)
index 774942c..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test for NaN that does not need libm.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#if HAVE_ISNANF_IN_LIBC
-/* Get declaration of isnan macro or (older) isnanf function.  */
-# include <math.h>
-# if __GNUC__ >= 4
-   /* GCC 4.0 and newer provides three built-ins for isnan.  */
-#  undef isnanf
-#  define isnanf(x) __builtin_isnanf ((float)(x))
-# elif defined isnan
-#  undef isnanf
-#  define isnanf(x) isnan ((float)(x))
-# endif
-#else
-/* Test whether X is a NaN.  */
-# undef isnanf
-# define isnanf rpl_isnanf
-extern int isnanf (float x);
-#endif
index 8871de7..9a7d725 100644 (file)
@@ -20,7 +20,7 @@
 #include <math.h>
 
 #include <string.h>
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "float+.h"
 
 #undef gl_signbitd
index 8b0f93c..d03fcdd 100644 (file)
@@ -20,7 +20,7 @@
 #include <math.h>
 
 #include <string.h>
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "float+.h"
 
 #undef gl_signbitf
index 472ce23..89829c9 100644 (file)
@@ -95,7 +95,7 @@
 
 #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
 # include <math.h>
-# include "isnand.h"
+# include "isnand-nolibm.h"
 #endif
 
 #if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
 
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
 # include <math.h>
-# include "isnand.h"
+# include "isnand-nolibm.h"
 # include "printf-frexp.h"
 #endif
 
index 6bb8c7d..3fd1ee9 100644 (file)
@@ -2,7 +2,7 @@ Description:
 isnand() function: test for NaN, without requiring libm.
 
 Files:
-lib/isnand.h
+lib/isnand-nolibm.h
 lib/isnand.c
 lib/isnan.c
 lib/float+.h
@@ -17,7 +17,7 @@ gl_FUNC_ISNAND_NO_LIBM
 Makefile.am:
 
 Include:
-#include "isnand.h"
+#include "isnand-nolibm.h"
 
 License:
 LGPL
index 7fd37ba..2283fba 100644 (file)
@@ -1,5 +1,5 @@
 Files:
-tests/test-isnand.c
+tests/test-isnand-nolibm.c
 tests/nan.h
 
 Depends-on:
@@ -8,6 +8,6 @@ configure.ac:
 gl_DOUBLE_EXPONENT_LOCATION
 
 Makefile.am:
-TESTS += test-isnand
-check_PROGRAMS += test-isnand
+TESTS += test-isnand-nolibm
+check_PROGRAMS += test-isnand-nolibm
 
index 3f90629..e6418b0 100644 (file)
@@ -2,7 +2,7 @@ Description:
 isnanf() function: test for NaN, without requiring libm.
 
 Files:
-lib/isnanf.h
+lib/isnanf-nolibm.h
 lib/isnanf.c
 lib/isnan.c
 lib/float+.h
@@ -17,7 +17,7 @@ gl_FUNC_ISNANF_NO_LIBM
 Makefile.am:
 
 Include:
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 License:
 LGPL
index 8225ff4..9fba72b 100644 (file)
@@ -1,5 +1,5 @@
 Files:
-tests/test-isnanf.c
+tests/test-isnanf-nolibm.c
 tests/nan.h
 
 Depends-on:
@@ -8,6 +8,6 @@ configure.ac:
 gl_FLOAT_EXPONENT_LOCATION
 
 Makefile.am:
-TESTS += test-isnanf
-check_PROGRAMS += test-isnanf
+TESTS += test-isnanf-nolibm
+check_PROGRAMS += test-isnanf-nolibm
 
index 430e4ab..f17c19a 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
index e6d69ec..17aac84 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 #define ASSERT(expr) \
   do                                                                        \
index 773e4bc..b9c4da4 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
index 1521c22..e7fcd98 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 #define ASSERT(expr) \
   do                                                                        \
index c08056c..5d95063 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "nan.h"
 
 /* Avoid some warnings from "gcc -Wshadow".
diff --git a/tests/test-isnand-nolibm.c b/tests/test-isnand-nolibm.c
new file mode 100644 (file)
index 0000000..391871f
--- /dev/null
@@ -0,0 +1,78 @@
+/* Test of isnand() substitute.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include "isnand-nolibm.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "nan.h"
+
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
+
+int
+main ()
+{
+  /* Finite values.  */
+  ASSERT (!isnand (3.141));
+  ASSERT (!isnand (3.141e30));
+  ASSERT (!isnand (3.141e-30));
+  ASSERT (!isnand (-2.718));
+  ASSERT (!isnand (-2.718e30));
+  ASSERT (!isnand (-2.718e-30));
+  ASSERT (!isnand (0.0));
+  ASSERT (!isnand (-0.0));
+  /* Infinite values.  */
+  ASSERT (!isnand (1.0 / 0.0));
+  ASSERT (!isnand (-1.0 / 0.0));
+  /* Quiet NaN.  */
+  ASSERT (isnand (NaNd ()));
+#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
+  /* Signalling NaN.  */
+  {
+    #define NWORDS \
+      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+    typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+    memory_double m;
+    m.value = NaNd ();
+# if DBL_EXPBIT0_BIT > 0
+    m.word[DBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (DBL_EXPBIT0_BIT - 1);
+# else
+    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+# endif
+    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+      |= (unsigned int) 1 << DBL_EXPBIT0_BIT;
+    ASSERT (isnand (m.value));
+  }
+#endif
+  return 0;
+}
diff --git a/tests/test-isnand.c b/tests/test-isnand.c
deleted file mode 100644 (file)
index d7b66c4..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Test of isnand() substitute.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include "isnand.h"
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "nan.h"
-
-#define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
-  while (0)
-
-int
-main ()
-{
-  /* Finite values.  */
-  ASSERT (!isnand (3.141));
-  ASSERT (!isnand (3.141e30));
-  ASSERT (!isnand (3.141e-30));
-  ASSERT (!isnand (-2.718));
-  ASSERT (!isnand (-2.718e30));
-  ASSERT (!isnand (-2.718e-30));
-  ASSERT (!isnand (0.0));
-  ASSERT (!isnand (-0.0));
-  /* Infinite values.  */
-  ASSERT (!isnand (1.0 / 0.0));
-  ASSERT (!isnand (-1.0 / 0.0));
-  /* Quiet NaN.  */
-  ASSERT (isnand (NaNd ()));
-#if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
-  /* Signalling NaN.  */
-  {
-    #define NWORDS \
-      ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-    typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-    memory_double m;
-    m.value = NaNd ();
-# if DBL_EXPBIT0_BIT > 0
-    m.word[DBL_EXPBIT0_WORD] ^= (unsigned int) 1 << (DBL_EXPBIT0_BIT - 1);
-# else
-    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
-      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
-    m.word[DBL_EXPBIT0_WORD + (DBL_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
-      |= (unsigned int) 1 << DBL_EXPBIT0_BIT;
-    ASSERT (isnand (m.value));
-  }
-#endif
-  return 0;
-}
diff --git a/tests/test-isnanf-nolibm.c b/tests/test-isnanf-nolibm.c
new file mode 100644 (file)
index 0000000..bbc042a
--- /dev/null
@@ -0,0 +1,80 @@
+/* Test of isnanf() substitute.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include "isnanf-nolibm.h"
+
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "nan.h"
+
+#define ASSERT(expr) \
+  do                                                                        \
+    {                                                                       \
+      if (!(expr))                                                          \
+        {                                                                   \
+          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
+          fflush (stderr);                                                  \
+          abort ();                                                         \
+        }                                                                   \
+    }                                                                       \
+  while (0)
+
+int
+main ()
+{
+  /* Finite values.  */
+  ASSERT (!isnanf (3.141f));
+  ASSERT (!isnanf (3.141e30f));
+  ASSERT (!isnanf (3.141e-30f));
+  ASSERT (!isnanf (-2.718f));
+  ASSERT (!isnanf (-2.718e30f));
+  ASSERT (!isnanf (-2.718e-30f));
+  ASSERT (!isnanf (0.0f));
+  ASSERT (!isnanf (-0.0f));
+  /* Infinite values.  */
+  ASSERT (!isnanf (1.0f / 0.0f));
+  ASSERT (!isnanf (-1.0f / 0.0f));
+  /* Quiet NaN.  */
+  ASSERT (isnanf (NaNf ()));
+#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
+  /* Signalling NaN.  */
+  {
+    #define NWORDS \
+      ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+    typedef union { float value; unsigned int word[NWORDS]; } memory_float;
+    memory_float m;
+    m.value = NaNf ();
+# if FLT_EXPBIT0_BIT > 0
+    m.word[FLT_EXPBIT0_WORD] ^= (unsigned int) 1 << (FLT_EXPBIT0_BIT - 1);
+# else
+    m.word[FLT_EXPBIT0_WORD + (FLT_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
+      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+# endif
+    if (FLT_EXPBIT0_WORD < NWORDS / 2)
+      m.word[FLT_EXPBIT0_WORD + 1] |= (unsigned int) 1 << FLT_EXPBIT0_BIT;
+    else
+      m.word[0] |= (unsigned int) 1;
+    ASSERT (isnanf (m.value));
+  }
+#endif
+  return 0;
+}
diff --git a/tests/test-isnanf.c b/tests/test-isnanf.c
deleted file mode 100644 (file)
index 00fbfeb..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Test of isnanf() substitute.
-   Copyright (C) 2007-2008 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-#include <config.h>
-
-#include "isnanf.h"
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "nan.h"
-
-#define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
-          fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          fflush (stderr);                                                  \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
-  while (0)
-
-int
-main ()
-{
-  /* Finite values.  */
-  ASSERT (!isnanf (3.141f));
-  ASSERT (!isnanf (3.141e30f));
-  ASSERT (!isnanf (3.141e-30f));
-  ASSERT (!isnanf (-2.718f));
-  ASSERT (!isnanf (-2.718e30f));
-  ASSERT (!isnanf (-2.718e-30f));
-  ASSERT (!isnanf (0.0f));
-  ASSERT (!isnanf (-0.0f));
-  /* Infinite values.  */
-  ASSERT (!isnanf (1.0f / 0.0f));
-  ASSERT (!isnanf (-1.0f / 0.0f));
-  /* Quiet NaN.  */
-  ASSERT (isnanf (NaNf ()));
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
-  /* Signalling NaN.  */
-  {
-    #define NWORDS \
-      ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-    typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-    memory_float m;
-    m.value = NaNf ();
-# if FLT_EXPBIT0_BIT > 0
-    m.word[FLT_EXPBIT0_WORD] ^= (unsigned int) 1 << (FLT_EXPBIT0_BIT - 1);
-# else
-    m.word[FLT_EXPBIT0_WORD + (FLT_EXPBIT0_WORD < NWORDS / 2 ? 1 : - 1)]
-      ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-# endif
-    if (FLT_EXPBIT0_WORD < NWORDS / 2)
-      m.word[FLT_EXPBIT0_WORD + 1] |= (unsigned int) 1 << FLT_EXPBIT0_BIT;
-    else
-      m.word[0] |= (unsigned int) 1;
-    ASSERT (isnanf (m.value));
-  }
-#endif
-  return 0;
-}
index 2cf90f6..935eb10 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
index aa993ef..b5944a9 100644 (file)
@@ -37,7 +37,7 @@
 #ifdef USE_LONG_DOUBLE
 # error Long double not supported.
 #elif ! defined USE_FLOAT
-# include "isnand.h"
+# include "isnand-nolibm.h"
 # define ISNAN isnand
 # define FUNCTION "round"
 # define DOUBLE_UINT uint64_t
@@ -45,7 +45,7 @@
 # define NUM_HIGHBITS 13
 # define NUM_LOWBITS 4
 #else /* defined USE_FLOAT */
-# include "isnanf.h"
+# include "isnanf-nolibm.h"
 # define ISNAN isnanf
 # define FUNCTION "roundf"
 # define DOUBLE_UINT uint32_t
index 0b6bc2f..60e1946 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
index 12d3606..87d7062 100644 (file)
@@ -25,7 +25,7 @@
 #include <stdio.h>
 #include <string.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 
 #define ASSERT(expr) \
   do                                                                        \
index 0449aa9..ebe4482 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
index adf4e54..b13433f 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnand.h"
+#include "isnand-nolibm.h"
 
 #define ASSERT(expr) \
   do                                                                        \
index 16d8682..8d46840 100644 (file)
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 #include "nan.h"
 
 #define ASSERT(expr) \
index 0a73371..dd849ab 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "isnanf.h"
+#include "isnanf-nolibm.h"
 
 #define ASSERT(expr) \
   do                                                                        \