Build filesystem library with large file support

Enable AC_SYS_LARGEFILE to set the macros needed for large file APIs to
be used by default. We do not want to define those macros in the
public headers that users include. The values of the macros are copied
to a separate file that is only included by the filesystem sources
during the build, and then the macros in <bits/c++config.h> are renamed
so that they don't have any effect in user code including our headers.

Also use larger type for result of filesystem::file_size to avoid
truncation of large values on 32-bit systems (PR 91947).

	PR libstdc++/81091
	PR libstdc++/91947
	* configure.ac: Use AC_SYS_LARGEFILE to enable 64-bit file APIs.
	* config.h.in: Regenerate:
	* configure: Regenerate:
	* include/Makefile.am (${host_builddir}/largefile-config.h): New
	target to generate config header for filesystem library.
	(${host_builddir}/c++config.h): Rename macros for large file support.
	* include/Makefile.in: Regenerate.
	* src/c++17/fs_dir.cc: Include new config header.
	* src/c++17/fs_ops.cc: Likewise.
	(filesystem::file_size): Use uintmax_t for size.
	* src/filesystem/dir.cc: Include new config header.
	* src/filesystem/ops.cc: Likewise.
	(experimental::filesystem::file_size): Use uintmax_t for size.

From-SVN: r276585
This commit is contained in:
Jonathan Wakely 2019-10-04 16:08:23 +01:00 committed by Jonathan Wakely
parent 0a789c10e9
commit 2fc115875e
10 changed files with 294 additions and 12 deletions

View File

@ -1,5 +1,21 @@
2019-10-04 Jonathan Wakely <jwakely@redhat.com> 2019-10-04 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/81091
PR libstdc++/91947
* configure.ac: Use AC_SYS_LARGEFILE to enable 64-bit file APIs.
* config.h.in: Regenerate:
* configure: Regenerate:
* include/Makefile.am (${host_builddir}/largefile-config.h): New
target to generate config header for filesystem library.
(${host_builddir}/c++config.h): Rename macros for large file support.
* include/Makefile.in: Regenerate.
* src/c++17/fs_dir.cc: Include new config header.
* src/c++17/fs_ops.cc: Likewise.
(filesystem::file_size): Use uintmax_t for size.
* src/filesystem/dir.cc: Include new config header.
* src/filesystem/ops.cc: Likewise.
(experimental::filesystem::file_size): Use uintmax_t for size.
* testsuite/util/testsuite_abi.h: Use std::unordered_map instead of * testsuite/util/testsuite_abi.h: Use std::unordered_map instead of
std::tr1::unordered_map. std::tr1::unordered_map.
* testsuite/util/testsuite_allocator.h: Likewise. * testsuite/util/testsuite_allocator.h: Likewise.

View File

@ -803,6 +803,14 @@
/* Version number of package */ /* Version number of package */
#undef VERSION #undef VERSION
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define if C99 functions in <complex.h> should be used in <complex> for /* Define if C99 functions in <complex.h> should be used in <complex> for
C++11. Using compiler builtins for these functions requires corresponding C++11. Using compiler builtins for these functions requires corresponding
C99 library functions to be present. */ C99 library functions to be present. */
@ -1047,6 +1055,9 @@
/* Define to 1 if mutex_timedlock is available. */ /* Define to 1 if mutex_timedlock is available. */
#undef _GTHREAD_USE_MUTEX_TIMEDLOCK #undef _GTHREAD_USE_MUTEX_TIMEDLOCK
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
/* Define if all C++11 floating point overloads are available in <math.h>. */ /* Define if all C++11 floating point overloads are available in <math.h>. */
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
#undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP #undef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP

223
libstdc++-v3/configure vendored
View File

