c++threads.h instead of copying.
* acinclude.m4 (GLIBCPP_ENABLE_THREADS): Do link here.
+ * config/c_io_libio.cc (__basic_file::_M_open_mode): Consolidate.
+ * bits/basic_file.h: Declare.
+
+ * mkcheck.in (TESTS_FILE): Use -v instead of --version.
+
2000-07-07 brent verner <brent@rcfile.org>
* testsuite/27_io/istream_unformatted.cc (test05): New test.
_IO_default_finish(this, 0);
}
- __basic_file*
- __basic_file::sys_open(int __fd, ios_base::openmode __mode)
- {
- __basic_file* __retval = NULL;
- bool __testi = __mode & ios_base::in;
- bool __testo = __mode & ios_base::out;
-#ifdef O_BINARY
- bool __testb = __mode & ios_base::binary;
-#endif
- int __p_mode = 0;
- int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
-
- if (__testi)
- {
- __p_mode = O_RDONLY;
- __rw_mode = _IO_NO_WRITES;
- }
- if (__testo)
- {
- __p_mode = O_WRONLY | O_TRUNC;
- __rw_mode = _IO_NO_READS;
- }
-#ifdef O_BINARY
- if (__testb)
- __p_mode |= O_BINARY;
-#endif
-
- if (__fd >= 0)
- {
- _fileno = __fd;
- int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
- _flags = (_flags & ~__mask) | (__rw_mode & __mask);
- _IO_link_in((_IO_FILE_plus*) this);
- __retval = this;
- }
- return __retval;
- }
-
- __basic_file*
- __basic_file::open(const char* __name, ios_base::openmode __mode,
- int __prot = 0664)
+ void
+ __basic_file::_M_open_mode(ios_base::openmode __mode, int& __p_mode,
+ int& __rw_mode)
{
- __basic_file* __retval = NULL;
#ifdef O_BINARY
bool __testb = __mode & ios_base::binary;
#endif
bool __testo = __mode & ios_base::out;
bool __testt = __mode & ios_base::trunc;
bool __testa = __mode & ios_base::app;
- int __p_mode = 0;
- int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
if (!__testi && __testo && !__testt && !__testa)
{
if (__testb)
__p_mode |= O_BINARY;
#endif
+ }
+
+ __basic_file*
+ __basic_file::sys_open(int __fd, ios_base::openmode __mode)
+ {
+ __basic_file* __retval = NULL;
+ int __p_mode = 0;
+ int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
+
+ _M_open_mode(__mode, __p_mode, __rw_mode);
+ if (__fd >= 0)
+ {
+ _fileno = __fd;
+ int __mask = _IO_NO_READS + _IO_NO_WRITES + _IO_IS_APPENDING;
+ _flags = (_flags & ~__mask) | (__rw_mode & __mask);
+ _IO_link_in((_IO_FILE_plus*) this);
+ __retval = this;
+ }
+ return __retval;
+ }
+
+ __basic_file*
+ __basic_file::open(const char* __name, ios_base::openmode __mode,
+ int __prot = 0664)
+ {
+ __basic_file* __retval = NULL;
+ int __p_mode = 0;
+ int __rw_mode = _IO_NO_READS + _IO_NO_WRITES;
+
+ _M_open_mode(__mode, __p_mode, __rw_mode);
if (!_IO_file_is_open(this))
{
#if _G_HAVE_IO_FILE_OPEN
#LIB_PATH == where to find the build library binaries.
if [ $WHICH != "1" ]; then
LIB_PATH="$BUILD_DIR/src/.libs"
- CXX="../../gcc/g++ -B../../gcc/"
+ CXX="../../gcc/g++"
+ CXX_BASE="-B../../gcc/"
elif [ $WHICH -eq 1 ]; then
LIB_PATH="$PREFIX_DIR/lib"
CXX="$PREFIX_DIR/bin/g++"
+ CXX_BASE=""
fi
# gcc compiler flags
#CXX_FLAG="-fsquangle -fhonor-std -fnew-exceptions -g -O2 -DDEBUG_ASSERT "
#CXX_FLAG="-g -O2 -DDEBUG_ASSERT "
-CXX_FLAG="-g -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
+CXX_FLAG="-g $CXX_BASE -DDEBUG_ASSERT @SECTION_FLAGS@ @SECTION_LDFLAGS@"
# a specific flag(s) to force the use of shared libraries, if any
SH_FLAG=""
# Emit useful info about compiler and platform
echo "host: $(uname -mrsv)" >> $RESULTS_FILE
-echo "compiler: $($CXX --version)" >> $RESULTS_FILE
+echo "compiler: $($CXX -v 2>&1 | tail -1)" >> $RESULTS_FILE
echo "compiler flags: $CXX_FLAG" >> $RESULTS_FILE
echo "date: $(date +%Y%m%d)" >> $RESULTS_FILE
echo "" >> $RESULTS_FILE