OSDN Git Service

- gcvt() is marked LEGACY in XSI and mandatory in BSD.
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 29 Nov 2006 21:04:35 +0000 (21:04 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 29 Nov 2006 21:04:35 +0000 (21:04 -0000)
  Also make compilation conditional on float support.

include/stdlib.h
libc/stdlib/Makefile.in

index 3ed029c..982bac7 100644 (file)
@@ -693,10 +693,12 @@ __END_NAMESPACE_C99
 #endif
 
 
-#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED
+#if defined __USE_SVID || defined __USE_XOPEN_EXTENDED || defined __USE_BSD
 /* Convert floating point numbers to strings.  The returned values are
    valid only until another call to the same function.  */
 
+# ifdef __UCLIBC_SUSV3_LEGACY__
+
 #if 0
 /* Convert VALUE to a string with NDIGIT digits and return a pointer to
    this.  Set *DECPT with the position of the decimal character and *SIGN
@@ -716,7 +718,7 @@ extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
    be written to BUF.  */
 extern char *gcvt (double __value, int __ndigit, char *__buf)
      __THROW __nonnull ((3)) __wur;
-
+# endif /* __UCLIBC_SUSV3_LEGACY__ */
 
 # if 0 /*def __USE_MISC*/
 /* Long double versions of above functions.  */
index 016b3f1..5a4aafd 100644 (file)
@@ -12,7 +12,7 @@ include $(top_srcdir)libc/stdlib/malloc-standard/Makefile.in
 CSRC := \
        abort.c getenv.c mkdtemp.c mktemp.c realpath.c mkstemp.c \
        rand.c random.c random_r.c setenv.c system.c div.c ldiv.c lldiv.c \
-       getpt.c ptsname.c grantpt.c unlockpt.c gcvt.c drand48-iter.c jrand48.c \
+       getpt.c ptsname.c grantpt.c unlockpt.c drand48-iter.c jrand48.c \
        jrand48_r.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
        nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
        valloc.c posix_memalign.c a64l.c l64a.c
@@ -24,6 +24,9 @@ CSRC += mkstemp64.c
 endif
 ifeq ($(UCLIBC_HAS_FLOATS),y)
 CSRC += drand48.c drand48_r.c erand48.c erand48_r.c
+ifeq ($(UCLIBC_SUSV3_LEGACY),y)
+CSRC += gcvt.c
+endif
 endif
 
 # multi source stdlib.c