This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] newlib: remove __infinity{f,ld} constants


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=bdb017b30ca0a8f57e50a3d5cb2334cbbeb2a43e

commit bdb017b30ca0a8f57e50a3d5cb2334cbbeb2a43e
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue Apr 18 12:17:26 2017 +0200

    newlib: remove __infinity{f,ld} constants
    
    previous commit 4c90db7bc89e7fa1077025fefdd58269dc71a6ac introduced
    a compile time error because libm/common/s_infconst.c used the remove
    __fmath, __dmath, and __ldmath union types.
    
    Since this is very old, and unused for a very long time, just drop the
    file and thus the __infinity constants entirely.
    
    Exception: Cygwin exports __infinity from the beginning.  There's a very,
    VERY low probability that any existing executable or lib still uses this
    constant, but we just keep it in for backward compat, nevertheless.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/Makefile.am              |  3 +--
 newlib/Makefile.in              |  3 +--
 newlib/libm/common/Makefile.am  |  2 +-
 newlib/libm/common/Makefile.in  | 12 +++---------
 newlib/libm/common/s_infconst.c | 21 ---------------------
 winsup/cygwin/math/isinf.c      |  5 +++++
 6 files changed, 11 insertions(+), 35 deletions(-)

diff --git a/newlib/Makefile.am b/newlib/Makefile.am
index e43b2e3..effa2ad 100644
--- a/newlib/Makefile.am
+++ b/newlib/Makefile.am
@@ -112,8 +112,7 @@ MATHOBJS_IN_LIBC = \
 	$(lpfx)sf_modf.$(oext) $(lpfx)s_scalbn.$(oext) \
 	$(lpfx)sf_scalbn.$(oext) \
 	$(lpfx)s_finite.$(oext) $(lpfx)sf_finite.$(oext) \
-	$(lpfx)s_copysign.$(oext) $(lpfx)sf_copysign.$(oext) \
-	$(lpfx)s_infconst.$(oext)
+	$(lpfx)s_copysign.$(oext) $(lpfx)sf_copysign.$(oext)
 
 LIBC_OBJECTLISTS = \
 	$(POSIX_OBJECTLIST) \
diff --git a/newlib/Makefile.in b/newlib/Makefile.in
index 58b4acd..7756e70 100644
--- a/newlib/Makefile.in
+++ b/newlib/Makefile.in
@@ -408,8 +408,7 @@ MATHOBJS_IN_LIBC = \
 	$(lpfx)sf_modf.$(oext) $(lpfx)s_scalbn.$(oext) \
 	$(lpfx)sf_scalbn.$(oext) \
 	$(lpfx)s_finite.$(oext) $(lpfx)sf_finite.$(oext) \
-	$(lpfx)s_copysign.$(oext) $(lpfx)sf_copysign.$(oext) \
-	$(lpfx)s_infconst.$(oext)
+	$(lpfx)s_copysign.$(oext) $(lpfx)sf_copysign.$(oext)
 
 LIBC_OBJECTLISTS = \
 	$(POSIX_OBJECTLIST) \
diff --git a/newlib/libm/common/Makefile.am b/newlib/libm/common/Makefile.am
index 2a27948..1268e17 100644
--- a/newlib/libm/common/Makefile.am
+++ b/newlib/libm/common/Makefile.am
@@ -5,7 +5,7 @@ AUTOMAKE_OPTIONS = cygnus
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 
 src = 	s_finite.c s_copysign.c s_modf.c s_scalbn.c \
-	s_cbrt.c s_exp10.c s_expm1.c s_ilogb.c s_infconst.c \
+	s_cbrt.c s_exp10.c s_expm1.c s_ilogb.c \
 	s_infinity.c s_isinf.c s_isinfd.c s_isnan.c s_isnand.c \
 	s_log1p.c s_nan.c s_nextafter.c s_pow10.c \
 	s_rint.c s_logb.c s_log2.c s_matherr.c s_lib_ver.c \
diff --git a/newlib/libm/common/Makefile.in b/newlib/libm/common/Makefile.in
index a694ce1..9b36765 100644
--- a/newlib/libm/common/Makefile.in
+++ b/newlib/libm/common/Makefile.in
@@ -78,7 +78,7 @@ am__objects_1 = lib_a-s_finite.$(OBJEXT) lib_a-s_copysign.$(OBJEXT) \
 	lib_a-s_modf.$(OBJEXT) lib_a-s_scalbn.$(OBJEXT) \
 	lib_a-s_cbrt.$(OBJEXT) lib_a-s_exp10.$(OBJEXT) \
 	lib_a-s_expm1.$(OBJEXT) lib_a-s_ilogb.$(OBJEXT) \
