From 77cf7f7398e954d347792273131f230eb39aae04 Mon Sep 17 00:00:00 2001 From: Bill Zissimopoulos Date: Sat, 28 Jul 2018 14:08:03 -0700 Subject: [PATCH] dll: fuse3: compatibility functions --- build/VStudio/winfsp_dll.vcxproj | 1 + build/VStudio/winfsp_dll.vcxproj.filters | 3 +++ inc/fuse3/fuse_common.h | 2 ++ src/dll/fuse3/fuse3_compat.c | 34 ++++++++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 src/dll/fuse3/fuse3_compat.c diff --git a/build/VStudio/winfsp_dll.vcxproj b/build/VStudio/winfsp_dll.vcxproj index bd971532..a2c13545 100644 --- a/build/VStudio/winfsp_dll.vcxproj +++ b/build/VStudio/winfsp_dll.vcxproj @@ -42,6 +42,7 @@ + diff --git a/build/VStudio/winfsp_dll.vcxproj.filters b/build/VStudio/winfsp_dll.vcxproj.filters index ab46ebdf..3340618e 100644 --- a/build/VStudio/winfsp_dll.vcxproj.filters +++ b/build/VStudio/winfsp_dll.vcxproj.filters @@ -151,6 +151,9 @@ Source\fuse + + Source\fuse3 + diff --git a/inc/fuse3/fuse_common.h b/inc/fuse3/fuse_common.h index d8f9525a..4663b829 100644 --- a/inc/fuse3/fuse_common.h +++ b/inc/fuse3/fuse_common.h @@ -24,7 +24,9 @@ #define FUSE_COMMON_H_ #include "winfsp_fuse.h" +#if !defined(WINFSP_DLL_INTERNAL) #include "fuse_opt.h" +#endif #ifdef __cplusplus extern "C" { diff --git a/src/dll/fuse3/fuse3_compat.c b/src/dll/fuse3/fuse3_compat.c new file mode 100644 index 00000000..0b58a238 --- /dev/null +++ b/src/dll/fuse3/fuse3_compat.c @@ -0,0 +1,34 @@ +/** + * @file dll/fuse/fuse3_compat.c + * + * @copyright 2015-2018 Bill Zissimopoulos + */ +/* + * This file is part of WinFsp. + * + * You can redistribute it and/or modify it under the terms of the GNU + * General Public License version 3 as published by the Free Software + * Foundation. + * + * Licensees holding a valid commercial license may use this file in + * accordance with the commercial license agreement provided with the + * software. + */ + +#include + +/* + * This file provides an implementation of the `fuse3_*` symbols. This + * implementation is a simple shim that forwards `fuse3_*` calls to the + * equivalent `fsp_fuse3_*` ones using a default `fsp_fuse_env`. + * + * These symbols should *not* be used by C/C++ programs. For this reason + * the `fuse.h` headers only expose the `fsp_fuse3_*` symbols, wrapped + * with macros. These symbols are for use only from programs using FFI + * technology to access FUSE symbols (e.g. fusepy, jnr-fuse). + */ + +#define FSP_FUSE_API +#define FSP_FUSE_SYM(proto, ...) __declspec(dllexport) proto { __VA_ARGS__ } +#include +#include