From fc2fea755081434cfb5a1c924ee8a9941ae7a2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kov=C3=A1cs?= Date: Thu, 26 Dec 2019 14:57:38 +0100 Subject: [PATCH] Remove (undefined) HAVE_DIRENT_H to fix loading a random example, change version to 4.0pre2 --- src/include/config.h | 2 +- src/util/xstdio.c | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/include/config.h b/src/include/config.h index 3e45e1e8..afc3e54d 100644 --- a/src/include/config.h +++ b/src/include/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG_H #define CONFIG_H -#define XaoS_VERSION "4.0" +#define XaoS_VERSION "4.0pre2" #define HELP_URL "https://github.com/xaos-project/XaoS/wiki" #define WEB_URL "http://xaos.sourceforge.net/" diff --git a/src/util/xstdio.c b/src/util/xstdio.c index 7ff02be3..3f2578aa 100644 --- a/src/util/xstdio.c +++ b/src/util/xstdio.c @@ -1,8 +1,6 @@ #include #include -#ifdef HAVE_DIRENT_H #include -#endif #include #include #ifdef HAVE_UNISTD_H @@ -39,7 +37,6 @@ xio_fixpath (const char *c) int xio_getfiles (xio_constpath path1, char ***names, char ***dirs, int *nnames2, int *ndirs2) { -#ifdef HAVE_DIRENT_H char *path = xio_fixpath (path1); int maxnames = 200, maxdirs = 200; int nnames = 0, ndirs = 0; @@ -91,10 +88,6 @@ xio_getfiles (xio_constpath path1, char ***names, char ***dirs, int *nnames2, in *ndirs2 = ndirs; closedir (dir); return 1; -#else - *nnames2 = *ndirs2 = 0; - return 0; -#endif } xio_path @@ -130,7 +123,6 @@ xio_getfilename (const char *basename, const char *extension) xio_file xio_getrandomexample (xio_path name) { -#ifdef HAVE_DIRENT_H static const char *const paths[] = { /*Where examples should be located? */ EXAMPLESPATH, /*Data path when XaoS is propertly installed */ "\01" XIO_PATHSEPSTR "examples", @@ -215,9 +207,6 @@ xio_getrandomexample (xio_path name) f = xio_ropen (name); free (realpath); return (f); -#else - return NULL; -#endif } xio_file