diff options
author | Carlos Une <brocolis@eml.cc> | 2021-08-27 05:19:38 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 10:19:38 +0200 |
commit | 5f9914e40ada34528748655663e4acb15a2a6ec8 (patch) | |
tree | 01a3fdc73498460b093d92cd2fbfa8fca7bf19b4 | |
parent | b69042d78ffabe16b423f454baff762a995ea5d0 (diff) | |
download | fpm-5f9914e40ada34528748655663e4acb15a2a6ec8.tar.gz fpm-5f9914e40ada34528748655663e4acb15a2a6ec8.zip |
Fix compilation on MacOS/ARM64 (#548)
-rw-r--r-- | src/filesystem_utilities.c | 26 |
1 files changed, 8 insertions, 18 deletions
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 <sys/stat.h> #include <dirent.h> -#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 +} |