From 5f9914e40ada34528748655663e4acb15a2a6ec8 Mon Sep 17 00:00:00 2001 From: Carlos Une Date: Fri, 27 Aug 2021 05:19:38 -0300 Subject: Fix compilation on MacOS/ARM64 (#548) --- src/filesystem_utilities.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/filesystem_utilities.c b/src/filesystem_utilities.c index 7075f42..cb18e4a 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 +} -- cgit v1.2.3