Skip to content

Commit

Permalink
newlib fix to avoid duplicated values on dirent_type
Browse files Browse the repository at this point in the history
  • Loading branch information
humbertodias committed Mar 19, 2024
1 parent 1416700 commit e7bc2ca
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
25 changes: 0 additions & 25 deletions patches/gcc-13.2.0-PS3-PPU.patch
Original file line number Diff line number Diff line change
Expand Up @@ -684,31 +684,6 @@ index 0000000..9eb9ca7
@@ -0,0 +1 @@
+CRTSTUFF_T_CFLAGS = -fno-asynchronous-unwind-tables
\ No newline at end of file
diff --git a/libstdc++-v3/src/filesystem/dir-common.h b/libstdc++-v3/src/filesystem/dir-common.h
index af51375..3aedb59 100644
--- a/libstdc++-v3/src/filesystem/dir-common.h
+++ b/libstdc++-v3/src/filesystem/dir-common.h
@@ -272,20 +272,12 @@ get_file_type(const std::filesystem::__gnu_posix::dirent& d [[gnu::unused]])
#ifdef _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE
switch (d.d_type)
{
- case DT_BLK:
- return file_type::block;
- case DT_CHR:
- return file_type::character;
case DT_DIR:
return file_type::directory;
- case DT_FIFO:
- return file_type::fifo;
case DT_LNK:
return file_type::symlink;
case DT_REG:
return file_type::regular;
- case DT_SOCK:
- return file_type::socket;
case DT_UNKNOWN:
return file_type::unknown;
default:
diff --git a/Makefile.in b/Makefile.in
index 06a9398..7419f7e 100644
--- a/Makefile.in
Expand Down
27 changes: 27 additions & 0 deletions patches/newlib-1.20.0-PS3.patch
Original file line number Diff line number Diff line change
Expand Up @@ -13178,3 +13178,30 @@ index 6932de2..4c8bdbb 100644
/* Calculate the exponent. */
if (y < 0.0)
N = (int) (y * ONE_OVER_PI - 0.5);
diff --git a/newlib/libc/sys/lv2/sys/dirent.h b/newlib/libc/sys/lv2/sys/dirent.h
index 84780e9..d44d070 100644
--- a/newlib/libc/sys/lv2/sys/dirent.h
+++ b/newlib/libc/sys/lv2/sys/dirent.h
@@ -7,14 +7,14 @@

#define DT_INVALID 0xff
#define DT_UNKNOWN 0
-#define DT_FIFO DT_INVALID
-#define DT_CHR DT_INVALID
-#define DT_DIR 1
-#define DT_BLK DT_INVALID
-#define DT_REG 2
-#define DT_LNK 3
-#define DT_SOCK DT_INVALID
-#define DT_WHT DT_INVALID
+#define DT_FIFO 1
+#define DT_CHR 2
+#define DT_DIR 4
+#define DT_BLK 6
+#define DT_REG 8
+#define DT_LNK 10
+#define DT_SOCK 12
+#define DT_WHT 14

#define dirfd(dp) ((dp)->dd_fd)

Expand Down

0 comments on commit e7bc2ca

Please sign in to comment.