@ -895,6 +895,7 @@ ac_user_opts='
enable_option_checking enable_option_checking
enable_multilib enable_multilib
enable_silent_rules enable_silent_rules
enable_largefile
with_target_subdir with_target_subdir
with_cross_host with_cross_host
with_newlib with_newlib
@ -1579,6 +1580,7 @@ Optional Features:
--enable-multilib build many library versions (default) --enable-multilib build many library versions (default)
--enable-silent-rules less verbose build output (undo: "make V=1") --enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0") --disable-silent-rules verbose build output (undo: "make V=0")
--disable-largefile omit support for large files
--enable-maintainer-mode --enable-maintainer-mode
enable make rules and dependencies not useful (and enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer sometimes confusing) to the casual installer
@ -4928,9 +4930,210 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
CXXFLAGS="$save_CXXFLAGS" CXXFLAGS="$save_CXXFLAGS"
# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then :
enableval=$enable_largefile;
fi
if test "$enable_largefile" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
if ${ac_cv_sys_largefile_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_sys_largefile_CC=no
if test "$GCC" != yes; then
ac_save_CC=$CC
while :; do
# IRIX 6.2 and later do not support large files by default,
# so use the C compiler's -n32 option if that helps.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
break
fi
rm -f core conftest.err conftest.$ac_objext
CC="$CC -n32"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_largefile_CC=' -n32'; break
fi
rm -f core conftest.err conftest.$ac_objext
break
done
CC=$ac_save_CC
rm -f conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
$as_echo "$ac_cv_sys_largefile_CC" >&6; }
if test "$ac_cv_sys_largefile_CC" != no; then
CC=$CC$ac_cv_sys_largefile_CC
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
if ${ac_cv_sys_file_offset_bits+:} false; then :
$as_echo_n "(cached) " >&6
else
while :; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_file_offset_bits=no; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _FILE_OFFSET_BITS 64
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_file_offset_bits=64; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_sys_file_offset_bits=unknown
break
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
case $ac_cv_sys_file_offset_bits in #(
no | unknown) ;;
*)
cat >>confdefs.h <<_ACEOF
#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
_ACEOF
;;
esac
rm -rf conftest*
if test $ac_cv_sys_file_offset_bits = unknown; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
if ${ac_cv_sys_large_files+:} false; then :
$as_echo_n "(cached) " >&6
else
while :; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_large_files=no; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#define _LARGE_FILES 1
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_sys_large_files=1; break
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_sys_large_files=unknown
break
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
$as_echo "$ac_cv_sys_large_files" >&6; }
case $ac_cv_sys_large_files in #(
no | unknown) ;;
*)
cat >>confdefs.h <<_ACEOF
#define _LARGE_FILES $ac_cv_sys_large_files
_ACEOF
;;
esac
rm -rf conftest*
fi
fi
# Runs configure.host, and assorted other critical bits. Sets # Runs configure.host, and assorted other critical bits. Sets
# up critical shell variables. # up critical shell variables.
ac_ext=c ac_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -11850,7 +12053,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 11853 "configure" #line 12056 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@ -11956,7 +12159,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF cat > conftest.$ac_ext <<_LT_EOF
#line 11959 "configure" #line 12162 "configure"
#include "confdefs.h" #include "confdefs.h"
#if HAVE_DLFCN_H #if HAVE_DLFCN_H
@ -15648,7 +15851,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; }
# Fake what AC_TRY_COMPILE does. # Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15651 "configure" #line 15854 "configure"
int main() int main()
{ {
typedef bool atomic_type; typedef bool atomic_type;
@ -15683,7 +15886,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; }
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15686 "configure" #line 15889 "configure"
int main() int main()
{ {
typedef short atomic_type; typedef short atomic_type;
@ -15718,7 +15921,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; }
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15721 "configure" #line 15924 "configure"
int main() int main()
{ {
// NB: _Atomic_word not necessarily int. // NB: _Atomic_word not necessarily int.
@ -15754,7 +15957,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; }
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15757 "configure" #line 15960 "configure"
int main() int main()
{ {
typedef long long atomic_type; typedef long long atomic_type;
@ -15907,7 +16110,7 @@ $as_echo "mutex" >&6; }
# unnecessary for this test. # unnecessary for this test.
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15910 "configure" #line 16113 "configure"
int main() int main()
{ {
_Decimal32 d1; _Decimal32 d1;
@ -15949,7 +16152,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for this test. # unnecessary for this test.
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15952 "configure" #line 16155 "configure"
template<typename T1, typename T2> template<typename T1, typename T2>
struct same struct same
{ typedef T2 type; }; { typedef T2 type; };
@ -15983,7 +16186,7 @@ $as_echo "$enable_int128" >&6; }
rm -f conftest* rm -f conftest*
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 15986 "configure" #line 16189 "configure"
template<typename T1, typename T2> template<typename T1, typename T2>
struct same struct same
{ typedef T2 type; }; { typedef T2 type; };

View File

@ -83,6 +83,8 @@ AC_PROG_CC
AC_PROG_CXX AC_PROG_CXX
CXXFLAGS="$save_CXXFLAGS" CXXFLAGS="$save_CXXFLAGS"
AC_SYS_LARGEFILE
# Runs configure.host, and assorted other critical bits. Sets # Runs configure.host, and assorted other critical bits. Sets
# up critical shell variables. # up critical shell variables.
GLIBCXX_CONFIGURE GLIBCXX_CONFIGURE

View File

@ -1014,6 +1014,7 @@ allstamped = \
# catenation. # catenation.
allcreated = \ allcreated = \
${host_builddir}/c++config.h \ ${host_builddir}/c++config.h \
${host_builddir}/largefile-config.h \
${thread_host_headers} \ ${thread_host_headers} \
${pch_build} ${pch_build}
@ -1237,10 +1238,29 @@ stamp-float128:
echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128 echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128
endif endif
# This header is not installed, it's only used to build libstdc++ itself.
${host_builddir}/largefile-config.h: ${CONFIG_HEADER} \
${glibcxx_srcdir}/include/bits/c++config
@echo '#if defined _GLIBCXX_CXX_CONFIG_H || defined _FEATURES_H' > $@
@echo '# error "This file must be included before any others"' >> $@
@echo '#endif' >> $@
@echo >> $@
@echo '/* Enable large inode numbers on Mac OS X 10.5. */' >> $@
@echo '#ifndef _DARWIN_USE_64_BIT_INODE' >> $@
@echo '# define _DARWIN_USE_64_BIT_INODE 1' >> $@
@echo '#endif' >> $@
@echo >> $@
@echo '/* Number of bits in a file offset, on hosts where this is settable. */' >> $@
@grep '_FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@
@echo >> $@
@echo '/* Define for large files, on AIX-style hosts. */' >> $@
@grep '_LARGE_FILES' ${CONFIG_HEADER} >> $@
# NB: The non-empty default ldbl_compat works around an AIX sed # NB: The non-empty default ldbl_compat works around an AIX sed
# oddity, see libstdc++/31957 for details. # oddity, see libstdc++/31957 for details.
${host_builddir}/c++config.h: ${CONFIG_HEADER} \ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
${glibcxx_srcdir}/include/bits/c++config \ ${glibcxx_srcdir}/include/bits/c++config \
${host_builddir}/largefile-config.h \
stamp-${host_alias} \ stamp-${host_alias} \
${toplevel_srcdir}/gcc/DATESTAMP \ ${toplevel_srcdir}/gcc/DATESTAMP \
stamp-namespace-version \ stamp-namespace-version \
@ -1278,6 +1298,9 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
-e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \ -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
-e 's/VERSION/_GLIBCXX_VERSION/g' \ -e 's/VERSION/_GLIBCXX_VERSION/g' \
-e 's/WORDS_/_GLIBCXX_WORDS_/g' \ -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
-e 's/_DARWIN_USE_64_BIT_INODE/_GLIBCXX_DARWIN_USE_64_BIT_INODE/g' \
-e 's/_FILE_OFFSET_BITS/_GLIBCXX_FILE_OFFSET_BITS/g' \
-e 's/_LARGE_FILES/_GLIBCXX_LARGE_FILES/g' \
-e 's/ICONV_CONST/_GLIBCXX_ICONV_CONST/g' \ -e 's/ICONV_CONST/_GLIBCXX_ICONV_CONST/g' \
-e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \ -e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \
< ${CONFIG_HEADER} >> $@ ;\ < ${CONFIG_HEADER} >> $@ ;\

View File

@ -1346,6 +1346,7 @@ allstamped = \
# catenation. # catenation.
allcreated = \ allcreated = \
${host_builddir}/c++config.h \ ${host_builddir}/c++config.h \
${host_builddir}/largefile-config.h \
${thread_host_headers} \ ${thread_host_headers} \
${pch_build} ${pch_build}
@ -1717,10 +1718,29 @@ stamp-host: ${host_headers} ${bits_host_headers} ${ext_host_headers} ${host_head
@ENABLE_FLOAT128_FALSE@stamp-float128: @ENABLE_FLOAT128_FALSE@stamp-float128:
@ENABLE_FLOAT128_FALSE@ echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128 @ENABLE_FLOAT128_FALSE@ echo 'undef _GLIBCXX_USE_FLOAT128' > stamp-float128
# This header is not installed, it's only used to build libstdc++ itself.
${host_builddir}/largefile-config.h: ${CONFIG_HEADER} \
${glibcxx_srcdir}/include/bits/c++config
@echo '#if defined _GLIBCXX_CXX_CONFIG_H || defined _FEATURES_H' > $@
@echo '# error "This file must be included before any others"' >> $@
@echo '#endif' >> $@
@echo >> $@
@echo '/* Enable large inode numbers on Mac OS X 10.5. */' >> $@
@echo '#ifndef _DARWIN_USE_64_BIT_INODE' >> $@
@echo '# define _DARWIN_USE_64_BIT_INODE 1' >> $@
@echo '#endif' >> $@
@echo >> $@
@echo '/* Number of bits in a file offset, on hosts where this is settable. */' >> $@
@grep '_FILE_OFFSET_BITS' ${CONFIG_HEADER} >> $@
@echo >> $@
@echo '/* Define for large files, on AIX-style hosts. */' >> $@
@grep '_LARGE_FILES' ${CONFIG_HEADER} >> $@
# NB: The non-empty default ldbl_compat works around an AIX sed # NB: The non-empty default ldbl_compat works around an AIX sed
# oddity, see libstdc++/31957 for details. # oddity, see libstdc++/31957 for details.
${host_builddir}/c++config.h: ${CONFIG_HEADER} \ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
${glibcxx_srcdir}/include/bits/c++config \ ${glibcxx_srcdir}/include/bits/c++config \
${host_builddir}/largefile-config.h \
stamp-${host_alias} \ stamp-${host_alias} \
${toplevel_srcdir}/gcc/DATESTAMP \ ${toplevel_srcdir}/gcc/DATESTAMP \
stamp-namespace-version \ stamp-namespace-version \
@ -1758,6 +1778,9 @@ ${host_builddir}/c++config.h: ${CONFIG_HEADER} \
-e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \ -e 's/PACKAGE/_GLIBCXX_PACKAGE/g' \
-e 's/VERSION/_GLIBCXX_VERSION/g' \ -e 's/VERSION/_GLIBCXX_VERSION/g' \
-e 's/WORDS_/_GLIBCXX_WORDS_/g' \ -e 's/WORDS_/_GLIBCXX_WORDS_/g' \
-e 's/_DARWIN_USE_64_BIT_INODE/_GLIBCXX_DARWIN_USE_64_BIT_INODE/g' \
-e 's/_FILE_OFFSET_BITS/_GLIBCXX_FILE_OFFSET_BITS/g' \
-e 's/_LARGE_FILES/_GLIBCXX_LARGE_FILES/g' \
-e 's/ICONV_CONST/_GLIBCXX_ICONV_CONST/g' \ -e 's/ICONV_CONST/_GLIBCXX_ICONV_CONST/g' \
-e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \ -e '/[ ]_GLIBCXX_LONG_DOUBLE_COMPAT[ ]/d' \
< ${CONFIG_HEADER} >> $@ ;\ < ${CONFIG_HEADER} >> $@ ;\

View File

@ -26,6 +26,7 @@
# define _GLIBCXX_USE_CXX11_ABI 1 # define _GLIBCXX_USE_CXX11_ABI 1
#endif #endif
#include <bits/largefile-config.h>
#include <filesystem> #include <filesystem>
#include <utility> #include <utility>
#include <stack> #include <stack>

View File

@ -28,6 +28,7 @@
# define NEED_DO_SPACE # define NEED_DO_SPACE
#endif #endif
#include <bits/largefile-config.h>
#include <filesystem> #include <filesystem>
#include <functional> #include <functional>
#include <ostream> #include <ostream>
@ -950,7 +951,7 @@ fs::file_size(const path& p, error_code& ec) noexcept
S(const stat_type& st) : type(make_file_type(st)), size(st.st_size) { } S(const stat_type& st) : type(make_file_type(st)), size(st.st_size) { }
S() : type(file_type::not_found) { } S() : type(file_type::not_found) { }
file_type type; file_type type;
size_t size; uintmax_t size;
}; };
auto s = do_stat(p, ec, [](const auto& st) { return S{st}; }, S{}); auto s = do_stat(p, ec, [](const auto& st) { return S{st}; }, S{});
if (s.type == file_type::regular) if (s.type == file_type::regular)

View File

@ -26,6 +26,7 @@
# define _GLIBCXX_USE_CXX11_ABI 1 # define _GLIBCXX_USE_CXX11_ABI 1
#endif #endif
#include <bits/largefile-config.h>
#include <experimental/filesystem> #include <experimental/filesystem>
#ifndef _GLIBCXX_HAVE_DIRENT_H #ifndef _GLIBCXX_HAVE_DIRENT_H

View File

@ -28,6 +28,7 @@
# define NEED_DO_SPACE # define NEED_DO_SPACE
#endif #endif
#include <bits/largefile-config.h>
#include <experimental/filesystem> #include <experimental/filesystem>
#include <functional> #include <functional>
#include <ostream> #include <ostream>
@ -806,7 +807,7 @@ fs::file_size(const path& p, error_code& ec) noexcept
S(const stat_type& st) : type(make_file_type(st)), size(st.st_size) { } S(const stat_type& st) : type(make_file_type(st)), size(st.st_size) { }
S() : type(file_type::not_found) { } S() : type(file_type::not_found) { }
file_type type; file_type type;
size_t size; uintmax_t size;
}; };
auto s = do_stat(p, ec, [](const auto& st) { return S{st}; }, S{}); auto s = do_stat(p, ec, [](const auto& st) { return S{st}; }, S{});
if (s.type == file_type::regular) if (s.type == file_type::regular)