Skip to content

Commit

Permalink
Implement N4100 File System TS
Browse files Browse the repository at this point in the history
	* acinclude.m4 (GLIBCXX_ENABLE_FILESYSTEM_TS): Define.
	(GLIBCXX_CHECK_FILESYSTEM_DEPS): Define.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* configure.ac: Enable filesystem TS and check its dependencies.
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Regenerate.
	* include/bits/locale_conv.h (__do_str_code_cvt, __str_codecvt_in,
	__str_codecvt_out): Move code conversion logic from wstring_convert
	into new global functions.
	(wstring_convert::to_bytes, wstring_convert::from_bytes): Use new
	functions.
	(wstring_convert::_M_conv): Remove.
	* include/bits/quoted_string.h (_Quoted_string): Split out of iomanip.
	* include/experimental/filesystem: New.
	* include/experimental/fs_dir.h: New.
	* include/experimental/fs_fwd.h: New.
	* include/experimental/fs_ops.h: New.
	* include/experimental/fs_path.h: New.
	* include/std/iomanip (_Quoted_string): Move to bits/quoted_string.h.
	* python/libstdcxx/v6/printers.py (StdExpPathPrinter): Add.
	* src/Makefile.am (SUBDIRS): Add filesystem.
	* src/Makefile.in: Regenerate.
	* src/filesystem/Makefile.am: New.
	* src/filesystem/Makefile.in: New.
	* src/filesystem/dir.cc: New.
	* src/filesystem/ops.cc: New.
	* src/filesystem/path.cc: New.
	* testsuite/experimental/filesystem/operations/absolute.cc: New.
	* testsuite/experimental/filesystem/operations/copy.cc: New.
	* testsuite/experimental/filesystem/operations/current_path.cc: New.
	* testsuite/experimental/filesystem/path/append/path.cc: New.
	* testsuite/experimental/filesystem/path/assign/assign.cc: New.
	* testsuite/experimental/filesystem/path/assign/copy.cc: New.
	* testsuite/experimental/filesystem/path/compare/compare.cc: New.
	* testsuite/experimental/filesystem/path/compare/path.cc: New.
	* testsuite/experimental/filesystem/path/compare/strings.cc: New.
	* testsuite/experimental/filesystem/path/concat/path.cc: New.
	* testsuite/experimental/filesystem/path/concat/strings.cc: New.
	* testsuite/experimental/filesystem/path/construct/copy.cc: New.
	* testsuite/experimental/filesystem/path/construct/default.cc: New.
	* testsuite/experimental/filesystem/path/construct/locale.cc: New.
	* testsuite/experimental/filesystem/path/construct/range.cc: New.
	* testsuite/experimental/filesystem/path/decompose/extension.cc: New.
	* testsuite/experimental/filesystem/path/decompose/filename.cc: New.
	* testsuite/experimental/filesystem/path/decompose/parent_path.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/relative_path.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/root_name.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/root_path.cc:
	New.
	* testsuite/experimental/filesystem/path/decompose/stem.cc: New.
	* testsuite/experimental/filesystem/path/generic/generic_string.cc:
	New.
	* testsuite/experimental/filesystem/path/itr/traversal.cc: New.
	* testsuite/experimental/filesystem/path/modifiers/clear.cc: New.
	* testsuite/experimental/filesystem/path/modifiers/make_preferred.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/remove_filename.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/replace_extension.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/replace_filename.cc:
	New.
	* testsuite/experimental/filesystem/path/modifiers/swap.cc: New.
	* testsuite/experimental/filesystem/path/nonmember/hash_value.cc: New.
	* testsuite/experimental/filesystem/path/query/empty.cc: New.
	* testsuite/experimental/filesystem/path/query/has_extension.cc: New.
	* testsuite/experimental/filesystem/path/query/has_filename.cc: New.
	* testsuite/experimental/filesystem/path/query/has_parent_path.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_relative_path.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_root_directory.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_root_name.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_root_path.cc:
	New.
	* testsuite/experimental/filesystem/path/query/has_stem.cc: New.
	* testsuite/experimental/filesystem/path/query/is_relative.cc: New.
	* testsuite/util/testsuite_fs.h: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222654 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
