From: ljrittle Date: Thu, 31 Jan 2002 00:47:05 +0000 (+0000) Subject: * config/locale/c_locale_generic.cc: Check errno for ERANGE X-Git-Tag: upstream/4.9.2~89025 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ced3608f16239aadc99ce8db7742316359a2672;p=platform%2Fupstream%2Flinaro-gcc.git * config/locale/c_locale_generic.cc: Check errno for ERANGE instead of non-zero to aid portability. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49350 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index cb3f92b..56bca71 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2002-01-30 Loren Rittle + + * config/locale/c_locale_generic.cc: Check errno for ERANGE + instead of non-zero to aid portability. + 2002-01-30 Peter Schmid * docs/html/22_locale/messages.html: Fix example code. diff --git a/libstdc++-v3/config/locale/c_locale_generic.cc b/libstdc++-v3/config/locale/c_locale_generic.cc index 4a8770e..0d601ae 100644 --- a/libstdc++-v3/config/locale/c_locale_generic.cc +++ b/libstdc++-v3/config/locale/c_locale_generic.cc @@ -48,7 +48,7 @@ namespace std char* __sanity; errno = 0; long __l = strtol(__s, &__sanity, __base); - if (__sanity != __s && *__sanity == '\0' && errno == 0) + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE) __v = __l; else __err |= ios_base::failbit; @@ -65,7 +65,7 @@ namespace std char* __sanity; errno = 0; unsigned long __ul = strtoul(__s, &__sanity, __base); - if (__sanity != __s && *__sanity == '\0' && errno == 0) + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE) __v = __ul; else __err |= ios_base::failbit; @@ -83,7 +83,7 @@ namespace std char* __sanity; errno = 0; long long __ll = strtoll(__s, &__sanity, __base); - if (__sanity != __s && *__sanity == '\0' && errno == 0) + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE) __v = __ll; else __err |= ios_base::failbit; @@ -100,7 +100,7 @@ namespace std char* __sanity; errno = 0; unsigned long long __ull = strtoull(__s, &__sanity, __base); - if (__sanity != __s && *__sanity == '\0' && errno == 0) + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE) __v = __ull; else __err |= ios_base::failbit; @@ -124,7 +124,7 @@ namespace std #else float __f = static_cast(strtod(__s, &__sanity)); #endif - if (__sanity != __s && *__sanity == '\0' && errno == 0) + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE) __v = __f; else __err |= ios_base::failbit; @@ -144,7 +144,7 @@ namespace std char* __sanity; errno = 0; double __d = strtod(__s, &__sanity); - if (__sanity != __s && *__sanity == '\0' && errno == 0) + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE) __v = __d; else __err |= ios_base::failbit; @@ -165,7 +165,7 @@ namespace std char* __sanity; errno = 0; long double __ld = strtold(__s, &__sanity); - if (__sanity != __s && *__sanity == '\0' && errno == 0) + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE) __v = __ld; #else typedef char_traits::int_type int_type;