diff options
author | Martin Pärtel <martin.partel@gmail.com> | 2025-06-08 13:13:50 +0200 |
---|---|---|
committer | Martin Pärtel <martin.partel@gmail.com> | 2025-06-08 13:14:17 +0200 |
commit | 3293dc98e37eed0fb0cbfcbd40434d3c37c69480 (patch) | |
tree | 0b6230befc19301ae3da5029dd711c835dcbf199 | |
parent | b66f7ed58346fc53198ffadc3c0bb0c448e097f9 (diff) | |
download | bindfs-3293dc98e37eed0fb0cbfcbd40434d3c37c69480.tar.gz |
Attempt to fix MacFuse compatibility
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/bindfs.c | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index 2683a25..dde224e 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,12 @@ AS_IF([test "x$with_fuse2" == "xyes"], [ ]) my_CFLAGS="-std=${my_std} -Wall -Wextra -Wpedantic -fno-common" +case $build_os in + darwin* ) + # For MacFuse 5.x (2025-06-08) + my_CFLAGS="${my_CFLAGS} -Wno-language-extension-token -Wno-dollar-in-identifier-extension -DFUSE_DARWIN_ENABLE_EXTENSIONS=0" + ;; +esac my_LDFLAGS="-pthread" AC_SUBST([my_CPPFLAGS]) AC_SUBST([my_CFLAGS]) diff --git a/src/bindfs.c b/src/bindfs.c index a6e2d32..aab2df5 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -326,7 +326,7 @@ static int bindfs_ioctl(const char *path, int cmd, void *arg, void *data); #endif static int bindfs_statfs(const char *path, struct statvfs *stbuf); -#if __APPLE__ +#ifdef HAVE_FUSE_T static int bindfs_statfs_x(const char *path, struct statfs *stbuf); #endif static int bindfs_release(const char *path, struct fuse_file_info *fi); @@ -1528,7 +1528,7 @@ static int bindfs_statfs(const char *path, struct statvfs *stbuf) return 0; } -#if __APPLE__ +#ifdef HAVE_FUSE_T static int bindfs_statfs_x(const char *path, struct statfs *stbuf) { int res; @@ -1581,7 +1581,7 @@ static int bindfs_fsync(const char *path, int isdatasync, understanding from the osxfuse example file: https://github.com/osxfuse/fuse/blob/master/example/fusexmp_fh.c */ -#ifdef __APPLE__ +#ifdef HAVE_FUSE_T static int bindfs_setxattr(const char *path, const char *name, const char *value, size_t size, int flags, uint32_t position) #else @@ -1601,7 +1601,7 @@ static int bindfs_setxattr(const char *path, const char *name, const char *value if (real_path == NULL) return -errno; -#if defined(__APPLE__) +#if HAVE_FUSE_T if (!strncmp(name, XATTR_APPLE_PREFIX, sizeof(XATTR_APPLE_PREFIX) - 1)) { flags &= ~(XATTR_NOSECURITY); } @@ -1626,7 +1626,7 @@ static int bindfs_setxattr(const char *path, const char *name, const char *value return 0; } -#ifdef __APPLE__ +#ifdef HAVE_FUSE_T static int bindfs_getxattr(const char *path, const char *name, char *value, size_t size, uint32_t position) #else @@ -1643,7 +1643,7 @@ static int bindfs_getxattr(const char *path, const char *name, char *value, if (real_path == NULL) return -errno; -#if defined(__APPLE__) +#if HAVE_FUSE_T if (strcmp(name, A_KAUTH_FILESEC_XATTR) == 0) { char new_name[MAXPATHLEN]; memcpy(new_name, A_KAUTH_FILESEC_XATTR, sizeof(A_KAUTH_FILESEC_XATTR)); @@ -1785,7 +1785,7 @@ static struct fuse_operations bindfs_oper = { .ioctl = bindfs_ioctl, #endif .statfs = bindfs_statfs, -#ifdef __APPLE__ +#ifdef HAVE_FUSE_T .statfs_x = bindfs_statfs_x, #endif .release = bindfs_release, |