Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/compat/gen use the local versions of ldexp/frexp/mo...



details:   https://anonhg.NetBSD.org/src/rev/0d2fe9cb667e
branches:  trunk
changeset: 754211:0d2fe9cb667e
user:      drochner <drochner%NetBSD.org@localhost>
date:      Fri Apr 23 19:04:54 2010 +0000

description:
use the local versions of ldexp/frexp/modf again rather than pulling
in libm source code. The libm functions depend on other libm functions,
this requires symbol renaming, and with the reachover method this
is going to be a mess. Also, bundling the dependencies into one .o
file has the potential to cause symbol conflicts on static linking.

diffstat:

 lib/libc/compat/gen/Makefile.inc           |   8 +-------
 lib/libc/compat/gen/compat_frexp_ieee754.c |  11 ++++-------
 lib/libc/compat/gen/compat_ldexp_ieee754.c |  13 ++++---------
 lib/libc/compat/gen/compat_modf_ieee754.c  |   9 +++------
 4 files changed, 12 insertions(+), 29 deletions(-)

diffs (126 lines):

diff -r e442152545a7 -r 0d2fe9cb667e lib/libc/compat/gen/Makefile.inc
--- a/lib/libc/compat/gen/Makefile.inc  Fri Apr 23 19:00:58 2010 +0000
+++ b/lib/libc/compat/gen/Makefile.inc  Fri Apr 23 19:04:54 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.12 2009/08/16 19:33:39 christos Exp $
+#      $NetBSD: Makefile.inc,v 1.13 2010/04/23 19:04:54 drochner Exp $
 
 .PATH: ${COMPATDIR}/gen
 SRCS+=compat_errlist.c compat_fts.c compat___fts13.c compat___fts30.c \
@@ -9,9 +9,3 @@
     compat__sys_errlist.c compat__sys_nerr.c compat__sys_siglist.c \
     compat_time.c compat_utime.c compat_devname.c compat_alphasort.c \
     compat_getpwent.c compat___fts32.c compat_utmp.c compat___fts50.c
-
-LIBMINC=-I${LIBCDIR}/../libm/src -DUSE_LIBM
-CPPFLAGS.compat_frexp_ieee754.c += ${LIBMINC}
-CPPFLAGS.compat_ldexp_ieee754.c += ${LIBMINC}
-CPPFLAGS.compat_modf_ieee754.c += ${LIBMINC}
-
diff -r e442152545a7 -r 0d2fe9cb667e lib/libc/compat/gen/compat_frexp_ieee754.c
--- a/lib/libc/compat/gen/compat_frexp_ieee754.c        Fri Apr 23 19:00:58 2010 +0000
+++ b/lib/libc/compat/gen/compat_frexp_ieee754.c        Fri Apr 23 19:04:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_frexp_ieee754.c,v 1.4 2008/09/28 15:19:09 christos Exp $ */
+/* $NetBSD: compat_frexp_ieee754.c,v 1.5 2010/04/23 19:04:54 drochner Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -35,21 +35,19 @@
  * from: Header: frexp.c,v 1.1 91/07/07 04:45:01 torek Exp
  */
 
-#ifdef USE_LIBM
-#include "s_frexp.c"
-#else
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
 #if 0
 static char sccsid[] = "@(#)frexp.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: compat_frexp_ieee754.c,v 1.4 2008/09/28 15:19:09 christos Exp $");
+__RCSID("$NetBSD: compat_frexp_ieee754.c,v 1.5 2010/04/23 19:04:54 drochner Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #include <machine/ieee.h>
-#include <math.h>
+
+double frexp(double, int *);
 
 /*
  * Split the given value into a fraction in the range [0.5, 1.0) and
@@ -83,4 +81,3 @@
                return (value);
        }
 }
-#endif
diff -r e442152545a7 -r 0d2fe9cb667e lib/libc/compat/gen/compat_ldexp_ieee754.c
--- a/lib/libc/compat/gen/compat_ldexp_ieee754.c        Fri Apr 23 19:00:58 2010 +0000
+++ b/lib/libc/compat/gen/compat_ldexp_ieee754.c        Fri Apr 23 19:04:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_ldexp_ieee754.c,v 1.4 2008/09/28 18:54:30 christos Exp $ */
+/* $NetBSD: compat_ldexp_ieee754.c,v 1.5 2010/04/23 19:04:54 drochner Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -29,20 +29,16 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifdef USE_LIBM
-#include "s_finite.c"
-#include "s_scalbn.c"
-#include "s_ldexp.c"
-#else
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: compat_ldexp_ieee754.c,v 1.4 2008/09/28 18:54:30 christos Exp $");
+__RCSID("$NetBSD: compat_ldexp_ieee754.c,v 1.5 2010/04/23 19:04:54 drochner Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/types.h>
 #include <machine/ieee.h>
 #include <errno.h>
-#include <math.h>
+
+double ldexp(double, int);
 
 /*
  * Multiply the given value by 2^expon.
@@ -145,4 +141,3 @@
                return (u.dblu_d);
        }
 }
-#endif
diff -r e442152545a7 -r 0d2fe9cb667e lib/libc/compat/gen/compat_modf_ieee754.c
--- a/lib/libc/compat/gen/compat_modf_ieee754.c Fri Apr 23 19:00:58 2010 +0000
+++ b/lib/libc/compat/gen/compat_modf_ieee754.c Fri Apr 23 19:04:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_modf_ieee754.c,v 1.3 2010/01/27 14:10:41 drochner Exp $ */
+/* $NetBSD: compat_modf_ieee754.c,v 1.4 2010/04/23 19:04:54 drochner Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -27,13 +27,11 @@
  * rights to redistribute these changes.
  */
 
-#ifdef USE_LIBM
-#include "s_modf.c"
-#else
 #include <sys/types.h>
 #include <machine/ieee.h>
 #include <errno.h>
-#include <math.h>
+
+double modf(double, double *);
 
 /*
  * double modf(double val, double *iptr)
@@ -103,4 +101,3 @@
        u.dblu_dbl.dbl_sign = v.dblu_dbl.dbl_sign;
        return (u.dblu_d);
 }
-#endif



Home | Main Index | Thread Index | Old Index