From: Paolo Carlini Date: Fri, 21 Nov 2003 20:30:12 +0000 (+0000) Subject: PR libstdc++/12882 (partial) X-Git-Tag: releases/gcc-3.4.0~2168 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c89246dfba0114a9a5954a0ea00a9f06c7ff923;p=thirdparty%2Fgcc.git PR libstdc++/12882 (partial) 2003-11-21 Paolo Carlini PR libstdc++/12882 (partial) * acinclude.m4 (GLIBCXX_CHECK_LFS): Check fseeko64 and ftello64 too. * include/ext/stdio_sync_filebuf.h (seekoff): Use fseeko64 and ftello64 if available. * aclocal.m4: Regenerate. * configure: Ditto. From-SVN: r73815 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5e600e6fbb36..abce9042edd8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2003-11-21 Paolo Carlini + + PR libstdc++/12882 (partial) + * acinclude.m4 (GLIBCXX_CHECK_LFS): Check fseeko64 + and ftello64 too. + * include/ext/stdio_sync_filebuf.h (seekoff): Use fseeko64 + and ftello64 if available. + * aclocal.m4: Regenerate. + * configure: Ditto. + 2003-11-20 Benjamin Kosnik * include/debug/formatter.h: Use _Tp as template argument. diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index a9ee4e0fd31f..7455b6965d54 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -600,7 +600,10 @@ AC_DEFUN(GLIBCXX_CHECK_LFS, [ [#include #include ], - [fopen64("t", "w"); + [FILE* fp; + fopen64("t", "w"); + fseeko64(fp, 0, SEEK_CUR); + ftello64(fp); lseek64(1, 0, SEEK_CUR);], [glibcxx_cv_LFS=yes], [glibcxx_cv_LFS=no]) diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4 index ea472fd15066..efbf8c3112fb 100644 --- a/libstdc++-v3/aclocal.m4 +++ b/libstdc++-v3/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.7.8 -*- Autoconf -*- +# generated automatically by aclocal 1.7.9 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. @@ -613,7 +613,10 @@ AC_DEFUN(GLIBCXX_CHECK_LFS, [ [#include #include ], - [fopen64("t", "w"); + [FILE* fp; + fopen64("t", "w"); + fseeko64(fp, 0, SEEK_CUR); + ftello64(fp); lseek64(1, 0, SEEK_CUR);], [glibcxx_cv_LFS=yes], [glibcxx_cv_LFS=no]) @@ -2009,7 +2012,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], - [AM_AUTOMAKE_VERSION([1.7.8])]) + [AM_AUTOMAKE_VERSION([1.7.9])]) # Helper functions for option handling. -*- Autoconf -*- diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 72ecf6db4fc2..fa0050ad0e7f 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -3795,6 +3795,7 @@ cygwin* | mingw* |pw32*) ;; darwin* | rhapsody*) + # this will be overwritten by pass_all, but leave it in just in case lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in @@ -3805,6 +3806,7 @@ darwin* | rhapsody*) lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac + lt_cv_deplibs_check_method=pass_all ;; freebsd* ) @@ -4267,7 +4269,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4270 "configure"' > conftest.$ac_ext + echo '#line 4272 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4871,7 +4873,7 @@ fi; # # Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style. cat > conftest.$ac_ext << EOF -#line 4874 "configure" +#line 4876 "configure" struct S { ~S(); }; void bar(); void foo() @@ -26898,7 +26900,10 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -fopen64("t", "w"); +FILE* fp; + fopen64("t", "w"); + fseeko64(fp, 0, SEEK_CUR); + ftello64(fp); lseek64(1, 0, SEEK_CUR); ; return 0; diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h index 4727c6b28667..e61091215855 100644 --- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h +++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h @@ -180,9 +180,13 @@ namespace __gnu_cxx __whence = SEEK_CUR; else __whence = SEEK_END; - +#ifdef _GLIBCXX_USE_LFS + if (!fseeko64(_M_file, __off, __whence)) + __ret = std::streampos(ftello64(_M_file)); +#else if (!fseek(_M_file, __off, __whence)) __ret = std::streampos(std::ftell(_M_file)); +#endif return __ret; }