This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project. See the libstdc++ home page for more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
When compiling libstdc++ from CVS I had a number of problems. These are the work-arounds I made, where I'm not sure what the right solution is. In std_cmath.h, ldiv_t was not defined. I included-next stdlib.h Index: bits/std_cmath.h =================================================================== RCS file: /cvs/libstdc++/libstdc++/bits/std_cmath.h,v retrieving revision 1.4 diff -u -p -r1.4 std_cmath.h --- std_cmath.h 1999/04/14 16:39:36 1.4 +++ std_cmath.h 1999/04/15 07:25:30 @@ -36,6 +36,7 @@ #ifndef _CPP_CMATH #define _CPP_CMATH 1 # include_next <math.h> +# include_next <stdlib.h> namespace std { 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. Index: bits/std_istream.h =================================================================== RCS file: /cvs/libstdc++/libstdc++/bits/std_istream.h,v retrieving revision 1.20 diff -u -p -r1.20 std_istream.h --- std_istream.h 1999/03/30 19:11:13 1.20 +++ std_istream.h 1999/04/15 07:25:31 @@ -638,7 +638,7 @@ namespace std { __streambuf_type* __streambuf = __is.rdbuf(); __int_type __c = __streambuf->sgetc(); __int_type __eof = traits_type::eof(); - while (__c != _Traits::eof () && isspace(__c)) + while (__c != _Traits::eof () && /*XXX std*/::isspace(__c)) #if 0 while (__c != __eof && __streambuf->_M_fctype.is(ctype_base::space, __c)) 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. Index: src/basic_file.cc =================================================================== RCS file: /cvs/libstdc++/libstdc++/src/basic_file.cc,v retrieving revision 1.12 diff -u -p -r1.12 basic_file.cc --- basic_file.cc 1999/04/13 12:39:44 1.12 +++ basic_file.cc 1999/04/15 07:25:42 @@ -140,7 +140,7 @@ namespace std { if ( !_IO_file_is_open(this)) { #if _G_HAVE_IO_FILE_OPEN - __retval = _IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0); + __retval = static_cast<__basic_file*>(_IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0)); #else int __i = ::open(__name, __p_mode, __prot); if (__i >= 0) In complex, various math functions are not found when std:: is active. Again, I called the globals. Index: src/complex.cc =================================================================== RCS file: /cvs/libstdc++/libstdc++/src/complex.cc,v retrieving revision 1.8 diff -u -p -r1.8 complex.cc --- complex.cc 1998/12/31 23:15:41 1.8 +++ complex.cc 1999/04/15 07:25:42 @@ -36,7 +36,7 @@ #ifndef FLT # define FLT double -# define FCT(name) name +# define FCT(name) ::name #endif namespace std The same happens with setlocale and memcopy. Index: src/locale.cc =================================================================== RCS file: /cvs/libstdc++/libstdc++/src/locale.cc,v retrieving revision 1.21 diff -u -p -r1.21 locale.cc --- locale.cc 1999/04/13 14:09:35 1.21 +++ locale.cc 1999/04/15 07:25:43 @@ -300,7 +300,7 @@ namespace std { _S_global->_M_remove_reference(); _S_global = __other._M_impl; if (_S_global->_M_has_name) - std::setlocale(LC_ALL, __other.name().c_str()); + ::setlocale(LC_ALL, __other.name().c_str()); return __keep; } @@ -515,7 +515,7 @@ namespace std { ctype<char>:: do_widen(const char* __low, const char* __high, char* __dest) const { - std::memcpy(__dest, __low, __high - __low); + ::memcpy(__dest, __low, __high - __low); return __high; } @@ -530,7 +530,7 @@ namespace std { do_narrow(const char* __low, const char* __high, char __dfault, char* __dest) const { - std::memcpy(__dest, __low, __high - __low); + ::memcpy(__dest, __low, __high - __low); return __high; }