Skip to content

Commit

Permalink
replace fuse_use_version with fuse_version when determine which versi…
Browse files Browse the repository at this point in the history
…on of fuse the user has installed.
  • Loading branch information
EricTheMagician committed Nov 11, 2015
1 parent 57db0fc commit 79bd63c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions src/file_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<FileInfo>(info.This());
info.GetReturnValue().Set(fileInfo->fi.nonseekable ? Nan::True() : Nan::False());
#else
Expand All @@ -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<FileInfo>(info.This());
fileInfo->fi.nonseekable = value->IsTrue() ? 1 : 0;
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/filesystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<struct fuse_forget_data *>(value.userdata) );
#endif
break;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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){
Expand Down Expand Up @@ -544,7 +544,7 @@ namespace NodeFuse {
//scope.Close(Undefined());

}
#endif //FUSE_USE_VERSION
#endif //FUSE_VERSION


void FileSystem::Forget(fuse_req_t req,
Expand Down
4 changes: 2 additions & 2 deletions src/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/forget_data.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "forget_data.h"
#if FUSE_USE_VERSION > 28
#if FUSE_VERSION > 28

namespace NodeFuse {

Expand Down
5 changes: 3 additions & 2 deletions src/forget_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -31,6 +32,6 @@ namespace NodeFuse {
} //namespace NodeFuse


#endif // if FUSE_USE_VERSION
#endif // if FUSE_VERSION

#endif // ifdef SRC_FILE_INFO_H
4 changes: 2 additions & 2 deletions src/node_fuse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -165,7 +165,7 @@ namespace NodeFuse {
context->Set( Nan::New<String>("gid").ToLocalChecked(), Nan::New<Integer>(ctx->gid));
context->Set( Nan::New<String>("pid").ToLocalChecked(), Nan::New<Integer>(ctx->pid));

#if FUSE_USE_VERSION > 28 && !__APPLE__
#if FUSE_VERSION > 28 && !__APPLE__

context->Set( Nan::New<String>("umask").ToLocalChecked(), Nan::New<Integer>(ctx->umask));
#endif
Expand Down

0 comments on commit 79bd63c

Please sign in to comment.