From 79bd63c53b4b50311600d4fe2cee9a6d4dd9c415 Mon Sep 17 00:00:00 2001 From: Eric Yen Date: Wed, 11 Nov 2015 13:57:08 -0500 Subject: [PATCH] replace fuse_use_version with fuse_version when determine which version of fuse the user has installed. --- binding.gyp | 2 +- src/file_info.cc | 4 ++-- src/filesystem.cc | 8 ++++---- src/filesystem.h | 4 ++-- src/forget_data.cc | 2 +- src/forget_data.h | 5 +++-- src/node_fuse.cc | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/binding.gyp b/binding.gyp index 32f7566..8ab2995 100644 --- a/binding.gyp +++ b/binding.gyp @@ -20,7 +20,7 @@ "-fpermissive" ], "xcode_settings": { - "OTHER_CPLUSPLUSFLAGS": [ "-std=c++11", "-mmacosx-version-min=10.7" ] + "OTHER_CPLUSPLUSFLAGS": ["-stdlib=libc++", "-std=c++11", "-mmacosx-version-min=10.7" ] }, "defines": [ '_FILE_OFFSET_BITS=64', 'FUSE_USE_VERSION=30' diff --git a/src/file_info.cc b/src/file_info.cc index 4921126..c22d812 100644 --- a/src/file_info.cc +++ b/src/file_info.cc @@ -234,7 +234,7 @@ namespace NodeFuse { NAN_GETTER(FileInfo::GetNonSeekable){ -#if FUSE_USE_VERSION > 27 && !__APPLE__ +#if FUSE_VERSION > 27 && !__APPLE__ FileInfo *fileInfo = ObjectWrap::Unwrap(info.This()); info.GetReturnValue().Set(fileInfo->fi.nonseekable ? Nan::True() : Nan::False()); #else @@ -247,7 +247,7 @@ namespace NodeFuse { if (!value->IsBoolean()) { FUSEJS_THROW_EXCEPTION("Invalid value type: ", "a Boolean was expected"); } -#if FUSE_USE_VERSION > 28 && !__APPLE__ +#if FUSE_VERSION > 28 && !__APPLE__ FileInfo *fileInfo = ObjectWrap::Unwrap(info.This()); fileInfo->fi.nonseekable = value->IsTrue() ? 1 : 0; #endif diff --git a/src/filesystem.cc b/src/filesystem.cc index fc83a6a..f139437 100644 --- a/src/filesystem.cc +++ b/src/filesystem.cc @@ -241,7 +241,7 @@ namespace NodeFuse { case _FUSE_OPS_SETLK_: break; case _FUSE_OPS_MULTI_FORGET_: - #if FUSE_USE_VERSION > 28 + #if FUSE_VERSION > 28 RemoteMultiForget(value.req, value.size, static_cast(value.userdata) ); #endif break; @@ -294,7 +294,7 @@ namespace NodeFuse { fuse_ops.releasedir = FileSystem::ReleaseDir; fuse_ops.fsyncdir = FileSystem::FSyncDir; fuse_ops.statfs = FileSystem::StatFs; - #if FUSE_USE_VERSION > 28 + #if FUSE_VERSION > 28 #ifndef __APPLE__ fuse_ops.forget_multi = FileSystem::MultiForget; #endif @@ -487,7 +487,7 @@ namespace NodeFuse { } - #if FUSE_USE_VERSION > 28 + #if FUSE_VERSION > 28 void FileSystem::MultiForget(fuse_req_t req, size_t count, struct fuse_forget_data *forget){ @@ -544,7 +544,7 @@ namespace NodeFuse { //scope.Close(Undefined()); } - #endif //FUSE_USE_VERSION + #endif //FUSE_VERSION void FileSystem::Forget(fuse_req_t req, diff --git a/src/filesystem.h b/src/filesystem.h index d3dd0cb..e22a8dc 100644 --- a/src/filesystem.h +++ b/src/filesystem.h @@ -96,7 +96,7 @@ namespace NodeFuse { static void Forget(fuse_req_t req, fuse_ino_t ino, unsigned long nlookup); - #if FUSE_USE_VERSION > 28 + #if FUSE_VERSION > 28 static void MultiForget(fuse_req_t req, size_t count, struct fuse_forget_data *forget_all); @@ -250,7 +250,7 @@ namespace NodeFuse { static void RemoteForget(fuse_req_t req, fuse_ino_t ino, unsigned long nlookup); - #if FUSE_USE_VERSION > 28 + #if FUSE_VERSION > 28 static void RemoteMultiForget(fuse_req_t req, size_t count, struct fuse_forget_data *forget_all); diff --git a/src/forget_data.cc b/src/forget_data.cc index a2d6a1d..9244a41 100644 --- a/src/forget_data.cc +++ b/src/forget_data.cc @@ -1,5 +1,5 @@ #include "forget_data.h" -#if FUSE_USE_VERSION > 28 +#if FUSE_VERSION > 28 namespace NodeFuse { diff --git a/src/forget_data.h b/src/forget_data.h index d1fa50d..b77e885 100644 --- a/src/forget_data.h +++ b/src/forget_data.h @@ -5,9 +5,10 @@ #ifndef SRC_FORGET_DATA_H_ #define SRC_FORGET_DATA_H_ -#if FUSE_USE_VERSION > 28 #include "node_fuse.h" +#if FUSE_VERSION > 28 + namespace NodeFuse { class ForgetData : public ObjectWrap { friend class FileSystem; @@ -31,6 +32,6 @@ namespace NodeFuse { } //namespace NodeFuse -#endif // if FUSE_USE_VERSION +#endif // if FUSE_VERSION #endif // ifdef SRC_FILE_INFO_H diff --git a/src/node_fuse.cc b/src/node_fuse.cc index 21a0da1..77ba96f 100644 --- a/src/node_fuse.cc +++ b/src/node_fuse.cc @@ -18,7 +18,7 @@ namespace NodeFuse { Reply::Initialize(target); FileInfo::Initialize(target); - #if FUSE_USE_VERSION > 28 + #if FUSE_VERSION > 28 #ifndef __APPLE__ ForgetData::Initialize(target); #endif @@ -165,7 +165,7 @@ namespace NodeFuse { context->Set( Nan::New("gid").ToLocalChecked(), Nan::New(ctx->gid)); context->Set( Nan::New("pid").ToLocalChecked(), Nan::New(ctx->pid)); - #if FUSE_USE_VERSION > 28 && !__APPLE__ + #if FUSE_VERSION > 28 && !__APPLE__ context->Set( Nan::New("umask").ToLocalChecked(), Nan::New(ctx->umask)); #endif