Skip to content

Commit 5f9914e

Browse files
author
Carlos Une
authored
Fix compilation on MacOS/ARM64 (#548)
1 parent b69042d commit 5f9914e

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

src/filesystem_utilities.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#include <sys/stat.h>
22
#include <dirent.h>
33

4-
#ifdef __APPLE__
4+
#if defined(__APPLE__) && !defined(__aarch64__)
55
DIR * opendir$INODE64( const char * dirName );
66
struct dirent * readdir$INODE64( DIR * dir );
7+
#define opendir opendir$INODE64
8+
#define readdir readdir$INODE64
79
#endif
810

911
int c_is_dir(const char *path)
@@ -18,24 +20,12 @@ const char *get_d_name(struct dirent *d)
1820
return (const char *) d->d_name;
1921
}
2022

21-
22-
23-
DIR *c_opendir(const char *dirname){
24-
25-
#ifdef __APPLE__
26-
return opendir$INODE64(dirname);
27-
#else
23+
DIR *c_opendir(const char *dirname)
24+
{
2825
return opendir(dirname);
29-
#endif
30-
3126
}
3227

33-
struct dirent *c_readdir(DIR *dirp){
34-
35-
#ifdef __APPLE__
36-
return readdir$INODE64(dirp);
37-
#else
28+
struct dirent *c_readdir(DIR *dirp)
29+
{
3830
return readdir(dirp);
39-
#endif
40-
41-
}
31+
}

0 commit comments

Comments
 (0)