This is only a pure refactoring step, not affecting where the
functions are included.

Signed-off-by: Martin Storsjö <[email protected]>
---
 mingw-w64-crt/Makefile.am       |  1 +
 mingw-w64-crt/math/fp_consts.c  | 10 ----------
 mingw-w64-crt/math/fp_constsf.c | 11 -----------
 mingw-w64-crt/math/fp_constsl.c | 13 -------------
 mingw-w64-crt/math/nan.c        | 18 ++++++++++++++++++
 mingw-w64-crt/math/nanf.c       | 19 +++++++++++++++++++
 mingw-w64-crt/math/nanl.c       | 22 ++++++++++++++++++++++
 7 files changed, 60 insertions(+), 34 deletions(-)
 create mode 100644 mingw-w64-crt/math/nan.c
 create mode 100644 mingw-w64-crt/math/nanf.c
 create mode 100644 mingw-w64-crt/math/nanl.c

diff --git a/mingw-w64-crt/Makefile.am b/mingw-w64-crt/Makefile.am
index bbc5f311b..e1435e995 100644
--- a/mingw-w64-crt/Makefile.am
+++ b/mingw-w64-crt/Makefile.am
@@ -783,6 +783,7 @@ src_libmingwex=\
   math/signbit.c        math/signbitf.c    math/signbitl.c       \
   math/signgam.c        \
   math/sinhl.c          math/sqrtl.c       math/tanhl.c          \
+  math/nan.c            math/nanf.c        math/nanl.c           \
   math/powi.def.h       math/sqrt.def.h    \
   math/cephes_mconf.h   math/fp_consts.h   \
   \
diff --git a/mingw-w64-crt/math/fp_consts.c b/mingw-w64-crt/math/fp_consts.c
index 12330392a..646043895 100644
--- a/mingw-w64-crt/math/fp_consts.c
+++ b/mingw-w64-crt/math/fp_consts.c
@@ -8,13 +8,3 @@ const union _ieee_rep __QNAN = { __DOUBLE_QNAN_REP };
 const union _ieee_rep __SNAN = { __DOUBLE_SNAN_REP };
 const union _ieee_rep __INF =  { __DOUBLE_INF_REP };
 const union _ieee_rep __DENORM = { __DOUBLE_DENORM_REP };
-
-/* ISO C99 */
-#undef nan
-/* FIXME */
-double nan (const char *);
-double nan (const char * tagp __attribute__((unused)) )
-{
-       return __QNAN.double_val;
-}
-
diff --git a/mingw-w64-crt/math/fp_constsf.c b/mingw-w64-crt/math/fp_constsf.c
index 97306dcb1..f77c5393b 100644
--- a/mingw-w64-crt/math/fp_constsf.c
+++ b/mingw-w64-crt/math/fp_constsf.c
@@ -9,14 +9,3 @@ const union _ieee_rep __QNANF = { __FLOAT_QNAN_REP };
 const union _ieee_rep __SNANF = { __FLOAT_SNAN_REP };
 const union _ieee_rep __INFF  = { __FLOAT_INF_REP };
 const union _ieee_rep __DENORMF = { __FLOAT_DENORM_REP };
-
-/* ISO C99 */
-#undef nanf
-/* FIXME */
-float nanf(const char *);
-
-float nanf(const char * tagp __attribute__((unused)) )
-{
-  return __QNANF.float_val;
-}
-
diff --git a/mingw-w64-crt/math/fp_constsl.c b/mingw-w64-crt/math/fp_constsl.c
index fa422110b..4bcfb92f8 100644
--- a/mingw-w64-crt/math/fp_constsl.c
+++ b/mingw-w64-crt/math/fp_constsl.c
@@ -17,16 +17,3 @@ const union _ieee_rep __SNANL = { __LONG_DOUBLE_SNAN_REP };
 const union _ieee_rep __INFL  = { __LONG_DOUBLE_INF_REP };
 const union _ieee_rep __DENORML = { __LONG_DOUBLE_DENORM_REP };
 #endif
-
-#undef nanl
-/* FIXME */
-long double nanl (const char *);
-long double nanl (const char * tagp __attribute__((unused)) )
-{
-#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || 
defined(_ARM64_)
-  return nan("");
-#else
-  return __QNANL.ldouble_val;
-#endif
-}
-
diff --git a/mingw-w64-crt/math/nan.c b/mingw-w64-crt/math/nan.c
new file mode 100644
index 000000000..e64759aed
--- /dev/null
+++ b/mingw-w64-crt/math/nan.c
@@ -0,0 +1,18 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+#include "fp_consts.h"
+
+extern const union _ieee_rep __QNAN;
+
+/* ISO C99 */
+#undef nan
+/* FIXME */
+double nan (const char *);
+double nan (const char * tagp __attribute__((unused)) )
+{
+       return __QNAN.double_val;
+}
+
diff --git a/mingw-w64-crt/math/nanf.c b/mingw-w64-crt/math/nanf.c
new file mode 100644
index 000000000..422d033a5
--- /dev/null
+++ b/mingw-w64-crt/math/nanf.c
@@ -0,0 +1,19 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+#include "fp_consts.h"
+
+extern const union _ieee_rep __QNANF;
+
+/* ISO C99 */
+#undef nanf
+/* FIXME */
+float nanf(const char *);
+
+float nanf(const char * tagp __attribute__((unused)) )
+{
+  return __QNANF.float_val;
+}
+
diff --git a/mingw-w64-crt/math/nanl.c b/mingw-w64-crt/math/nanl.c
new file mode 100644
index 000000000..d03378c9b
--- /dev/null
+++ b/mingw-w64-crt/math/nanl.c
@@ -0,0 +1,22 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the mingw-w64 runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+#include "fp_consts.h"
+#include <math.h>
+
+extern const union _ieee_rep __QNANL;
+
+#undef nanl
+/* FIXME */
+long double nanl (const char *);
+long double nanl (const char * tagp __attribute__((unused)) )
+{
+#if defined(__arm__) || defined(_ARM_) || defined(__aarch64__) || 
defined(_ARM64_)
+  return nan("");
+#else
+  return __QNANL.ldouble_val;
+#endif
+}
+
-- 
2.34.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to