Commit 3d05b345 by Paolo Carlini Committed by Paolo Carlini

re PR libstdc++/8610 (large file support in libstdc++-v3 (std::streamoff type …

re PR libstdc++/8610 (large file support in libstdc++-v3 (std::streamoff type  is 32-bit  in GCC 3.2 whereas it was 64-bit in GCC 2.96))

2003-10-22  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/8610
	* acinclude.m4 (GLIBCXX_CHECK_INT64_T): New macro,
	checking for the availability of int64_t.
	(GLIBCXX_CHECK_LFS): New macro, checking for LFS support.
	* configure.ac: Call here.
	* acconfig.h: Add undef for the corresponding symbols.
	* config/io/basic_file_stdio.cc	(__basic_file<char>::open):
	Depending on _GLIBCXX_USE_LFS, call fopen64 or fopen.
	(__basic_file<char>::seekoff): Likewise, call lseek64 when
	available, otherwise lseek, checking the __off parameter.
	* include/bits/postypes.h: Typedef __streamoff_base_type
	to int64_t if available, otherwise long long.
	* aclocal.m4: Regenerate.
	* config.h.in: Likewise.
	* configure: Likewise.

	* acinclude.m4 (GLIBCXX_CHECK_POLL, GLIBCXX_CHECK_WRITEV):
	Use AC_TRY_LINK instead of AC_TRY_COMPILE.

From-SVN: r72806
parent 36ae3d8e
2003-10-22 Paolo Carlini <pcarlini@suse.de> 2003-10-22 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/8610
* acinclude.m4 (GLIBCXX_CHECK_INT64_T): New macro,
checking for the availability of int64_t.
(GLIBCXX_CHECK_LFS): New macro, checking for LFS support.
* configure.ac: Call here.
* acconfig.h: Add undef for the corresponding symbols.
* config/io/basic_file_stdio.cc (__basic_file<char>::open):
Depending on _GLIBCXX_USE_LFS, call fopen64 or fopen.
(__basic_file<char>::seekoff): Likewise, call lseek64 when
available, otherwise lseek, checking the __off parameter.
* include/bits/postypes.h: Typedef __streamoff_base_type
to int64_t if available, otherwise long long.
* aclocal.m4: Regenerate.
* config.h.in: Likewise.
* configure: Likewise.
* acinclude.m4 (GLIBCXX_CHECK_POLL, GLIBCXX_CHECK_WRITEV):
Use AC_TRY_LINK instead of AC_TRY_COMPILE.
2003-10-22 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/12657 PR libstdc++/12657
* include/bits/basic_ios.tcc (copyfmt(const basic_ios&)): * include/bits/basic_ios.tcc (copyfmt(const basic_ios&)):
Implement resolution of DR 292 (WP). Implement resolution of DR 292 (WP).
......
...@@ -153,6 +153,12 @@ ...@@ -153,6 +153,12 @@
// Define if writev is available in <sys/uio.h>. // Define if writev is available in <sys/uio.h>.
#undef HAVE_WRITEV #undef HAVE_WRITEV
// Define if int64_t is available in <stdint.h>.
#undef HAVE_INT64_T
// Define if LFS support is available.
#undef _GLIBCXX_USE_LFS
// Define if LC_MESSAGES is available in <locale.h>. // Define if LC_MESSAGES is available in <locale.h>.
#undef HAVE_LC_MESSAGES #undef HAVE_LC_MESSAGES
......
...@@ -540,7 +540,7 @@ dnl Check whether poll is available in <poll.h>, and define HAVE_POLL. ...@@ -540,7 +540,7 @@ dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
dnl dnl
AC_DEFUN(GLIBCXX_CHECK_POLL, [ AC_DEFUN(GLIBCXX_CHECK_POLL, [
AC_CACHE_VAL(glibcxx_cv_POLL, [ AC_CACHE_VAL(glibcxx_cv_POLL, [
AC_TRY_COMPILE( AC_TRY_LINK(
[#include <poll.h>], [#include <poll.h>],
[struct pollfd pfd[1]; [struct pollfd pfd[1];
pfd[0].events = POLLIN; pfd[0].events = POLLIN;
...@@ -559,7 +559,7 @@ dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV. ...@@ -559,7 +559,7 @@ dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
dnl dnl
AC_DEFUN(GLIBCXX_CHECK_WRITEV, [ AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
AC_CACHE_VAL(glibcxx_cv_WRITEV, [ AC_CACHE_VAL(glibcxx_cv_WRITEV, [
AC_TRY_COMPILE( AC_TRY_LINK(
[#include <sys/uio.h>], [#include <sys/uio.h>],
[struct iovec iov[2]; [struct iovec iov[2];
writev(0, iov, 0);], writev(0, iov, 0);],
...@@ -573,6 +573,41 @@ AC_DEFUN(GLIBCXX_CHECK_WRITEV, [ ...@@ -573,6 +573,41 @@ AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
dnl dnl
dnl Check whether int64_t is available in <stdint.h>, and define HAVE_INT64_T.
dnl
AC_DEFUN(GLIBCXX_CHECK_INT64_T, [
AC_CACHE_VAL(glibcxx_cv_INT64_T, [
AC_TRY_COMPILE(
[#include <stdint.h>],
[int64_t var;],
[glibcxx_cv_INT64_T=yes],
[glibcxx_cv_INT64_T=no])
])
if test $glibcxx_cv_INT64_T = yes; then
AC_DEFINE(HAVE_INT64_T)
fi
])
dnl
dnl Check whether LFS support is available.
dnl
AC_DEFUN(GLIBCXX_CHECK_LFS, [
AC_CACHE_VAL(glibcxx_cv_LFS, [
AC_TRY_LINK(
[#include <unistd.h>],
[fopen64("t", "w");
lseek64(1, 0, SEEK_CUR);],
[glibcxx_cv_LFS=yes],
[glibcxx_cv_LFS=no])
])
if test $glibcxx_cv_LFS = yes; then
AC_DEFINE(_GLIBCXX_USE_LFS)
fi
])
dnl
dnl Does any necessary configuration of the testsuite directory. Generates dnl Does any necessary configuration of the testsuite directory. Generates
dnl the testsuite_hooks.h header. dnl the testsuite_hooks.h header.
dnl dnl
......
...@@ -553,7 +553,7 @@ dnl Check whether poll is available in <poll.h>, and define HAVE_POLL. ...@@ -553,7 +553,7 @@ dnl Check whether poll is available in <poll.h>, and define HAVE_POLL.
dnl dnl
AC_DEFUN(GLIBCXX_CHECK_POLL, [ AC_DEFUN(GLIBCXX_CHECK_POLL, [
AC_CACHE_VAL(glibcxx_cv_POLL, [ AC_CACHE_VAL(glibcxx_cv_POLL, [
AC_TRY_COMPILE( AC_TRY_LINK(
[#include <poll.h>], [#include <poll.h>],
[struct pollfd pfd[1]; [struct pollfd pfd[1];
pfd[0].events = POLLIN; pfd[0].events = POLLIN;
...@@ -572,7 +572,7 @@ dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV. ...@@ -572,7 +572,7 @@ dnl Check whether writev is available in <sys/uio.h>, and define HAVE_WRITEV.
dnl dnl
AC_DEFUN(GLIBCXX_CHECK_WRITEV, [ AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
AC_CACHE_VAL(glibcxx_cv_WRITEV, [ AC_CACHE_VAL(glibcxx_cv_WRITEV, [
AC_TRY_COMPILE( AC_TRY_LINK(
[#include <sys/uio.h>], [#include <sys/uio.h>],
[struct iovec iov[2]; [struct iovec iov[2];
writev(0, iov, 0);], writev(0, iov, 0);],
...@@ -586,6 +586,41 @@ AC_DEFUN(GLIBCXX_CHECK_WRITEV, [ ...@@ -586,6 +586,41 @@ AC_DEFUN(GLIBCXX_CHECK_WRITEV, [
dnl dnl
dnl Check whether int64_t is available in <stdint.h>, and define HAVE_INT64_T.
dnl
AC_DEFUN(GLIBCXX_CHECK_INT64_T, [
AC_CACHE_VAL(glibcxx_cv_INT64_T, [
AC_TRY_COMPILE(
[#include <stdint.h>],
[int64_t var;],
[glibcxx_cv_INT64_T=yes],
[glibcxx_cv_INT64_T=no])
])
if test $glibcxx_cv_INT64_T = yes; then
AC_DEFINE(HAVE_INT64_T)
fi
])
dnl
dnl Check whether LFS support is available.
dnl
AC_DEFUN(GLIBCXX_CHECK_LFS, [
AC_CACHE_VAL(glibcxx_cv_LFS, [
AC_TRY_LINK(
[#include <unistd.h>],
[fopen64("t", "w");
lseek64(1, 0, SEEK_CUR);],
[glibcxx_cv_LFS=yes],
[glibcxx_cv_LFS=no])
])
if test $glibcxx_cv_LFS = yes; then
AC_DEFINE(_GLIBCXX_USE_LFS)
fi
])
dnl
dnl Does any necessary configuration of the testsuite directory. Generates dnl Does any necessary configuration of the testsuite directory. Generates
dnl the testsuite_hooks.h header. dnl the testsuite_hooks.h header.
dnl dnl
......
...@@ -154,6 +154,12 @@ ...@@ -154,6 +154,12 @@
// Define if writev is available in <sys/uio.h>. // Define if writev is available in <sys/uio.h>.
#undef HAVE_WRITEV #undef HAVE_WRITEV
// Define if int64_t is available in <stdint.h>.
#undef HAVE_INT64_T
// Define if LFS support is available.
#undef _GLIBCXX_USE_LFS
// Define if LC_MESSAGES is available in <locale.h>. // Define if LC_MESSAGES is available in <locale.h>.
#undef HAVE_LC_MESSAGES #undef HAVE_LC_MESSAGES
......
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
# endif # endif
#endif #endif
#include <limits> // For <off_t>::max() and min()
namespace std namespace std
{ {
// Definitions for __basic_file<char>. // Definitions for __basic_file<char>.
...@@ -173,7 +175,11 @@ namespace std ...@@ -173,7 +175,11 @@ namespace std
if (!this->is_open()) if (!this->is_open())
{ {
#ifdef _GLIBCXX_USE_LFS
if ((_M_cfile = fopen64(__name, __c_mode)))
#else
if ((_M_cfile = fopen(__name, __c_mode))) if ((_M_cfile = fopen(__name, __c_mode)))
#endif
{ {
_M_cfile_created = true; _M_cfile_created = true;
__ret = this; __ret = this;
...@@ -262,7 +268,16 @@ namespace std ...@@ -262,7 +268,16 @@ namespace std
streamoff streamoff
__basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way) __basic_file<char>::seekoff(streamoff __off, ios_base::seekdir __way)
{ return lseek(this->fd(), __off, __way); } {
#ifdef _GLIBCXX_USE_LFS
return lseek64(this->fd(), __off, __way);
#else
if (__off > std::numeric_limits<off_t>::max()
|| __off < std::numeric_limits<off_t>::min())
return -1L;
return lseek(this->fd(), __off, __way);
#endif
}
int int
__basic_file<char>::sync() __basic_file<char>::sync()
......
...@@ -971,7 +971,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` ...@@ -971,7 +971,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
else else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi fi
cd "$ac_popdir" cd $ac_popdir
done done
fi fi
...@@ -1170,7 +1170,7 @@ _ASBOX ...@@ -1170,7 +1170,7 @@ _ASBOX
echo "$as_me: caught signal $ac_signal" echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status" echo "$as_me: exit $exit_status"
} >&5 } >&5
rm -f core *.core && rm -f core core.* *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files && rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status exit $exit_status
' 0 ' 0
...@@ -2800,7 +2800,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ...@@ -2800,7 +2800,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then (exit $ac_status); }; }; then
for ac_declaration in \ for ac_declaration in \
'' \ ''\
'#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int) throw ();' \
...@@ -2814,8 +2815,8 @@ _ACEOF ...@@ -2814,8 +2815,8 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */ /* end confdefs.h. */
$ac_declaration
#include <stdlib.h> #include <stdlib.h>
$ac_declaration
int int
main () main ()
{ {
...@@ -3125,7 +3126,8 @@ else ...@@ -3125,7 +3126,8 @@ else
fi fi
fi fi
for ac_declaration in \ for ac_declaration in \
'' \ ''\
'#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int) throw ();' \
...@@ -3139,8 +3141,8 @@ _ACEOF ...@@ -3139,8 +3141,8 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */ /* end confdefs.h. */
$ac_declaration
#include <stdlib.h> #include <stdlib.h>
$ac_declaration
int int
main () main ()
{ {
...@@ -4265,7 +4267,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" ...@@ -4265,7 +4267,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in case $host in
*-*-irix6*) *-*-irix6*)
# Find out which ABI we are using. # Find out which ABI we are using.
echo '#line 4268 "configure"' > conftest.$ac_ext echo '#line 4270 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_compile) 2>&5
ac_status=$? ac_status=$?
...@@ -4869,7 +4871,7 @@ fi; ...@@ -4869,7 +4871,7 @@ fi;
# #
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 4872 "configure" #line 4874 "configure"
struct S { ~S(); }; struct S { ~S(); };
void bar(); void bar();
void foo() void foo()
...@@ -5457,7 +5459,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -5457,7 +5459,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_cv_header_stdc=no ac_cv_header_stdc=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
fi fi
fi fi
...@@ -5648,7 +5650,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -5648,7 +5650,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
enable_clocale_flag=generic enable_clocale_flag=generic
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
fi fi
...@@ -7804,7 +7806,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -7804,7 +7806,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_sectionLDflags=no ac_sectionLDflags=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
if test "$ac_test_CFLAGS" = set; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
...@@ -26443,7 +26445,12 @@ done ...@@ -26443,7 +26445,12 @@ done
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF if test x$gcc_no_link = xyes; then
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
{ (exit 1); exit 1; }; }
fi
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure" #line $LINENO "configure"
/* confdefs.h. */ /* confdefs.h. */
_ACEOF _ACEOF
...@@ -26461,13 +26468,13 @@ struct pollfd pfd[1]; ...@@ -26461,13 +26468,13 @@ struct pollfd pfd[1];
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest.$ac_objext rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_link) 2>&5
ac_status=$? ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && (exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext' { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5 (eval $ac_try) 2>&5
ac_status=$? ac_status=$?
...@@ -26480,7 +26487,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -26480,7 +26487,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
glibcxx_cv_POLL=no glibcxx_cv_POLL=no
fi fi
rm -f conftest.$ac_objext conftest.$ac_ext rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi fi
...@@ -26753,7 +26760,12 @@ done ...@@ -26753,7 +26760,12 @@ done
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF if test x$gcc_no_link = xyes; then
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
{ (exit 1); exit 1; }; }
fi
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure" #line $LINENO "configure"
/* confdefs.h. */ /* confdefs.h. */
_ACEOF _ACEOF
...@@ -26770,6 +26782,59 @@ struct iovec iov[2]; ...@@ -26770,6 +26782,59 @@ struct iovec iov[2];
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
glibcxx_cv_WRITEV=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
glibcxx_cv_WRITEV=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
if test $glibcxx_cv_WRITEV = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_WRITEV 1
_ACEOF
fi
# For the __streamoff_base_type typedef.
if test "${glibcxx_cv_INT64_T+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <stdint.h>
int
main ()
{
int64_t var;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_compile) 2>&5
...@@ -26782,20 +26847,79 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ...@@ -26782,20 +26847,79 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$? ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then (exit $ac_status); }; }; then
glibcxx_cv_WRITEV=yes glibcxx_cv_INT64_T=yes
else else
echo "$as_me: failed program was:" >&5 echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
glibcxx_cv_WRITEV=no glibcxx_cv_INT64_T=no
fi fi
rm -f conftest.$ac_objext conftest.$ac_ext rm -f conftest.$ac_objext conftest.$ac_ext
fi fi
if test $glibcxx_cv_WRITEV = yes; then if test $glibcxx_cv_INT64_T = yes; then
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
#define HAVE_WRITEV 1 #define HAVE_INT64_T 1
_ACEOF
fi
# For LFS support.
if test "${glibcxx_cv_LFS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test x$gcc_no_link = xyes; then
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
{ (exit 1); exit 1; }; }
fi
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <unistd.h>
int
main ()
{
fopen64("t", "w");
lseek64(1, 0, SEEK_CUR);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
glibcxx_cv_LFS=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
glibcxx_cv_LFS=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
if test $glibcxx_cv_LFS = yes; then
cat >>confdefs.h <<\_ACEOF
#define _GLIBCXX_USE_LFS 1
_ACEOF _ACEOF
fi fi
...@@ -27437,7 +27561,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -27437,7 +27561,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_cv_func_mmap_fixed_mapped=no ac_cv_func_mmap_fixed_mapped=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
fi fi
echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
...@@ -46470,7 +46594,12 @@ done ...@@ -46470,7 +46594,12 @@ done
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF if test x$gcc_no_link = xyes; then
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
{ (exit 1); exit 1; }; }
fi
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure" #line $LINENO "configure"
/* confdefs.h. */ /* confdefs.h. */
_ACEOF _ACEOF
...@@ -46488,13 +46617,13 @@ struct pollfd pfd[1]; ...@@ -46488,13 +46617,13 @@ struct pollfd pfd[1];
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest.$ac_objext rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_link) 2>&5
ac_status=$? ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && (exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext' { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5 (eval $ac_try) 2>&5
ac_status=$? ac_status=$?
...@@ -46507,7 +46636,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -46507,7 +46636,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
glibcxx_cv_POLL=no glibcxx_cv_POLL=no
fi fi
rm -f conftest.$ac_objext conftest.$ac_ext rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi fi
...@@ -46780,7 +46909,12 @@ done ...@@ -46780,7 +46909,12 @@ done
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF if test x$gcc_no_link = xyes; then
{ { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
{ (exit 1); exit 1; }; }
fi
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure" #line $LINENO "configure"
/* confdefs.h. */ /* confdefs.h. */
_ACEOF _ACEOF
...@@ -46797,13 +46931,13 @@ struct iovec iov[2]; ...@@ -46797,13 +46931,13 @@ struct iovec iov[2];
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest.$ac_objext rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_link) 2>&5
ac_status=$? ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && (exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext' { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5 (eval $ac_try) 2>&5
ac_status=$? ac_status=$?
...@@ -46816,7 +46950,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -46816,7 +46950,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
glibcxx_cv_WRITEV=no glibcxx_cv_WRITEV=no
fi fi
rm -f conftest.$ac_objext conftest.$ac_ext rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi fi
...@@ -47136,7 +47270,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -47136,7 +47270,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_sectionLDflags=no ac_sectionLDflags=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
if test "$ac_test_CFLAGS" = set; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
...@@ -49278,7 +49412,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -49278,7 +49412,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_sectionLDflags=no ac_sectionLDflags=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
if test "$ac_test_CFLAGS" = set; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
...@@ -51289,7 +51423,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -51289,7 +51423,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_sectionLDflags=no ac_sectionLDflags=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
if test "$ac_test_CFLAGS" = set; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
...@@ -53309,7 +53443,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -53309,7 +53443,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_sectionLDflags=no ac_sectionLDflags=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
if test "$ac_test_CFLAGS" = set; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
...@@ -55276,7 +55410,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -55276,7 +55410,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_sectionLDflags=no ac_sectionLDflags=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
if test "$ac_test_CFLAGS" = set; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
...@@ -57142,7 +57276,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ...@@ -57142,7 +57276,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
ac_sectionLDflags=no ac_sectionLDflags=no
fi fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
if test "$ac_test_CFLAGS" = set; then if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS" CFLAGS="$ac_save_CFLAGS"
...@@ -134,6 +134,12 @@ if $GLIBCXX_IS_NATIVE; then ...@@ -134,6 +134,12 @@ if $GLIBCXX_IS_NATIVE; then
AC_CHECK_HEADERS(sys/uio.h) AC_CHECK_HEADERS(sys/uio.h)
GLIBCXX_CHECK_WRITEV GLIBCXX_CHECK_WRITEV
# For the __streamoff_base_type typedef.
GLIBCXX_CHECK_INT64_T
# For LFS support.
GLIBCXX_CHECK_LFS
AC_LC_MESSAGES AC_LC_MESSAGES
AC_TRY_COMPILE( AC_TRY_COMPILE(
......
...@@ -45,6 +45,10 @@ ...@@ -45,6 +45,10 @@
#include <cwchar> // For mbstate_t #include <cwchar> // For mbstate_t
#ifdef _GLIBCXX_HAVE_STDINT_H
#include <stdint.h> // For int64_t
#endif
namespace std namespace std
{ {
// The types streamoff, streampos and wstreampos and the class // The types streamoff, streampos and wstreampos and the class
...@@ -53,7 +57,13 @@ namespace std ...@@ -53,7 +57,13 @@ namespace std
// behaviour of these types is mostly implementation defined or // behaviour of these types is mostly implementation defined or
// unspecified. The behaviour in this implementation is as noted // unspecified. The behaviour in this implementation is as noted
// below. // below.
typedef long __streamoff_base_type;
#ifdef _GLIBCXX_HAVE_INT64_T
typedef int64_t __streamoff_base_type;
#else
typedef long long __streamoff_base_type;
#endif
typedef ptrdiff_t streamsize; // Signed integral type typedef ptrdiff_t streamsize; // Signed integral type
template<typename _StateT> template<typename _StateT>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment