Add strtof_l, strtod_l and strtold_l.
This commit is contained in:
parent
f4b203ed51
commit
c99aac45e5
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: stdlib.h,v 1.101 2013/04/16 21:44:06 joerg Exp $ */
|
||||
/* $NetBSD: stdlib.h,v 1.102 2013/04/18 21:54:10 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
|
@ -334,6 +334,10 @@ qdiv_t qdiv(quad_t, quad_t);
|
|||
typedef struct _locale *locale_t;
|
||||
# define __LOCALE_T_DECLARED
|
||||
# endif
|
||||
double strtod_l(const char * __restrict, char ** __restrict, locale_t);
|
||||
float strtof_l(const char * __restrict, char ** __restrict, locale_t);
|
||||
long double strtold_l(const char * __restrict, char ** __restrict,
|
||||
locale_t);
|
||||
long strtol_l(const char * __restrict, char ** __restrict, int, locale_t);
|
||||
unsigned long
|
||||
strtoul_l(const char * __restrict, char ** __restrict, int, locale_t);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: _strtof.c,v 1.2 2009/10/21 01:07:45 snj Exp $ */
|
||||
/* $NetBSD: _strtof.c,v 1.3 2013/04/18 21:54:10 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Christos Zoulas. All rights reserved.
|
||||
|
@ -26,15 +26,17 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: _strtof.c,v 1.2 2009/10/21 01:07:45 snj Exp $");
|
||||
__RCSID("$NetBSD: _strtof.c,v 1.3 2013/04/18 21:54:10 joerg Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#if defined(__indr_reference)
|
||||
__indr_reference(_strtof, strtof)
|
||||
__indr_reference(_strtof_l, strtof_l)
|
||||
#else
|
||||
|
||||
#include <stdlib.h>
|
||||
float _strtof(const char * __restrict, char ** __restrict);
|
||||
float _strtof_l(const char * __restrict, char ** __restrict, locale_t);
|
||||
|
||||
float
|
||||
strtof(const char *nptr, char **endptr)
|
||||
|
@ -42,4 +44,11 @@ strtof(const char *nptr, char **endptr)
|
|||
|
||||
return _strtof(nptr, endptr);
|
||||
}
|
||||
|
||||
float
|
||||
strtof_l(const char *nptr, char **endptr, locale_t loc)
|
||||
{
|
||||
|
||||
return _strtof_l(nptr, endptr, loc);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: gdtoa.h,v 1.9 2011/03/20 23:15:35 christos Exp $ */
|
||||
/* $NetBSD: gdtoa.h,v 1.10 2013/04/18 21:54:10 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -38,6 +38,11 @@ THIS SOFTWARE.
|
|||
#include <stddef.h> /* for size_t */
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef __LOCALE_T_DECLARED
|
||||
typedef struct _locale *locale_t;
|
||||
#define __LOCALE_T_DECLARED
|
||||
#endif
|
||||
|
||||
#ifndef Long
|
||||
#define Long int32_t
|
||||
#endif
|
||||
|
@ -133,7 +138,8 @@ extern char* gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp,
|
|||
extern void freedtoa ANSI((char*));
|
||||
extern float strtof ANSI((CONST char *, char **));
|
||||
extern double strtod ANSI((CONST char *, char **));
|
||||
extern int strtodg ANSI((CONST char*, char**, CONST FPI*, Long*, ULong*));
|
||||
extern int strtodg ANSI((CONST char*, char**, CONST FPI*, Long*, ULong*,
|
||||
locale_t));
|
||||
|
||||
extern char* g_ddfmt ANSI((char*, double*, int, size_t));
|
||||
extern char* g_dfmt ANSI((char*, double*, int, size_t));
|
||||
|
@ -148,7 +154,7 @@ extern int strtoIf ANSI((CONST char*, char**, float*, float*));
|
|||
extern int strtoIQ ANSI((CONST char*, char**, void*, void*));
|
||||
extern int strtoIx ANSI((CONST char*, char**, void*, void*));
|
||||
extern int strtoIxL ANSI((CONST char*, char**, void*, void*));
|
||||
extern int strtord ANSI((CONST char*, char**, int, double*));
|
||||
extern int strtord ANSI((CONST char*, char**, int, double*, locale_t));
|
||||
extern int strtordd ANSI((CONST char*, char**, int, double*));
|
||||
extern int strtorf ANSI((CONST char*, char**, int, float*));
|
||||
extern int strtorQ ANSI((CONST char*, char**, int, void*));
|
||||
|
@ -159,9 +165,9 @@ extern int strtodI ANSI((CONST char*, char**, double*));
|
|||
extern int strtopd ANSI((CONST char*, char**, double*));
|
||||
extern int strtopdd ANSI((CONST char*, char**, double*));
|
||||
extern int strtopf ANSI((CONST char*, char**, float*));
|
||||
extern int strtopQ ANSI((CONST char*, char**, void*));
|
||||
extern int strtopx ANSI((CONST char*, char**, void*));
|
||||
extern int strtopxL ANSI((CONST char*, char**, void*));
|
||||
extern int strtopQ ANSI((CONST char*, char**, void*, locale_t));
|
||||
extern int strtopx ANSI((CONST char*, char**, void*, locale_t));
|
||||
extern int strtopxL ANSI((CONST char*, char**, void*, locale_t));
|
||||
#else
|
||||
#define strtopd(s,se,x) strtord(s,se,1,x)
|
||||
#define strtopdd(s,se,x) strtordd(s,se,1,x)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtod.c,v 1.11 2012/03/22 15:34:14 christos Exp $ */
|
||||
/* $NetBSD: strtod.c,v 1.12 2013/04/18 21:54:10 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -31,13 +31,15 @@ THIS SOFTWARE.
|
|||
/* Please send bug reports to David M. Gay (dmg at acm dot org,
|
||||
* with " at " changed at "@" and " dot " changed to "."). */
|
||||
|
||||
#include "namespace.h"
|
||||
#include "gdtoaimp.h"
|
||||
#ifndef NO_FENV_H
|
||||
#include <fenv.h>
|
||||
#endif
|
||||
|
||||
#ifdef USE_LOCALE
|
||||
#include "locale.h"
|
||||
#include <locale.h>
|
||||
#include "setlocale_local.h"
|
||||
#endif
|
||||
|
||||
#ifdef IEEE_Arith
|
||||
|
@ -62,6 +64,8 @@ static CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128,
|
|||
#ifndef __HAVE_LONG_DOUBLE
|
||||
__strong_alias(_strtold, strtod)
|
||||
__weak_alias(strtold, _strtold)
|
||||
__strong_alias(_strtold_l, strtod_l)
|
||||
__weak_alias(strtold_l, _strtold_l)
|
||||
#endif
|
||||
|
||||
#ifdef Avoid_Underflow /*{*/
|
||||
|
@ -86,13 +90,8 @@ sulp
|
|||
}
|
||||
#endif /*}*/
|
||||
|
||||
double
|
||||
strtod
|
||||
#ifdef KR_headers
|
||||
(s00, se) CONST char *s00; char **se;
|
||||
#else
|
||||
(CONST char *s00, char **se)
|
||||
#endif
|
||||
static double
|
||||
_int_strtod_l(CONST char *s00, char **se, locale_t loc)
|
||||
{
|
||||
#ifdef Avoid_Underflow
|
||||
int scale;
|
||||
|
@ -116,25 +115,8 @@ strtod
|
|||
int inexact, oldinexact;
|
||||
#endif
|
||||
#ifdef USE_LOCALE /*{{*/
|
||||
#ifdef NO_LOCALE_CACHE
|
||||
char *decimalpoint = localeconv()->decimal_point;
|
||||
char *decimalpoint = localeconv_l(loc)->decimal_point;
|
||||
size_t dplen = strlen(decimalpoint);
|
||||
#else
|
||||
char *decimalpoint;
|
||||
static char *decimalpoint_cache;
|
||||
static size_t dplen;
|
||||
if (!(s0 = decimalpoint_cache)) {
|
||||
s0 = localeconv()->decimal_point;
|
||||
if ((decimalpoint_cache = MALLOC(strlen(s0) + 1)) != NULL) {
|
||||
strcpy(decimalpoint_cache, s0);
|
||||
s0 = decimalpoint_cache;
|
||||
}
|
||||
dplen = strlen(s0);
|
||||
}
|
||||
decimalpoint = __UNCONST(s0);
|
||||
#endif /*NO_LOCALE_CACHE*/
|
||||
#else /*USE_LOCALE}{*/
|
||||
#define dplen 1
|
||||
#endif /*USE_LOCALE}}*/
|
||||
|
||||
#ifdef Honor_FLT_ROUNDS /*{*/
|
||||
|
@ -1118,3 +1100,20 @@ strtod
|
|||
return sign ? -dval(&rv) : dval(&rv);
|
||||
}
|
||||
|
||||
double
|
||||
strtod(CONST char *s, char **sp)
|
||||
{
|
||||
return _int_strtod_l(s, sp, *_current_locale());
|
||||
}
|
||||
|
||||
#ifdef __weak_alias
|
||||
__weak_alias(strtod_l, _strtod_l)
|
||||
#endif
|
||||
|
||||
double
|
||||
strtod_l(CONST char *s, char **sp, locale_t loc)
|
||||
{
|
||||
if (loc == NULL)
|
||||
loc = _C_locale;
|
||||
return _int_strtod_l(s, sp, loc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtodg.c,v 1.10 2012/03/22 13:09:12 he Exp $ */
|
||||
/* $NetBSD: strtodg.c,v 1.11 2013/04/18 21:54:10 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -319,13 +319,8 @@ mantbits(U *d)
|
|||
#endif /* !VAX */
|
||||
|
||||
int
|
||||
strtodg
|
||||
#ifdef KR_headers
|
||||
(s00, se, fpi, expt, bits)
|
||||
CONST char *s00; char **se; CONST FPI *fpi; Long *expt; ULong *bits;
|
||||
#else
|
||||
(CONST char *s00, char **se, CONST FPI *fpi, Long *expt, ULong *bits)
|
||||
#endif
|
||||
strtodg(CONST char *s00, char **se, CONST FPI *fpi, Long *expt, ULong *bits,
|
||||
locale_t loc)
|
||||
{
|
||||
int abe, abits, asub;
|
||||
#ifdef INFNAN_CHECK
|
||||
|
@ -342,25 +337,8 @@ strtodg
|
|||
ULong *b, *be, y, z;
|
||||
Bigint *ab, *bb, *bb1, *bd, *bd0, *bs, *delta, *rvb, *rvb0;
|
||||
#ifdef USE_LOCALE /*{{*/
|
||||
#ifdef NO_LOCALE_CACHE
|
||||
char *decimalpoint = localeconv()->decimal_point;
|
||||
char *decimalpoint = localeconv_l(loc)->decimal_point;
|
||||
size_t dplen = strlen(decimalpoint);
|
||||
#else
|
||||
char *decimalpoint;
|
||||
static char *decimalpoint_cache;
|
||||
static size_t dplen;
|
||||
if (!(s0 = decimalpoint_cache)) {
|
||||
s0 = localeconv()->decimal_point;
|
||||
if ((decimalpoint_cache = MALLOC(strlen(s0) + 1)) != NULL) {
|
||||
strcpy(decimalpoint_cache, s0);
|
||||
s0 = decimalpoint_cache;
|
||||
}
|
||||
dplen = strlen(s0);
|
||||
}
|
||||
decimalpoint = __UNCONST(s0);
|
||||
#endif /*NO_LOCALE_CACHE*/
|
||||
#else /*USE_LOCALE}{*/
|
||||
#define dplen 1
|
||||
#endif /*USE_LOCALE}}*/
|
||||
|
||||
e2 = 0; /* XXX gcc */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtof.c,v 1.5 2011/06/20 09:11:17 mrg Exp $ */
|
||||
/* $NetBSD: strtof.c,v 1.6 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -34,16 +34,16 @@ THIS SOFTWARE.
|
|||
#include "namespace.h"
|
||||
#include "gdtoaimp.h"
|
||||
|
||||
#include <locale.h>
|
||||
#include "setlocale_local.h"
|
||||
|
||||
#ifdef __weak_alias
|
||||
__weak_alias(strtof, _strtof)
|
||||
__weak_alias(strtof_l, _strtof_l)
|
||||
#endif
|
||||
|
||||
float
|
||||
#ifdef KR_headers
|
||||
strtof(s, sp) CONST char *s; char **sp;
|
||||
#else
|
||||
strtof(CONST char *s, char **sp)
|
||||
#endif
|
||||
static float
|
||||
_int_strtof_l(CONST char *s, char **sp, locale_t loc)
|
||||
{
|
||||
static CONST FPI fpi0 = { 24, 1-127-24+1, 254-127-24+1, 1, SI };
|
||||
ULong bits[1];
|
||||
|
@ -56,7 +56,7 @@ strtof(CONST char *s, char **sp)
|
|||
#define fpi &fpi0
|
||||
#endif
|
||||
|
||||
k = strtodg(s, sp, fpi, &expt, bits);
|
||||
k = strtodg(s, sp, fpi, &expt, bits, loc);
|
||||
if (k == STRTOG_NoMemory) {
|
||||
errno = ERANGE;
|
||||
return HUGE_VALF;
|
||||
|
@ -92,3 +92,17 @@ strtof(CONST char *s, char **sp)
|
|||
u.L[0] |= 0x80000000L;
|
||||
return u.f;
|
||||
}
|
||||
|
||||
float
|
||||
strtof(CONST char *s, char **sp)
|
||||
{
|
||||
return _int_strtof_l(s, sp, *_current_locale());
|
||||
}
|
||||
|
||||
float
|
||||
strtof_l(CONST char *s, char **sp, locale_t loc)
|
||||
{
|
||||
if (loc == NULL)
|
||||
loc = _C_locale;
|
||||
return _int_strtof_l(s, sp, loc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtof_vaxf.c,v 1.6 2011/07/01 03:20:06 matt Exp $ */
|
||||
/* $NetBSD: strtof_vaxf.c,v 1.7 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -35,17 +35,16 @@ THIS SOFTWARE.
|
|||
|
||||
#include "namespace.h"
|
||||
#include "gdtoaimp.h"
|
||||
#include <locale.h>
|
||||
#include "setlocale_local.h"
|
||||
|
||||
#ifdef __weak_alias
|
||||
__weak_alias(strtof, _strtof)
|
||||
__weak_alias(strtof_l, _strtof_l)
|
||||
#endif
|
||||
|
||||
float
|
||||
#ifdef KR_headers
|
||||
strtof(s, sp) CONST char *s; char **sp;
|
||||
#else
|
||||
strtof(CONST char *s, char **sp)
|
||||
#endif
|
||||
static float
|
||||
_int_strtof_l(CONST char *s, char **sp, locale_t loc)
|
||||
{
|
||||
static CONST FPI fpi = { 24, 1-128-1-24+1, 255-128-1-24+1, 1, SI };
|
||||
ULong bits[1];
|
||||
|
@ -53,7 +52,7 @@ strtof(CONST char *s, char **sp)
|
|||
int k;
|
||||
union { ULong L[1]; float f; } u;
|
||||
|
||||
k = strtodg(s, sp, &fpi, &expt, bits);
|
||||
k = strtodg(s, sp, &fpi, &expt, bits, loc);
|
||||
if (k == STRTOG_NoMemory) {
|
||||
errno = ERANGE;
|
||||
return HUGE_VALF;
|
||||
|
@ -80,3 +79,17 @@ strtof(CONST char *s, char **sp)
|
|||
u.L[0] |= 0x00008000L;
|
||||
return u.f;
|
||||
}
|
||||
|
||||
float
|
||||
strtof(CONST char *s, char **sp)
|
||||
{
|
||||
return _int_strtof_l(s, sp, *_current_locale());
|
||||
}
|
||||
|
||||
float
|
||||
strtof_l(CONST char *s, char **sp, locale_t loc)
|
||||
{
|
||||
if (loc == NULL)
|
||||
loc = _C_locale;
|
||||
return _int_strtof_l(s, sp, loc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtold_subr.c,v 1.1 2006/03/15 17:35:18 kleink Exp $ */
|
||||
/* $NetBSD: strtold_subr.c,v 1.2 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Written by Klaus Klein <kleink@NetBSD.org>, November 16, 2005.
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: strtold_subr.c,v 1.1 2006/03/15 17:35:18 kleink Exp $");
|
||||
__RCSID("$NetBSD: strtold_subr.c,v 1.2 2013/04/18 21:54:11 joerg Exp $");
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
#include "namespace.h"
|
||||
|
@ -23,8 +23,12 @@ __RCSID("$NetBSD: strtold_subr.c,v 1.1 2006/03/15 17:35:18 kleink Exp $");
|
|||
#include <stdlib.h>
|
||||
#include "gdtoa.h"
|
||||
|
||||
#include <locale.h>
|
||||
#include "setlocale_local.h"
|
||||
|
||||
#ifdef __weak_alias
|
||||
__weak_alias(strtold, _strtold)
|
||||
__weak_alias(strtold_l, _strtold_l)
|
||||
#endif
|
||||
|
||||
#ifndef __HAVE_LONG_DOUBLE
|
||||
|
@ -37,11 +41,25 @@ __weak_alias(strtold, _strtold)
|
|||
|
||||
#define STRTOP(x) __CONCAT(strtop, x)
|
||||
|
||||
long double
|
||||
strtold(const char *nptr, char **endptr)
|
||||
static long double
|
||||
_int_strtold_l(const char *nptr, char **endptr, locale_t loc)
|
||||
{
|
||||
long double ld;
|
||||
|
||||
(void)STRTOP(GDTOA_LD_FMT)(nptr, endptr, &ld);
|
||||
(void)STRTOP(GDTOA_LD_FMT)(nptr, endptr, &ld, loc);
|
||||
return ld;
|
||||
}
|
||||
|
||||
long double
|
||||
strtold(CONST char *s, char **sp)
|
||||
{
|
||||
return _int_strtold_l(s, sp, *_current_locale());
|
||||
}
|
||||
|
||||
long double
|
||||
strtold_l(CONST char *s, char **sp, locale_t loc)
|
||||
{
|
||||
if (loc == NULL)
|
||||
loc = _C_locale;
|
||||
return _int_strtold_l(s, sp, loc);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtopQ.c,v 1.5 2011/03/20 23:15:35 christos Exp $ */
|
||||
/* $NetBSD: strtopQ.c,v 1.6 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -52,11 +52,7 @@ THIS SOFTWARE.
|
|||
#endif
|
||||
|
||||
int
|
||||
#ifdef KR_headers
|
||||
strtopQ(s, sp, V) CONST char *s; char **sp; void *V;
|
||||
#else
|
||||
strtopQ(CONST char *s, char **sp, void *V)
|
||||
#endif
|
||||
strtopQ(CONST char *s, char **sp, void *V, locale_t loc)
|
||||
{
|
||||
static CONST FPI fpi0 = { 113, 1-16383-113+1, 32766 - 16383 - 113 + 1, 1, SI };
|
||||
ULong bits[4];
|
||||
|
@ -69,7 +65,7 @@ strtopQ(CONST char *s, char **sp, void *V)
|
|||
#define fpi &fpi0
|
||||
#endif
|
||||
|
||||
k = strtodg(s, sp, fpi, &expt, bits);
|
||||
k = strtodg(s, sp, fpi, &expt, bits, loc);
|
||||
if (k == STRTOG_NoMemory)
|
||||
return k;
|
||||
switch(k & STRTOG_Retmask) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtopx.c,v 1.5 2011/03/20 23:15:35 christos Exp $ */
|
||||
/* $NetBSD: strtopx.c,v 1.6 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -54,11 +54,7 @@ THIS SOFTWARE.
|
|||
#endif
|
||||
|
||||
int
|
||||
#ifdef KR_headers
|
||||
strtopx(s, sp, V) CONST char *s; char **sp; void *V;
|
||||
#else
|
||||
strtopx(CONST char *s, char **sp, void *V)
|
||||
#endif
|
||||
strtopx(CONST char *s, char **sp, void *V, locale_t loc)
|
||||
{
|
||||
static const FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
|
||||
ULong bits[2];
|
||||
|
@ -71,7 +67,7 @@ strtopx(CONST char *s, char **sp, void *V)
|
|||
#define fpi &fpi0
|
||||
#endif
|
||||
|
||||
k = strtodg(s, sp, fpi, &expt, bits);
|
||||
k = strtodg(s, sp, fpi, &expt, bits, loc);
|
||||
if (k == STRTOG_NoMemory)
|
||||
return k;
|
||||
switch(k & STRTOG_Retmask) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtopxL.c,v 1.5 2011/03/20 23:15:35 christos Exp $ */
|
||||
/* $NetBSD: strtopxL.c,v 1.6 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -50,11 +50,7 @@ THIS SOFTWARE.
|
|||
#endif
|
||||
|
||||
int
|
||||
#ifdef KR_headers
|
||||
strtopxL(s, sp, V) CONST char *s; char **sp; void *V;
|
||||
#else
|
||||
strtopxL(CONST char *s, char **sp, void *V)
|
||||
#endif
|
||||
strtopxL(CONST char *s, char **sp, void *V, locale_t loc)
|
||||
{
|
||||
static CONST FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
|
||||
ULong bits[2];
|
||||
|
@ -67,7 +63,7 @@ strtopxL(CONST char *s, char **sp, void *V)
|
|||
#define fpi &fpi0
|
||||
#endif
|
||||
|
||||
k = strtodg(s, sp, fpi, &expt, bits);
|
||||
k = strtodg(s, sp, fpi, &expt, bits, loc);
|
||||
if (k == STRTOG_NoMemory)
|
||||
return k;
|
||||
switch(k & STRTOG_Retmask) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: strtord.c,v 1.4 2008/03/21 23:13:48 christos Exp $ */
|
||||
/* $NetBSD: strtord.c,v 1.5 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/****************************************************************
|
||||
|
||||
|
@ -73,11 +73,7 @@ ULtod(ULong *L, ULong *bits, Long expt, int k)
|
|||
}
|
||||
|
||||
int
|
||||
#ifdef KR_headers
|
||||
strtord(s, sp, rounding, d) CONST char *s; char **sp; int rounding; double *d;
|
||||
#else
|
||||
strtord(CONST char *s, char **sp, int rounding, double *d)
|
||||
#endif
|
||||
strtord(CONST char *s, char **sp, int rounding, double *d, locale_t loc)
|
||||
{
|
||||
static CONST FPI fpi0 = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI };
|
||||
CONST FPI *fpi;
|
||||
|
@ -92,7 +88,7 @@ strtord(CONST char *s, char **sp, int rounding, double *d)
|
|||
fpi1.rounding = rounding;
|
||||
fpi = &fpi1;
|
||||
}
|
||||
k = strtodg(s, sp, fpi, &expt, bits);
|
||||
k = strtodg(s, sp, fpi, &expt, bits, loc);
|
||||
if (k == STRTOG_NoMemory)
|
||||
return k;
|
||||
ULtod((/* LINTED */(U*)d)->L, bits, expt, k);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: namespace.h,v 1.158 2013/04/16 21:44:07 joerg Exp $ */
|
||||
/* $NetBSD: namespace.h,v 1.159 2013/04/18 21:54:11 joerg Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
|
||||
|
@ -59,10 +59,13 @@
|
|||
#define strerror_r _strerror_r
|
||||
#define strlcat _strlcat
|
||||
#define strlcpy _strlcpy
|
||||
#define strtod_l _strtod_l
|
||||
#define strtof _strtof
|
||||
#define strtof_l _strtof_l
|
||||
#define strtoimax _strtoimax
|
||||
#define strtoimax_l _strtoimax_l
|
||||
#define strtold _strtold
|
||||
#define strtold_l _strtold_l
|
||||
#define strtoll _strtoll
|
||||
#define strtoll_l _strtoll_l
|
||||
#define strtoull _strtoull
|
||||
|
|
Loading…
Reference in New Issue