]> sourceware.org Git - glibc.git/commitdiff
Mon Feb 20 04:04:57 1995 Roland McGrath <roland@duality.gnu.ai.mit.edu>
authorRoland McGrath <roland@gnu.org>
Mon, 20 Feb 1995 09:50:50 +0000 (09:50 +0000)
committerRoland McGrath <roland@gnu.org>
Mon, 20 Feb 1995 09:50:50 +0000 (09:50 +0000)
* config.h.in [HAVE_ELF || HAVE_GNU_LD]: Define HAVE_WEAK_SYMBOLS.

* stdlib/strtod.c (PASTE, PASTE1): New helper macros; use these in
  access to float.h macros.

* misc/efgcvt.c: New file.
* misc/Makefile (routines): Add efgcvt.

ChangeLog
config.h.in
misc/efgcvt.c [new file with mode: 0644]
stdlib/strtod.c
sysdeps/mach/hurd/Makefile
sysdeps/mach/hurd/errnos.awk

index b056ee7ca8075e369eb3ee5cf40395b06174769e..959da903a0ce47be4945e653e222921944ca47bb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Mon Feb 20 04:04:57 1995  Roland McGrath  <roland@duality.gnu.ai.mit.edu>
+
+       * config.h.in [HAVE_ELF || HAVE_GNU_LD]: Define HAVE_WEAK_SYMBOLS.
+
+       * stdlib/strtod.c (PASTE, PASTE1): New helper macros; use these in
+       access to float.h macros.
+
+       * misc/efgcvt.c: New file.
+       * misc/Makefile (routines): Add efgcvt.
+
 Sun Feb 19 20:10:43 1995  Brendan Kehoe  <brendan@zen.org>
 
        * sysdeps/sparc/mul.S: Renamed to `dotmul.S'.
index 5761db2c5c697e564f5da1024b36a97d9862cd9e..504f77021e0742289415a7c5952486719457fc92 100644 (file)
 
 /* Define if using the GNU assembler, gas.  */
 #undef HAVE_GNU_AS
+
+/* ELF has weak symbols, and with GNU ld a.out does too.  */
+#ifndef HAVE_WEAK_SYMBOLS
+#if defined (HAVE_ELF) || defined (HAVE_GNU_LD)
+#define HAVE_WEAK_SYMBOLS
+#endif
+#endif
 \f
 /* These symbols might be defined by some sysdeps configures.  */
 
diff --git a/misc/efgcvt.c b/misc/efgcvt.c
new file mode 100644 (file)
index 0000000..6473475
--- /dev/null
@@ -0,0 +1,72 @@
+/* [efg]cvt -- compatibility functions for floating point formatting
+Copyright (C) 1995 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library 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
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB.  If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+
+char *
+fcvt (value, ndigit, decpt, sign)
+     double value;
+     int ndigit, *decpt, *sign;
+{
+  static char buf[100];
+  int n, i;
+
+  *sign = value < 0.0;
+  if (*sign)
+    value = - value;
+
+  n = snprintf (buf, sizeof buf, "%.*f", ndigit, value);
+  if (n < 0)
+    return NULL;
+
+  i = 0;
+  while (i < n && isdigit (buf[i]))
+    ++i;
+  *decpt = i;
+  do
+    ++i;
+  while (! isdigit (buf[i]));
+  memmove (&buf[i - *decpt], buf, n - (i - *decpt));
+
+  return buf;
+}
+
+char *
+ecvt (value, ndigit, decpt, sign)
+     double value;
+     int ndigit, *decpt, *sign;
+{
+  ndigit -= (int) floor (log10 (value));
+  if (ndigit < 0)
+    ndigit = 0;
+  return fcvt (value, ndigit, decpt, sign);
+}
+
+char *
+gcvt (value, ndigit, buf)
+     double value;
+     int ndigit;
+     char *buf;
+{
+  sprintf (buf, "%.*g", ndigit, value);
+  return buf;
+}
index d647753e79ac3e5d5949f20c4f05a3c27876bf59..6bd2dd685a7ac4350da887a97411f935c7b8ca3d 100644 (file)
@@ -47,13 +47,16 @@ Cambridge, MA 02139, USA.  */
 
 
 /* Constants we need from float.h; select the set for the FLOAT precision.  */
-#define MANT_DIG       FLT##_MANT_DIG
-#define        MAX_EXP         FLT##_MAX_EXP
-#define        MIN_EXP         FLT##_MIN_EXP
-#define MAX_10_EXP     FLT##_MAX_10_EXP
-#define MIN_10_EXP     FLT##_MIN_10_EXP
-#define        MAX_10_EXP_LOG  FLT##_MAX_10_EXP_LOG
-
+#define MANT_DIG       PASTE(FLT,_MANT_DIG)
+#define        MAX_EXP         PASTE(FLT,_MAX_EXP)
+#define        MIN_EXP         PASTE(FLT,_MIN_EXP)
+#define MAX_10_EXP     PASTE(FLT,_MAX_10_EXP)
+#define MIN_10_EXP     PASTE(FLT,_MIN_10_EXP)
+#define        MAX_10_EXP_LOG  PASTE(FLT,_MAX_10_EXP_LOG)
+
+/* Extra macros required to get FLT expanded before the pasting.  */
+#define PASTE(a,b)     PASTE1(a,b)
+#define PASTE1(a,b)    a##b
 
 /* Function to construct a floating point number from an MP integer
    containing the fraction bits, a base 2 exponent, and a sign flag.  */
index 70b6ec5d49075b1d5844eaee6fa878213f3e7aa9..02430faed928126b43e93dc17253e92bcfd8e6ef 100644 (file)
@@ -108,7 +108,8 @@ $(objpfx)stamp-errnos: $(hurd)/errnos.awk $(errno.texinfo) \
 # Make it unwritable so noone will edit it by mistake.
        -chmod a-w $(hurd)/errnos.h-tmp
        ./$(..)move-if-change $(hurd)/errnos.h-tmp $(hurd)/errnos.h
-       test -d CVS && cvs commit -m'Regenerated from $^' $@
+       test -d CVS && \
+         (cd $(hurd); cvs commit -m'Regenerated from $^' errnos.h)
        touch $@
 
 $(hurd)/errlist.c: $(hurd)/errlist.awk $(errno.texinfo)
index a6b251f21194c94c61d8d673bec66082f9741163..a8029987b5987853cb6b6fa1458dbdf3dde885ab 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -20,6 +20,7 @@
 # @comment errno.h
 # @comment POSIX.1: Function not implemented
 # @deftypevr Macro int ENOSYS
+# @comment errno 123
 
 BEGIN {
     printf "/* This file generated by";
This page took 0.059917 seconds and 5 git commands to generate.