mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-18 16:44:57 +08:00
libstdc++: Do not use dirent::d_type unconditionally
These new tests should not use the d_type member unless it's actually present on the OS. libstdc++-v3/ChangeLog: * testsuite/27_io/filesystem/iterators/error_reporting.cc: Use autoconf macro to check whether d_type is present. * testsuite/experimental/filesystem/iterators/error_reporting.cc: Likewise.
This commit is contained in:
parent
c17975d81a
commit
d98668eb06
@ -36,14 +36,18 @@ extern "C" struct dirent* readdir(DIR*)
|
||||
{
|
||||
case 1:
|
||||
global_dirent.d_ino = 999;
|
||||
#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_REG
|
||||
global_dirent.d_type = DT_REG;
|
||||
#endif
|
||||
global_dirent.d_reclen = 0;
|
||||
std::char_traits<char>::copy(global_dirent.d_name, "file", 5);
|
||||
choice = 0;
|
||||
return &global_dirent;
|
||||
case 2:
|
||||
global_dirent.d_ino = 111;
|
||||
#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_DIR
|
||||
global_dirent.d_type = DT_DIR;
|
||||
#endif
|
||||
global_dirent.d_reclen = 60;
|
||||
std::char_traits<char>::copy(global_dirent.d_name, "subdir", 7);
|
||||
choice = 1;
|
||||
|
@ -37,14 +37,18 @@ extern "C" struct dirent* readdir(DIR*)
|
||||
{
|
||||
case 1:
|
||||
global_dirent.d_ino = 999;
|
||||
#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_REG
|
||||
global_dirent.d_type = DT_REG;
|
||||
#endif
|
||||
global_dirent.d_reclen = 0;
|
||||
std::char_traits<char>::copy(global_dirent.d_name, "file", 5);
|
||||
choice = 0;
|
||||
return &global_dirent;
|
||||
case 2:
|
||||
global_dirent.d_ino = 111;
|
||||
#if defined _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE && defined DT_DIR
|
||||
global_dirent.d_type = DT_DIR;
|
||||
#endif
|
||||
global_dirent.d_reclen = 60;
|
||||
std::char_traits<char>::copy(global_dirent.d_name, "subdir", 7);
|
||||
choice = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user