This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: CVS problems
> 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.
This is alright. You had a typo in the basic_string patch, so I attach
these patches again.
> Just use the #if 0'd code for this one, it's better anyway because it
> uses the cached fctype member.
Unfortunately, I then get
../../bits/std_streambuf.h:77: `const class std::ctype<__wchar_t> * std::basic_streambuf<__wchar_t,std::char_traits<__wchar_t> >::_M_fctype' is protected
../../bits/std_istream.h:641: within this context
with the current egcs (egcs-2.93.18).
> I would rather use
>
> memcpy
>
> istead of
>
> ::memcpy
That works just fine, see my patch below.
> This is fine. I am wondering what comiler/flags you are using to
> notice these problems--can you post that info please (along with a
> ChangeLog entry?)
I use egcs-2.93.18 (somewhat modified, but that shouldn't be
relevant), configured with CXX=".../g++ -fhonor-std", hence the std::
warnings.
Regards,
Martin
1999-04-16 Martin von Löwis <loewis@informatik.hu-berlin.de>
* src/complex.cc (FCT): Qualify all functions with global namespace.
* src/locale.cc: Don't qualify memcpy and setlocale.
* src/stdexcept.cc (__out_of_range): Qualify out_of_range with std::.
(__length_error): Likewise, for length_error.
* src/stlinst.cc: Qualify instantiations with std::.
Index: bits/std_cmath.h
===================================================================
RCS file: /cvs/libstdc++/libstdc++/bits/std_cmath.h,v
retrieving revision 1.4
diff -u -r1.4 std_cmath.h
--- std_cmath.h 1999/04/14 16:39:36 1.4
+++ std_cmath.h 1999/04/16 06:49:00
@@ -36,12 +36,12 @@
#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: src/basic_file.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/basic_file.cc,v
retrieving revision 1.12
diff -u -r1.12 basic_file.cc
--- basic_file.cc 1999/04/13 12:39:44 1.12
+++ basic_file.cc 1999/04/16 06:49:01
@@ -140,7 +140,9 @@
if ( !_IO_file_is_open(this))
{
#if _G_HAVE_IO_FILE_OPEN
- __retval = _IO_file_open(this, __name, __p_mode, __prot, __rw_mode, 0);
+ __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: src/complex.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/complex.cc,v
retrieving revision 1.8
diff -u -r1.8 complex.cc
--- complex.cc 1998/12/31 23:15:41 1.8
+++ complex.cc 1999/04/16 06:49:01
@@ -36,7 +36,7 @@
#ifndef FLT
# define FLT double
-# define FCT(name) name
+# define FCT(name) ::name
#endif
namespace std
Index: src/locale.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/locale.cc,v
retrieving revision 1.21
diff -u -r1.21 locale.cc
--- locale.cc 1999/04/13 14:09:35 1.21
+++ locale.cc 1999/04/16 06:49:02
@@ -300,7 +300,7 @@
_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 @@
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 @@
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;
}
Index: src/stdexcept.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/stdexcept.cc,v
retrieving revision 1.9
diff -u -r1.9 stdexcept.cc
--- stdexcept.cc 1999/03/12 02:49:18 1.9
+++ stdexcept.cc 1999/04/16 06:49:02
@@ -43,13 +43,13 @@
void
__out_of_range (const char *str)
{
- throw out_of_range (str);
+ throw std::out_of_range (str);
}
void __length_error (const char *str)
{
- throw length_error (str);
+ throw std::length_error (str);
}
#if 0
Index: src/stlinst.cc
===================================================================
RCS file: /cvs/libstdc++/libstdc++/src/stlinst.cc,v
retrieving revision 1.2
diff -u -r1.2 stlinst.cc
--- stlinst.cc 1999/02/10 01:00:03 1.2
+++ stlinst.cc 1999/04/16 06:49:02
@@ -2,6 +2,8 @@
#include <bits/stl_config.h>
#include <bits/stl_alloc.h>
-template class __default_alloc_template<__NODE_ALLOCATOR_THREADS, 0>;
+template class std::__malloc_alloc_template<0>;
-template class __malloc_alloc_template<0>;
+template class std::__default_alloc_template<__NODE_ALLOCATOR_THREADS, 0>;
+
+