Skip to content
Snippets Groups Projects
Commit 5435449b authored by Jonathan Wakely's avatar Jonathan Wakely
Browse files

libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd

The filesystem code was using these functions without checking for their
existence, assuming that any UNIX-like libc with <unistd.h> would always
provide them. That's not true for some newlib targets like arm-eabi.

libstdc++-v3/ChangeLog:

	* acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check for mkdir,
	chmod, chdir, and getcwd.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* src/c++17/fs_ops.cc (create_dir): Use USE_MKDIR macro.
	(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
	(fs::permissions): Use USE_CHMOD macro.
	* src/filesystem/ops-common.h [FILESYSTEM_IS_WINDOWS]
	(chmod, mkdir, getcwd, chdir): Define new macros.
	[FILESYSTEM_IS_WINDOWS] (chmod, mkdir, getcwd, chdir): Use
	new macros.
	* src/filesystem/ops.cc (create_dir): Use USE_MKDIR macro.
	(fs::current_path): Use USE_GETCWD and USE_CHDIR macros.
	(fs::permissions): Use USE_CHMOD macro.
parent d295a534
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment