mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-25 03:44:04 +08:00
c_locale_gnu.cc: Same errno fixes as generic.
2002-01-30 Benjamin Kosnik <bkoz@redhat.com> * config/locale/c_locale_gnu.cc: Same errno fixes as generic. From-SVN: r49354
This commit is contained in:
parent
46ab74b1fd
commit
2a4e640755
@ -1,3 +1,7 @@
|
||||
2002-01-30 Benjamin Kosnik <bkoz@redhat.com>
|
||||
|
||||
* config/locale/c_locale_gnu.cc: Same errno fixes as generic.
|
||||
|
||||
2002-01-30 Loren Rittle <ljrittle@acm.org>
|
||||
|
||||
* config/locale/c_locale_generic.cc: Check errno for ERANGE
|
||||
|
@ -49,7 +49,7 @@ namespace std
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
long __l = __strtol_l(__s, &__sanity, __base, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno == 0)
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
__v = __l;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -67,7 +67,7 @@ namespace std
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno == 0)
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
__v = __ul;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -85,7 +85,7 @@ namespace std
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno == 0)
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
__v = __ll;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -104,7 +104,7 @@ namespace std
|
||||
errno = 0;
|
||||
unsigned long long __ull = __strtoull_l(__s, &__sanity, __base,
|
||||
__cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno == 0)
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
__v = __ull;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -122,7 +122,7 @@ namespace std
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
float __f = __strtof_l(__s, &__sanity, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno == 0)
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
__v = __f;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -139,7 +139,7 @@ namespace std
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
double __d = __strtod_l(__s, &__sanity, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno == 0)
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
__v = __d;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
@ -156,7 +156,7 @@ namespace std
|
||||
char* __sanity;
|
||||
errno = 0;
|
||||
long double __ld = __strtold_l(__s, &__sanity, __cloc);
|
||||
if (__sanity != __s && *__sanity == '\0' && errno == 0)
|
||||
if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
|
||||
__v = __ld;
|
||||
else
|
||||
__err |= ios_base::failbit;
|
||||
|
Loading…
Reference in New Issue
Block a user