This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[v3] gnu fixups for errno



Moves over Loren's fixes for this from the generic code.

tested x86/linux

2002-01-30  Benjamin Kosnik  <bkoz@redhat.com>

	* config/locale/c_locale_gnu.cc: Same errno fixes as generic.

Index: config/locale/c_locale_gnu.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/locale/c_locale_gnu.cc,v
retrieving revision 1.7
diff -c -p -r1.7 c_locale_gnu.cc
*** c_locale_gnu.cc	2002/01/22 23:08:56	1.7
--- c_locale_gnu.cc	2002/01/31 01:00:11
*************** namespace std 
*** 49,55 ****
  	char* __sanity;
  	errno = 0;
  	long __l = __strtol_l(__s, &__sanity, __base, __cloc);
! 	if (__sanity != __s && *__sanity == '\0' && errno == 0)
  	  __v = __l;
  	else
  	  __err |= ios_base::failbit;
--- 49,55 ----
  	char* __sanity;
  	errno = 0;
  	long __l = __strtol_l(__s, &__sanity, __base, __cloc);
! 	if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
  	  __v = __l;
  	else
  	  __err |= ios_base::failbit;
*************** namespace std 
*** 67,73 ****
  	  char* __sanity;
  	  errno = 0;
  	  unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno == 0)
  	    __v = __ul;
  	  else
  	    __err |= ios_base::failbit;
--- 67,73 ----
  	  char* __sanity;
  	  errno = 0;
  	  unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
  	    __v = __ul;
  	  else
  	    __err |= ios_base::failbit;
*************** namespace std 
*** 85,91 ****
  	  char* __sanity;
  	  errno = 0;
  	  long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno == 0)
  	    __v = __ll;
  	  else
  	    __err |= ios_base::failbit;
--- 85,91 ----
  	  char* __sanity;
  	  errno = 0;
  	  long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
  	    __v = __ll;
  	  else
  	    __err |= ios_base::failbit;
*************** namespace std 
*** 104,110 ****
  	  errno = 0;
  	  unsigned long long __ull = __strtoull_l(__s, &__sanity, __base, 
  						  __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno == 0)
  	    __v = __ull;
  	  else
  	    __err |= ios_base::failbit;
--- 104,110 ----
  	  errno = 0;
  	  unsigned long long __ull = __strtoull_l(__s, &__sanity, __base, 
  						  __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
  	    __v = __ull;
  	  else
  	    __err |= ios_base::failbit;
*************** namespace std 
*** 122,128 ****
  	  char* __sanity;
  	  errno = 0;
  	  float __f = __strtof_l(__s, &__sanity, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno == 0)
  	    __v = __f;
  	  else
  	    __err |= ios_base::failbit;
--- 122,128 ----
  	  char* __sanity;
  	  errno = 0;
  	  float __f = __strtof_l(__s, &__sanity, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
  	    __v = __f;
  	  else
  	    __err |= ios_base::failbit;
*************** namespace std 
*** 139,145 ****
  	  char* __sanity;
  	  errno = 0;
  	  double __d = __strtod_l(__s, &__sanity, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno == 0)
  	    __v = __d;
  	  else
  	    __err |= ios_base::failbit;
--- 139,145 ----
  	  char* __sanity;
  	  errno = 0;
  	  double __d = __strtod_l(__s, &__sanity, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
  	    __v = __d;
  	  else
  	    __err |= ios_base::failbit;
*************** namespace std 
*** 156,162 ****
  	  char* __sanity;
  	  errno = 0;
  	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno == 0)
  	    __v = __ld;
  	  else
  	    __err |= ios_base::failbit;
--- 156,162 ----
  	  char* __sanity;
  	  errno = 0;
  	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
!           if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
  	    __v = __ld;
  	  else
  	    __err |= ios_base::failbit;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]