mirror of
https://github.com/vgough/encfs.git
synced 2025-02-16 09:49:46 +01:00
Fix compilation for OS X.
This commit is contained in:
parent
8377467ef2
commit
10c231d172
@ -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")
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user