foxygit / fake-08-xbox360 Log in
commit 0810b71b3b06f26d926d832730d96e0413563494
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Thu Jan 1 20:43:51 2026 -0700
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Thu Jan 1 20:43:51 2026 -0700

    fix switch and vita builds by removing duplicate listdirs definition
---
 platform/SDL2Common/source/sdl2basehost.cpp | 22 ----------------------
 platform/SDL2Desktop/source/SDL2Host.cpp    | 23 +++++++++++++++++++++++
 2 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/platform/SDL2Common/source/sdl2basehost.cpp b/platform/SDL2Common/source/sdl2basehost.cpp
index bf356e2..d60802c 100644
--- a/platform/SDL2Common/source/sdl2basehost.cpp
+++ b/platform/SDL2Common/source/sdl2basehost.cpp
@@ -450,25 +450,3 @@ std::string Host::getCartDirectory() {
     return _cartDirectory;
 }

-std::vector<std::string> Host::listdirs() {
-    std::vector<std::string> dirs;
-
-    DIR *dir;
-    struct dirent *ent;
-    if ((dir = opendir (_cartDirectory.c_str())) != NULL) {
-        while ((ent = readdir (dir)) != NULL) {
-            if (ent->d_name[0] == '.') {
-                continue;
-            }
-            std::string fullPath = _cartDirectory + "/" + ent->d_name;
-            DIR* testDir = opendir(fullPath.c_str());
-            if (testDir != NULL) {
-                closedir(testDir);
-                dirs.push_back(ent->d_name);
-            }
-        }
-        closedir (dir);
-    }
-
-    return dirs;
-}
diff --git a/platform/SDL2Desktop/source/SDL2Host.cpp b/platform/SDL2Desktop/source/SDL2Host.cpp
index a35f072..f6db391 100644
--- a/platform/SDL2Desktop/source/SDL2Host.cpp
+++ b/platform/SDL2Desktop/source/SDL2Host.cpp
@@ -230,3 +230,26 @@ vector<string> Host::listcarts(){
     return carts;
 }

+std::vector<std::string> Host::listdirs() {
+    std::vector<std::string> dirs;
+
+    DIR *dir;
+    struct dirent *ent;
+    if ((dir = opendir (_cartDirectory.c_str())) != NULL) {
+        while ((ent = readdir (dir)) != NULL) {
+            if (ent->d_name[0] == '.') {
+                continue;
+            }
+            std::string fullPath = _cartDirectory + "/" + ent->d_name;
+            DIR* testDir = opendir(fullPath.c_str());
+            if (testDir != NULL) {
+                closedir(testDir);
+                dirs.push_back(ent->d_name);
+            }
+        }
+        closedir (dir);
+    }
+
+    return dirs;
+}
+