From 64bb33e43939a391bcceb56a54c7c549e9dea321 Mon Sep 17 00:00:00 2001 From: Carlos Une Date: Fri, 27 Aug 2021 00:47:02 -0300 Subject: [PATCH] Build on MacOS/ARM64 --- src/filesystem_utilities.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/filesystem_utilities.c b/src/filesystem_utilities.c index 7075f4232b..cb18e4a1be 100644 --- a/src/filesystem_utilities.c +++ b/src/filesystem_utilities.c @@ -1,9 +1,11 @@ #include #include -#ifdef __APPLE__ +#if defined(__APPLE__) && !defined(__aarch64__) DIR * opendir$INODE64( const char * dirName ); struct dirent * readdir$INODE64( DIR * dir ); +#define opendir opendir$INODE64 +#define readdir readdir$INODE64 #endif int c_is_dir(const char *path) @@ -18,24 +20,12 @@ const char *get_d_name(struct dirent *d) return (const char *) d->d_name; } - - -DIR *c_opendir(const char *dirname){ - -#ifdef __APPLE__ - return opendir$INODE64(dirname); -#else +DIR *c_opendir(const char *dirname) +{ return opendir(dirname); -#endif - } -struct dirent *c_readdir(DIR *dirp){ - -#ifdef __APPLE__ - return readdir$INODE64(dirp); -#else +struct dirent *c_readdir(DIR *dirp) +{ return readdir(dirp); -#endif - -} \ No newline at end of file +}