Ticket #3408: strtold-glibc-generic.patch

File strtold-glibc-generic.patch, 3.0 KB (added by kaliber, 14 years ago)

glibc strtold generic implementation

  • src/system/libroot/posix/glibc/stdlib/Jamfile

     
    3636    srand48.c
    3737    srand48_r.c
    3838    strtod.c
     39    strtold.c
    3940    strtof.c
    4041    wcstombs.c
    4142    wctomb.c
  • src/system/libroot/posix/glibc/stdlib/strtold.c

     
     1/* Copyright (C) 1999 Free Software Foundation, Inc.
     2
     3   The GNU C Library is free software; you can redistribute it and/or
     4   modify it under the terms of the GNU Library General Public License as
     5   published by the Free Software Foundation; either version 2 of the
     6   License, or (at your option) any later version.
     7
     8   The GNU C Library is distributed in the hope that it will be useful,
     9   but WITHOUT ANY WARRANTY; without even the implied warranty of
     10   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     11   Library General Public License for more details.
     12
     13   You should have received a copy of the GNU Library General Public
     14   License along with the GNU C Library; see the file COPYING.LIB.  If not,
     15   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
     16   Boston, MA 02111-1307, USA.  */
     17
     18#include <math.h>
     19#include <stdlib.h>
     20
     21/* There is no `long double' type, use the `double' implementations.  */
     22long double
     23__strtold_internal (const char *nptr, char **endptr, int group)
     24{
     25  return __strtod_internal (nptr, endptr, group);
     26}
     27
     28long double
     29strtold (const char *nptr, char **endptr)
     30{
     31  return __strtod_internal (nptr, endptr, 0);
     32}
  • src/system/libroot/posix/glibc/stdlib/strtod.c

     
    15741574{
    15751575  return INTERNAL (STRTOF) (nptr, endptr, 0 LOCALE_PARAM);
    15761576}
    1577 
    1578 
    1579 // XXX this is not correct
    1580 
    1581 long double __strtold_internal(const char *number, char **_end, int group);
    1582 
    1583 long double
    1584 #ifdef weak_function
    1585 weak_function
    1586 #endif
    1587 __strtold_internal(const char *number, char **_end, int group)
    1588 {
    1589     return __strtod_internal(number, _end, group);
    1590 }
    1591 
  • headers/posix/stdlib.h

     
    8888extern unsigned long    atoul(const char *string);
    8989
    9090extern double           strtod(const char *string, char **end);
     91extern long double      strtold(const char *string, char **end);
    9192extern float            strtof(const char *string, char **end);
    9293extern long             strtol(const char *string, char **end, int base);
    9394extern unsigned long    strtoul(const char *string, char **end, int base);