Skip to content

Commit

Permalink
Fix compilation for OS X.
Browse files Browse the repository at this point in the history
  • Loading branch information
javerous committed Mar 3, 2016
1 parent 8377467 commit 10c231d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion encfs/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion fs/DirNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static bool _nextName(struct dirent *&de, const shared_ptr<DIR> &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"
Expand Down
2 changes: 1 addition & 1 deletion fs/RawFileIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 10c231d

Please sign in to comment.