This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


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

re: CVS problems


Matin: 

I need a ChangeLog on this one as well please. I've made one up--see
the tail bits of this email, along with some changes of mine. Let me
know if this is acceptable.

> In std_cmath.h, ldiv_t was not defined. I included-next stdlib.h

Looks good.
     
> In std_istream.h, no matching isspace was found when std:: is a real
> namespace. I thought that the isspace definition was supposed to get
> into std::, but this somehow didn't work. As a work-around, I invoked
> the global isspace.
 
Just use the #if 0'd code for this one, it's better anyway because it
uses the cached fctype member.

>When _G_HAVE_IO_FILE_OPEN is supported, invoking _IO_file_open is the
>wrong thing, as it will return an _IO_FILE*. I downcasted it to
>basic_file, but I haven't checked whether this actually works.

Good point. I've changed your patch a bit, and tested the returned
value from _IO_file_open, and then returned this.

> In complex, various math functions are not found when std:: is active.
> Again, I called the globals.

> The same happens with setlocale and memcopy.

Yeah. Ugh. If you look at std_cstring.h you can see that this stuff is
not in std:: by default. 

Nathan did shadow this stuff correctly though--are you using the
mkcshadow stuff? Also, what compile-time flags are you using? If we really
need to use the global namespace, I would rather use 

memcpy

istead of

::memcpy


Thanks,
Benjamin



1999-04-15  Martin v. Loewis  <martin@mira.isdn.cs.tu-berlin.de>

	* src/basic_file.cc (__basic_file::open): Fix thinko in
	_G_HAVE_IO_FILE_OPEN bits.
	* bits/std_istream.h (sentry::sentry(istream, bool)): Fix isspace bug.
	* bits/std_cmath.h: Add stdlib.h include for ldiv_t.

Index: src/basic_file.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/basic_file.cc,v
retrieving revision 1.12
diff -c -p -r1.12 basic_file.cc
*** basic_file.cc	1999/04/13 12:39:44	1.12
--- basic_file.cc	1999/04/15 21:29:58
*************** namespace std {
*** 140,146 ****
      if ( !_IO_file_is_open(this))
        {
  #if _G_HAVE_IO_FILE_OPEN
! 	__retval = _IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0);
  #else
  	int __i = ::open(__name, __p_mode, __prot);
  	if (__i >= 0)
--- 140,148 ----
      if ( !_IO_file_is_open(this))
        {
  #if _G_HAVE_IO_FILE_OPEN
! 	__c_file_type __f;
! 	__f = _IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0);
! 	__retval = __f ? this: NULL;
  #else
  	int __i = ::open(__name, __p_mode, __prot);
  	if (__i >= 0)
Index: bits/std_istream.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/std_istream.h,v
retrieving revision 1.20
diff -c -p -r1.20 std_istream.h
*** std_istream.h	1999/03/30 19:11:13	1.20
--- std_istream.h	1999/04/15 21:30:14
*************** namespace std {
*** 638,654 ****
  	  __streambuf_type* __streambuf = __is.rdbuf();
  	  __int_type __c = __streambuf->sgetc();
  	  __int_type __eof = traits_type::eof();
- 	  while (__c != _Traits::eof () && isspace(__c))
- #if 0
  	  while (__c != __eof 
  		 && __streambuf->_M_fctype.is(ctype_base::space, __c))
- #endif
  	    __c = __is.rdbuf()->snextc();
  	}
        
        _M_ok = true;
      }
- 
  
    // 27.6.1.2.3 Character extraction templates:
    template<typename _CharT, typename _Traits>
--- 638,650 ----
Index: bits/std_cmath.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/std_cmath.h,v
retrieving revision 1.4
diff -c -p -r1.4 std_cmath.h
*** std_cmath.h	1999/04/14 16:39:36	1.4
--- std_cmath.h	1999/04/15 21:30:24
***************
*** 36,47 ****
  #ifndef _CPP_CMATH
  #define _CPP_CMATH 1
  # include_next <math.h>
  
  namespace std {
      
      inline long abs(long l) { return ::labs(l); }
      inline ldiv_t div(long a, long b) { return ldiv(a, b); }
- 
      inline double abs(double x) { return fabs(x); }
      
  } // std
--- 36,47 ----
  #ifndef _CPP_CMATH
  #define _CPP_CMATH 1
  # include_next <math.h>
+ # include_next <stdlib.h>
  
  namespace std {
      
      inline long abs(long l) { return ::labs(l); }
      inline ldiv_t div(long a, long b) { return ldiv(a, b); }
      inline double abs(double x) { return fabs(x); }
      
  } // std

	








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