redi committed Apr 30, 2015
1 parent bbce13a commit 5924b28
Show file tree
Hide file tree
Showing 69 changed files with 8,252 additions and 197 deletions.
90 changes: 90 additions & 0 deletions libstdc++-v3/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,93 @@
2015-04-30 Jonathan Wakely <jwakely@redhat.com>

Implement N4100 File System TS
* acinclude.m4 (GLIBCXX_ENABLE_FILESYSTEM_TS): Define.
(GLIBCXX_CHECK_FILESYSTEM_DEPS): Define.
* config.h.in: Regenerate.
* configure: Regenerate.
* configure.ac: Enable filesystem TS and check its dependencies.
* include/Makefile.am: Add new headers.
* include/Makefile.in: Regenerate.
* include/bits/locale_conv.h (__do_str_code_cvt, __str_codecvt_in,
__str_codecvt_out): Move code conversion logic from wstring_convert
into new global functions.
(wstring_convert::to_bytes, wstring_convert::from_bytes): Use new
functions.
(wstring_convert::_M_conv): Remove.
* include/bits/quoted_string.h (_Quoted_string): Split out of iomanip.
* include/experimental/filesystem: New.
* include/experimental/fs_dir.h: New.
* include/experimental/fs_fwd.h: New.
* include/experimental/fs_ops.h: New.
* include/experimental/fs_path.h: New.
* include/std/iomanip (_Quoted_string): Move to bits/quoted_string.h.
* python/libstdcxx/v6/printers.py (StdExpPathPrinter): Add.
* src/Makefile.am (SUBDIRS): Add filesystem.
* src/Makefile.in: Regenerate.
* src/filesystem/Makefile.am: New.
* src/filesystem/Makefile.in: New.
* src/filesystem/dir.cc: New.
* src/filesystem/ops.cc: New.
* src/filesystem/path.cc: New.
* testsuite/experimental/filesystem/operations/absolute.cc: New.
* testsuite/experimental/filesystem/operations/copy.cc: New.
* testsuite/experimental/filesystem/operations/current_path.cc: New.
* testsuite/experimental/filesystem/path/append/path.cc: New.
* testsuite/experimental/filesystem/path/assign/assign.cc: New.
* testsuite/experimental/filesystem/path/assign/copy.cc: New.
* testsuite/experimental/filesystem/path/compare/compare.cc: New.
* testsuite/experimental/filesystem/path/compare/path.cc: New.
* testsuite/experimental/filesystem/path/compare/strings.cc: New.
* testsuite/experimental/filesystem/path/concat/path.cc: New.
* testsuite/experimental/filesystem/path/concat/strings.cc: New.
* testsuite/experimental/filesystem/path/construct/copy.cc: New.
* testsuite/experimental/filesystem/path/construct/default.cc: New.
* testsuite/experimental/filesystem/path/construct/locale.cc: New.
* testsuite/experimental/filesystem/path/construct/range.cc: New.
* testsuite/experimental/filesystem/path/decompose/extension.cc: New.
* testsuite/experimental/filesystem/path/decompose/filename.cc: New.
* testsuite/experimental/filesystem/path/decompose/parent_path.cc:
New.
* testsuite/experimental/filesystem/path/decompose/relative_path.cc:
New.
* testsuite/experimental/filesystem/path/decompose/root_directory.cc:
New.
* testsuite/experimental/filesystem/path/decompose/root_name.cc:
New.
* testsuite/experimental/filesystem/path/decompose/root_path.cc:
New.
* testsuite/experimental/filesystem/path/decompose/stem.cc: New.
* testsuite/experimental/filesystem/path/generic/generic_string.cc:
New.
* testsuite/experimental/filesystem/path/itr/traversal.cc: New.
* testsuite/experimental/filesystem/path/modifiers/clear.cc: New.
* testsuite/experimental/filesystem/path/modifiers/make_preferred.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/remove_filename.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/replace_extension.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/replace_filename.cc:
New.
* testsuite/experimental/filesystem/path/modifiers/swap.cc: New.
* testsuite/experimental/filesystem/path/nonmember/hash_value.cc: New.
* testsuite/experimental/filesystem/path/query/empty.cc: New.
* testsuite/experimental/filesystem/path/query/has_extension.cc: New.
* testsuite/experimental/filesystem/path/query/has_filename.cc: New.
* testsuite/experimental/filesystem/path/query/has_parent_path.cc:
New.
* testsuite/experimental/filesystem/path/query/has_relative_path.cc:
New.
* testsuite/experimental/filesystem/path/query/has_root_directory.cc:
New.
* testsuite/experimental/filesystem/path/query/has_root_name.cc:
New.
* testsuite/experimental/filesystem/path/query/has_root_path.cc:
New.
* testsuite/experimental/filesystem/path/query/has_stem.cc: New.
* testsuite/experimental/filesystem/path/query/is_relative.cc: New.
* testsuite/util/testsuite_fs.h: New.

