Skip to content
Snippets Groups Projects
  • Jonathan Wakely's avatar
    5435449b
    libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd · 5435449b
    Jonathan Wakely authored
    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.
    5435449b
    History
    libstdc++: Add autoconf checks for mkdir, chmod, chdir, and getcwd
    Jonathan Wakely authored
    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.