From b7665478d945bda2eebbdf88c7c76c0a98693209 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Mon, 30 May 2016 22:33:27 -0700 Subject: [PATCH] dll: cygwin integration checkpoint --- build/VStudio/installer/Product.wxs | 36 ++++++++++++++++++++++ build/VStudio/winfsp_dll.vcxproj | 23 ++++++++++++++ build/VStudio/winfsp_dll.vcxproj.filters | 3 ++ inc/fuse/fuse.h | 5 ++++ inc/fuse/fuse_common.h | 38 ++++++++++++++++++++---- src/dll/fuse/fuse.pc | 10 +++++++ 6 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 src/dll/fuse/fuse.pc diff --git a/build/VStudio/installer/Product.wxs b/build/VStudio/installer/Product.wxs index a9c0e4df..5816f201 100644 --- a/build/VStudio/installer/Product.wxs +++ b/build/VStudio/installer/Product.wxs @@ -197,6 +197,17 @@ + + + + + + + + + + + @@ -205,6 +216,26 @@ + + + + + VersionNT64 + + + + + + NOT VersionNT64 + @@ -237,10 +268,15 @@ + + + + + diff --git a/build/VStudio/winfsp_dll.vcxproj b/build/VStudio/winfsp_dll.vcxproj index af53e2c8..3d79c16b 100644 --- a/build/VStudio/winfsp_dll.vcxproj +++ b/build/VStudio/winfsp_dll.vcxproj @@ -45,6 +45,29 @@ + + Document + echo arch=$(PlatformTarget) >$(OutDir)fuse-$(PlatformTarget).pc +copy /b $(OutDir)fuse-$(PlatformTarget).pc + %(FullPath) $(OutDir)fuse-$(PlatformTarget).pc >nul + Writing fuse-$(PlatformTarget).pc + $(OutDir)fuse-$(PlatformTarget).pc + false + echo arch=$(PlatformTarget) >$(OutDir)fuse-$(PlatformTarget).pc +copy /b $(OutDir)fuse-$(PlatformTarget).pc + %(FullPath) $(OutDir)fuse-$(PlatformTarget).pc >nul + Writing fuse-$(PlatformTarget).pc + $(OutDir)fuse-$(PlatformTarget).pc + false + echo arch=$(PlatformTarget) >$(OutDir)fuse-$(PlatformTarget).pc +copy /b $(OutDir)fuse-$(PlatformTarget).pc + %(FullPath) $(OutDir)fuse-$(PlatformTarget).pc >nul + Writing fuse-$(PlatformTarget).pc + $(OutDir)fuse-$(PlatformTarget).pc + false + echo arch=$(PlatformTarget) >$(OutDir)fuse-$(PlatformTarget).pc +copy /b $(OutDir)fuse-$(PlatformTarget).pc + %(FullPath) $(OutDir)fuse-$(PlatformTarget).pc >nul + Writing fuse-$(PlatformTarget).pc + $(OutDir)fuse-$(PlatformTarget).pc + false + diff --git a/build/VStudio/winfsp_dll.vcxproj.filters b/build/VStudio/winfsp_dll.vcxproj.filters index b8103d17..416d74b9 100644 --- a/build/VStudio/winfsp_dll.vcxproj.filters +++ b/build/VStudio/winfsp_dll.vcxproj.filters @@ -96,6 +96,9 @@ Source + + Source\fuse + diff --git a/inc/fuse/fuse.h b/inc/fuse/fuse.h index 50c74ff6..db06ad68 100644 --- a/inc/fuse/fuse.h +++ b/inc/fuse/fuse.h @@ -165,6 +165,8 @@ static inline struct fuse_context *fuse_get_context(void) static inline int fuse_getgroups(int size, fuse_gid_t list[]) { + (void)size; + (void)list; return 0; } @@ -175,15 +177,18 @@ static inline int fuse_interrupted(void) static inline int fuse_start_cleanup_thread(struct fuse *fuse) { + (void)fuse; return 0; } static inline void fuse_stop_cleanup_thread(struct fuse *fuse) { + (void)fuse; } static inline int fuse_clean_cache(struct fuse *fuse) { + (void)fuse; return 60; } diff --git a/inc/fuse/fuse_common.h b/inc/fuse/fuse_common.h index 90519e1f..0761aa1c 100644 --- a/inc/fuse/fuse_common.h +++ b/inc/fuse/fuse_common.h @@ -38,16 +38,16 @@ extern "C" { #endif #endif -#define FUSE_MAJOR_VERSION 3 -#define FUSE_MINOR_VERSION 0 +#define FUSE_MAJOR_VERSION 2 +#define FUSE_MINOR_VERSION 9 #define FUSE_MAKE_VERSION(maj, min) ((maj) * 10 + (min)) #define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION) /* * FUSE uses a number of types (notably: struct stat) that are OS specific. - * Furthermore there are even multiple definitions of the same type even - * within the same OS. This is certainly true on Windows as well, where - * these types are not even native. + * Furthermore there are sometimes multiple definitions of the same type even + * within the same OS. This is certainly true on Windows, where these types + * are not even native. * * For this reason we will define our own fuse_* types which represent the * types as the WinFsp DLL expects to see them. When the file is included @@ -113,7 +113,29 @@ struct fuse_statvfs #elif defined(__CYGWIN__) -#error unsupported environment +#include +#include +#include + +#define fuse_uid_t uid_t +#define fuse_gid_t gid_t +#define fuse_pid_t pid_t + +#define fuse_dev_t dev_t +#define fuse_ino_t ino_t +#define fuse_mode_t mode_t +#define fuse_nlink_t nlink_t +#define fuse_off_t off_t + +#define fuse_fsblkcnt_t fsblkcnt_t +#define fuse_fsfilcnt_t fsfilcnt_t +#define fuse_blksize_t blksize_t +#define fuse_blkcnt_t blkcnt_t + +#define fuse_timespec timespec + +#define fuse_stat stat +#define fuse_statvfs statvfs #define FSP_FUSE_ENVIRONMENT 'C' @@ -190,20 +212,24 @@ static inline int fuse_parse_cmdline(struct fuse_args *args, char **mountpoint, static inline void fuse_pollhandle_destroy(struct fuse_pollhandle *ph) { + (void)ph; } static inline int fuse_daemonize(int foreground) { + (void)foreground; return 0; } static inline int fuse_set_signal_handlers(struct fuse_session *se) { + (void)se; return 0; } static inline void fuse_remove_signal_handlers(struct fuse_session *se) { + (void)se; } #ifdef __cplusplus diff --git a/src/dll/fuse/fuse.pc b/src/dll/fuse/fuse.pc new file mode 100644 index 00000000..03f6d65d --- /dev/null +++ b/src/dll/fuse/fuse.pc @@ -0,0 +1,10 @@ +prefix=${pcfiledir}/.. +incdir=${prefix}/inc/fuse +implib=${prefix}/lib/winfsp-${arch}.lib + +Name: fuse +Description: WinFsp FUSE compatible API +Version: 2.9 +URL: http://www.secfs.net/winfsp/ +Libs: "${implib}" +Cflags: -I"${incdir}"