2015-04-30 Edward Smith-Rowland <3dw4rd@verizon.net>

Add fundamentals TR container erasure.
Expand Down
95 changes: 94 additions & 1 deletion libstdc++-v3/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
# Keep these sync'd with the list in Makefile.am. The first provides an
# expandable list at autoconf time; the second provides an expandable list
# (i.e., shell variable) at configure time.
m4_define([glibcxx_SUBDIRS],[include libsupc++ src src/c++98 src/c++11 doc po testsuite python])
m4_define([glibcxx_SUBDIRS],[include libsupc++ src src/c++98 src/c++11 src/filesystem doc po testsuite python])
SUBDIRS='glibcxx_SUBDIRS'
# These need to be absolute paths, yet at the same time need to
Expand Down Expand Up @@ -3903,6 +3903,99 @@ AC_DEFUN([GLIBCXX_DEFAULT_ABI], [
GLIBCXX_CONDITIONAL(ENABLE_CXX11_ABI, test $glibcxx_cxx11_abi = 1)
])

dnl
dnl Check to see whether to build libstdc++fs.a
dnl
dnl --enable-libstdcxx-filesystem-ts
dnl
AC_DEFUN([GLIBCXX_ENABLE_FILESYSTEM_TS], [
GLIBCXX_ENABLE(libstdcxx-filesystem-ts,auto,,
[turns on ISO/IEC TS 18822 support],
[permit yes|no|auto])
AC_MSG_CHECKING([whether to build Filesystem TS support])
if test x"$enable_libstdcxx_filesystem_ts" = x"auto"; then
case "${target_os}" in
freebsd*|netbsd*|openbsd*|dragonfly*|darwin*)
enable_libstdcxx_filesystem_ts=yes
;;
gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
enable_libstdcxx_filesystem_ts=yes
;;
solaris*)
enable_libstdcxx_filesystem_ts=yes
;;
*)
enable_libstdcxx_filesystem_ts=no
;;
esac
fi
AC_MSG_RESULT($enable_libstdcxx_filesystem_ts)
GLIBCXX_CONDITIONAL(ENABLE_FILESYSTEM_TS, test $enable_libstdcxx_filesystem_ts = yes)
])

