From 89e68d0b4fc2c4e08b6b7a8070ddf8a6ee99b43d Mon Sep 17 00:00:00 2001 From: Matteo Golin Date: Tue, 7 Jul 2026 15:59:34 -0400 Subject: [PATCH 1/2] games/NXDoom: Add LIBC_LOCALE dependency The locale functions of libc are necessary for some parts of NXDoom. Signed-off-by: Matteo Golin --- games/NXDoom/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/games/NXDoom/Kconfig b/games/NXDoom/Kconfig index a30b6d8e6e5..cbf47a97a51 100644 --- a/games/NXDoom/Kconfig +++ b/games/NXDoom/Kconfig @@ -9,6 +9,7 @@ config GAMES_NXDOOM depends on ALLOW_GPL_COMPONENTS depends on VIDEO_FB depends on CRYPTO + depends on LIBC_LOCALE ---help--- Play DOOM on NuttX! From dbd517816757b4e1365068beb4d55fd8b36a44d7 Mon Sep 17 00:00:00 2001 From: Matteo Golin Date: Tue, 7 Jul 2026 16:00:05 -0400 Subject: [PATCH 2/2] games/NXDoom: Use dirent for glob implementation NuttX has dirent, so the glob implementation can be used. This removes the warning for no native glob implementation. Signed-off-by: Matteo Golin --- games/NXDoom/src/i_glob.c | 40 +++------------------------------------ 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/games/NXDoom/src/i_glob.c b/games/NXDoom/src/i_glob.c index 6f2df49e094..c60158937c9 100644 --- a/games/NXDoom/src/i_glob.c +++ b/games/NXDoom/src/i_glob.c @@ -33,15 +33,10 @@ #include "i_glob.h" #include "m_misc.h" -#if defined(HAVE_DIRENT_H) +#include + #include #include -#elif defined(__WATCOMC__) -/* Watcom has the same API in a different header. */ -#include -#else -#define NO_DIRENT_IMPLEMENTATION -#endif /**************************************************************************** * Pre-processor Definitions @@ -72,8 +67,6 @@ struct glob_s * Private Functions ****************************************************************************/ -#ifndef NO_DIRENT_IMPLEMENTATION - /* Only the fields d_name and (as an XSI extension) d_ino are specified * in POSIX.1. Other than Linux, the d_type field is available mainly * only on BSD systems. The remaining fields are available on many, but @@ -95,7 +88,7 @@ static boolean is_directory(char *dir, struct dirent *de) int result; filename = m_string_join(dir, DIR_SEPARATOR_S, de->d_name, NULL); - result = m_stat(filename, &sb); + result = stat(filename, &sb); free(filename); if (result != 0) @@ -402,30 +395,3 @@ const char *i_next_glob(glob_t *glob) ++glob->next_index; return result; } - -#else /* #ifdef NO_DIRENT_IMPLEMENTATION */ - -#warning "No native implementation of file globbing." - -glob_t *i_start_glob(const char *directory, const char *glob, int flags) -{ - return NULL; -} - -void i_end_glob(glob_t *glob) -{ - return; -} - -const char *i_next_glob(glob_t *glob) -{ - return ""; -} - -glob_t *i_start_multi_glob(const char *directory, int flags, - const char *glob, ...) -{ - return NULL; -} - -#endif /* NO_DIRENT_IMPLEMENTATION */