This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] 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.

Tested x86_64-linux, i686-linux, powerpv64le-linux. I've verified that
a 10gb file has its size correctly reported on 32-bit x86 now.

Committed to trunk.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]