dnl
dnl Check whether the library calls required by the Filesystem TS are present
dnl and define _GLIBCXX_USE_REALPATH and _GLIBCXX_USE_UTIMENSAT.
dnl
AC_DEFUN([GLIBCXX_CHECK_FILESYSTEM_DEPS], [dnl
dnl
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fno-exceptions"
dnl
AC_MSG_CHECKING([for realpath])
AC_CACHE_VAL(glibcxx_cv_realpath, [dnl
GCC_TRY_COMPILE_OR_LINK(
[#include <stdlib.h>],
[char *tmp = realpath((const char*)NULL, (char*)NULL);],
[glibcxx_cv_realpath=yes],
[glibcxx_cv_realpath=no])
])
if test $glibcxx_cv_realpath = yes; then
AC_DEFINE(_GLIBCXX_USE_REALPATH, 1, [Define if realpath is available in <stdlib.h>.])
fi
AC_MSG_RESULT($glibcxx_cv_realpath)
dnl
AC_MSG_CHECKING([for utimensat])
AC_CACHE_VAL(glibcxx_cv_utimensat, [dnl
GCC_TRY_COMPILE_OR_LINK(
[
#include <fcntl.h>
#include <sys/stat.h>
],
[
struct timespec ts[2] = { { 0, UTIME_OMIT }, { 1, 1 } };
int i = utimensat(AT_FDCWD, "path", ts, 0);
],
[glibcxx_cv_utimensat=yes],
[glibcxx_cv_utimensat=no])
])
if test $glibcxx_cv_utimensat = yes; then
AC_DEFINE(_GLIBCXX_USE_UTIMENSAT, 1, [Define if utimensat and UTIME_OMIT are available in <sys/stat.h> and AT_FDCWD in <fcntl.h>.])
fi
AC_MSG_RESULT($glibcxx_cv_utimensat)
dnl
AC_MSG_CHECKING([for struct stat.st_mtim.tv_nsec])
AC_CACHE_VAL(glibcxx_cv_st_mtim, [dnl
GCC_TRY_COMPILE_OR_LINK(
[ #include <sys/stat.h> ],
[
struct stat st;
return st.st_mtim.tv_nsec;
],
[glibcxx_cv_st_mtim=yes],
[glibcxx_cv_st_mtim=no])
])
if test $glibcxx_cv_st_mtim = yes; then
AC_DEFINE(_GLIBCXX_USE_ST_MTIM, 1, [Define if struct stat has timespec members.])
fi
AC_MSG_RESULT($glibcxx_cv_st_mtim)
dnl
CXXFLAGS="$ac_save_CXXFLAGS"
AC_LANG_RESTORE
])

# Macros from the top-level gcc directory.
m4_include([../config/gc++filt.m4])
Expand Down
34 changes: 34 additions & 0 deletions libstdc++-v3/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
/* Define to 1 if you have the `cosl' function. */
#undef HAVE_COSL

/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H

/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H

Expand Down Expand Up @@ -132,6 +136,9 @@
/* Define to 1 if you have the `fabsl' function. */
#undef HAVE_FABSL

/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H

/* Define to 1 if you have the <fenv.h> header file. */
#undef HAVE_FENV_H

Expand Down Expand Up @@ -294,6 +301,9 @@
/* Define to 1 if you have the <nan.h> header file. */
#undef HAVE_NAN_H

/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H

/* Define if poll is available in <poll.h>. */
#undef HAVE_POLL

Expand Down Expand Up @@ -372,13 +382,20 @@
/* Define to 1 if you have the `strtold' function. */
#undef HAVE_STRTOLD

/* Define to 1 if `struct dirent' is a member of `d_type'. */
#undef HAVE_STRUCT_DIRENT_D_TYPE

/* Define if strxfrm_l is available in <string.h>. */
#undef HAVE_STRXFRM_L

/* Define to 1 if the target runtime linker supports binding the same symbol
to different versions. */
#undef HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT

/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H

/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H

Expand All @@ -394,6 +411,10 @@
/* Define to 1 if you have the <sys/machine.h> header file. */
#undef HAVE_SYS_MACHINE_H

/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H

/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H

Expand All @@ -406,6 +427,9 @@
/* Define to 1 if you have the <sys/sem.h> header file. */
#undef HAVE_SYS_SEM_H

/* Define to 1 if you have the <sys/statvfs.h> header file. */
#undef HAVE_SYS_STATVFS_H

/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

Expand Down Expand Up @@ -858,6 +882,9 @@
of TR1 (Chapter 5.1). */
#undef _GLIBCXX_USE_RANDOM_TR1

/* Define if realpath is available in <stdlib.h>. */
#undef _GLIBCXX_USE_REALPATH

/* Defined if sched_yield is available. */
#undef _GLIBCXX_USE_SCHED_YIELD

Expand All @@ -867,12 +894,19 @@
/* Define if _SC_NPROC_ONLN is available in <unistd.h>. */
#undef _GLIBCXX_USE_SC_NPROC_ONLN

/* Define if struct stat has timespec members. */
#undef _GLIBCXX_USE_ST_MTIM

/* Define if sysctl(), CTL_HW and HW_NCPU are available in <sys/sysctl.h>. */
#undef _GLIBCXX_USE_SYSCTL_HW_NCPU

/* Define if obsolescent tmpnam is available in <stdio.h>. */
#undef _GLIBCXX_USE_TMPNAM

/* Define if utimensat and UTIME_OMIT are available in <sys/stat.h> and
AT_FDCWD in <fcntl.h>. */
#undef _GLIBCXX_USE_UTIMENSAT

/* Define if code specialized for wchar_t should be used. */
#undef _GLIBCXX_USE_WCHAR_T

Expand Down
Loading

0 comments on commit 5924b28

Please sign in to comment.