mirror of
https://github.com/zeldaret/ph
synced 2026-05-25 15:25:10 -04:00
Fix #ifdef platform detection in files.h
This commit is contained in:
+2
-2
@@ -18,7 +18,7 @@ typedef struct FileTree {
|
||||
bool MakeFileTree(FileTree *pTree);
|
||||
|
||||
bool IterFiles(bool (*callback)(const char *name, bool isDir, void*), void *userData) {
|
||||
#ifdef _WIN32
|
||||
#ifdef __UTIL_WINDOWS
|
||||
WIN32_FIND_DATAA findData;
|
||||
HANDLE hFind = FindFirstFileA("*", &findData);
|
||||
if (hFind == INVALID_HANDLE_VALUE) FATAL("Failed to open directory to iterate files\n");
|
||||
@@ -30,7 +30,7 @@ bool IterFiles(bool (*callback)(const char *name, bool isDir, void*), void *user
|
||||
if (!callback(name, isDir, userData)) return false;
|
||||
} while (FindNextFileA(hFind, &findData));
|
||||
FindClose(hFind);
|
||||
#elif __linux__
|
||||
#elif defined(__UTIL_LINUX)
|
||||
DIR *dir = opendir(".");
|
||||
struct dirent *entry;
|
||||
while ((entry = readdir(dir)) != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user