From 10c231d172fd3137e2c7288ee78a429b7fd95485 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien-Pierre=20Ave=CC=81rous?= Date: Thu, 3 Mar 2016 17:06:27 +0100 Subject: [PATCH] Fix compilation for OS X. --- CMakeLists.txt | 6 ------ encfs/main.cpp | 2 +- fs/DirNode.cpp | 2 +- fs/RawFileIO.cpp | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16a6a0bc..9c608fdc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,12 +51,6 @@ endif (HAVE_GNU11_FLAG) find_package (FUSE REQUIRED) include_directories (${FUSE_INCLUDE_DIR}) add_definitions (-D_FILE_OFFSET_BITS=64 -DFUSE_USE_VERSION=26) -if (APPLE) - add_definitions (-D__FreeBSD__=10) - # XXX: Fall back to stdc++, due to clang 5.0.1 header file issues - # (missing sys/endian.h, needed by standard c++ header files). - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7") -endif (APPLE) # Packaging config. set (CPACK_PACKAGE_NAME "Encfs") diff --git a/encfs/main.cpp b/encfs/main.cpp index ae8a84ba..a9d6d6cd 100644 --- a/encfs/main.cpp +++ b/encfs/main.cpp @@ -558,7 +558,7 @@ int main(int argc, char *argv[]) { encfs_oper.utimens = encfs_utimens; // encfs_oper.bmap = encfs_bmap; -#if (__FreeBSD__ >= 10) +#if (__FreeBSD__ >= 10) || defined(__APPLE__) // encfs_oper.setvolname // encfs_oper.exchange // encfs_oper.getxtimes diff --git a/fs/DirNode.cpp b/fs/DirNode.cpp index 28362c46..7a95bda9 100644 --- a/fs/DirNode.cpp +++ b/fs/DirNode.cpp @@ -80,7 +80,7 @@ static bool _nextName(struct dirent *&de, const shared_ptr &dir, if (de) { if (fileType) { -#if defined(_DIRENT_HAVE_D_TYPE) || defined(__FreeBSD__) +#if defined(_DIRENT_HAVE_D_TYPE) || defined(__FreeBSD__) || defined(__APPLE__) *fileType = de->d_type; #else #warning "struct dirent.d_type not supported" diff --git a/fs/RawFileIO.cpp b/fs/RawFileIO.cpp index c01657f1..0f4f1480 100644 --- a/fs/RawFileIO.cpp +++ b/fs/RawFileIO.cpp @@ -245,7 +245,7 @@ int RawFileIO::truncate(off_t size) { if (fd >= 0 && canWrite) { res = ::ftruncate(fd, size); -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__APPLE__) ::fdatasync(fd); #endif } else