-	lib_a-s_infconst.$(OBJEXT) lib_a-s_infinity.$(OBJEXT) \
+	lib_a-s_infinity.$(OBJEXT) \
 	lib_a-s_isinf.$(OBJEXT) lib_a-s_isinfd.$(OBJEXT) \
 	lib_a-s_isnan.$(OBJEXT) lib_a-s_isnand.$(OBJEXT) \
 	lib_a-s_log1p.$(OBJEXT) lib_a-s_nan.$(OBJEXT) \
@@ -148,7 +148,7 @@ lib_a_OBJECTS = $(am_lib_a_OBJECTS)
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 libcommon_la_LIBADD =
 am__objects_5 = s_finite.lo s_copysign.lo s_modf.lo s_scalbn.lo \
-	s_cbrt.lo s_exp10.lo s_expm1.lo s_ilogb.lo s_infconst.lo \
+	s_cbrt.lo s_exp10.lo s_expm1.lo s_ilogb.lo \
 	s_infinity.lo s_isinf.lo s_isinfd.lo s_isnan.lo s_isnand.lo \
 	s_log1p.lo s_nan.lo s_nextafter.lo s_pow10.lo s_rint.lo \
 	s_logb.lo s_log2.lo s_matherr.lo s_lib_ver.lo s_fdim.lo \
@@ -334,7 +334,7 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = cygnus
 INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
 src = s_finite.c s_copysign.c s_modf.c s_scalbn.c \
-	s_cbrt.c s_exp10.c s_expm1.c s_ilogb.c s_infconst.c \
+	s_cbrt.c s_exp10.c s_expm1.c s_ilogb.c \
 	s_infinity.c s_isinf.c s_isinfd.c s_isnan.c s_isnand.c \
 	s_log1p.c s_nan.c s_nextafter.c s_pow10.c \
 	s_rint.c s_logb.c s_log2.c s_matherr.c s_lib_ver.c \
@@ -508,12 +508,6 @@ lib_a-s_ilogb.o: s_ilogb.c
 lib_a-s_ilogb.obj: s_ilogb.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_ilogb.obj `if test -f 's_ilogb.c'; then $(CYGPATH_W) 's_ilogb.c'; else $(CYGPATH_W) '$(srcdir)/s_ilogb.c'; fi`
 
-lib_a-s_infconst.o: s_infconst.c
-	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_infconst.o `test -f 's_infconst.c' || echo '$(srcdir)/'`s_infconst.c
-
-lib_a-s_infconst.obj: s_infconst.c
-	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_infconst.obj `if test -f 's_infconst.c'; then $(CYGPATH_W) 's_infconst.c'; else $(CYGPATH_W) '$(srcdir)/s_infconst.c'; fi`
-
 lib_a-s_infinity.o: s_infinity.c
 	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-s_infinity.o `test -f 's_infinity.c' || echo '$(srcdir)/'`s_infinity.c
 
diff --git a/newlib/libm/common/s_infconst.c b/newlib/libm/common/s_infconst.c
deleted file mode 100644
index 47a9dca..0000000
--- a/newlib/libm/common/s_infconst.c
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Infinity as a constant value.   This is used for HUGE_VAL.
- * Added by Cygnus Support.
- */
-
-#include <float.h>
-#include <math.h>
-
-/* These should never actually be used any longer, as their use in math.h was
- * removed, but they are kept here in case a user was pointing to them.
- * FIXME:  deprecate these identifiers and then delete them.  */
- 
-/* Float version of infinity.  */
-const union __fmath __infinityf[1] = { { FLT_MAX+FLT_MAX } };
-
-/* Double version of infinity.  */
-const union __dmath __infinity[1] = { { DBL_MAX+DBL_MAX } };
-
-/* Long double version of infinity.  */
-#if defined(_HAVE_LONG_DOUBLE)
-const union __ldmath __infinityld[1] = { { LDBL_MAX+LDBL_MAX } };
-#endif
diff --git a/winsup/cygwin/math/isinf.c b/winsup/cygwin/math/isinf.c
index fd9e299..6482c99 100644
--- a/winsup/cygwin/math/isinf.c
+++ b/winsup/cygwin/math/isinf.c
@@ -16,3 +16,8 @@ isinfl (long double x)
   return __builtin_isinf_sign (x);
 }
 
+/* Infinity as a constant value.  Should never actually be used any longer,
+   but has been exported by Cygwin for ages so we keep it here for (probably
+   unnecessary) backward compat. */
+#include <float.h>
+const double __infinity[1] = { DBL_MAX+DBL_MAX };


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]