Skip to content

Commit

Permalink
libfuse cleanup: remove libfuse API compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
trapexit committed Aug 7, 2020
1 parent 3bfdd78 commit 3c761b7
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 1,092 deletions.
47 changes: 0 additions & 47 deletions libfuse/include/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -929,53 +929,6 @@ extern "C" {
/** Get session from fuse object */
struct fuse_session *fuse_get_session(struct fuse *f);

/* ----------------------------------------------------------- *
* Compatibility stuff *
* ----------------------------------------------------------- */

#if FUSE_USE_VERSION < 26
# include "fuse_compat.h"
# undef fuse_main
# if FUSE_USE_VERSION == 25
# define fuse_main(argc, argv, op) \
fuse_main_real_compat25(argc, argv, op, sizeof(*(op)))
# define fuse_new fuse_new_compat25
# define fuse_setup fuse_setup_compat25
# define fuse_teardown fuse_teardown_compat22
# define fuse_operations fuse_operations_compat25
# elif FUSE_USE_VERSION == 22
# define fuse_main(argc, argv, op) \
fuse_main_real_compat22(argc, argv, op, sizeof(*(op)))
# define fuse_new fuse_new_compat22
# define fuse_setup fuse_setup_compat22
# define fuse_teardown fuse_teardown_compat22
# define fuse_operations fuse_operations_compat22
# define fuse_file_info fuse_file_info_compat
# elif FUSE_USE_VERSION == 24
# error Compatibility with high-level API version 24 not supported
# else
# define fuse_dirfil_t fuse_dirfil_t_compat
# define __fuse_read_cmd fuse_read_cmd
# define __fuse_process_cmd fuse_process_cmd
# define __fuse_loop_mt fuse_loop_mt_proc
# if FUSE_USE_VERSION == 21
# define fuse_operations fuse_operations_compat2
# define fuse_main fuse_main_compat2
# define fuse_new fuse_new_compat2
# define __fuse_setup fuse_setup_compat2
# define __fuse_teardown fuse_teardown_compat22
# define __fuse_exited fuse_exited
# define __fuse_set_getcontext_func fuse_set_getcontext_func
# else
# define fuse_statfs fuse_statfs_compat1
# define fuse_operations fuse_operations_compat1
# define fuse_main fuse_main_compat1
# define fuse_new fuse_new_compat1
# define FUSE_DEBUG FUSE_DEBUG_COMPAT1
# endif
# endif
#endif

#ifdef __cplusplus
}
#endif
Expand Down
34 changes: 0 additions & 34 deletions libfuse/include/fuse_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,40 +479,6 @@ extern "C" {
*/
void fuse_remove_signal_handlers(struct fuse_session *se);

/* ----------------------------------------------------------- *
* Compatibility stuff *
* ----------------------------------------------------------- */

#if FUSE_USE_VERSION < 26
# ifdef __FreeBSD__
# if FUSE_USE_VERSION < 25
# error On FreeBSD API version 25 or greater must be used
# endif
# endif
# include "fuse_common_compat.h"
# undef FUSE_MINOR_VERSION
# undef fuse_main
# define fuse_unmount fuse_unmount_compat22
# if FUSE_USE_VERSION == 25
# define FUSE_MINOR_VERSION 5
# define fuse_mount fuse_mount_compat25
# elif FUSE_USE_VERSION == 24 || FUSE_USE_VERSION == 22
# define FUSE_MINOR_VERSION 4
# define fuse_mount fuse_mount_compat22
# elif FUSE_USE_VERSION == 21
# define FUSE_MINOR_VERSION 1
# define fuse_mount fuse_mount_compat22
# elif FUSE_USE_VERSION == 11
# warning Compatibility with API version 11 is deprecated
# undef FUSE_MAJOR_VERSION
# define FUSE_MAJOR_VERSION 1
# define FUSE_MINOR_VERSION 1
# define fuse_mount fuse_mount_compat1
# else
# error Compatibility with API version other than 21, 22, 24, 25 and 11 not supported
# endif
#endif

#ifdef __cplusplus
}
#endif
Expand Down
27 changes: 0 additions & 27 deletions libfuse/include/fuse_common_compat.h

This file was deleted.

197 changes: 0 additions & 197 deletions libfuse/include/fuse_compat.h

This file was deleted.

22 changes: 0 additions & 22 deletions libfuse/include/fuse_lowlevel.h
Original file line number Diff line number Diff line change
Expand Up @@ -1834,28 +1834,6 @@ extern "C" {
*/
void fuse_chan_destroy(struct fuse_chan *ch);

/* ----------------------------------------------------------- *
* Compatibility stuff *
* ----------------------------------------------------------- */

#if FUSE_USE_VERSION < 26
# include "fuse_lowlevel_compat.h"
# define fuse_chan_ops fuse_chan_ops_compat24
# define fuse_chan_new fuse_chan_new_compat24
# if FUSE_USE_VERSION == 25
# define fuse_lowlevel_ops fuse_lowlevel_ops_compat25
# define fuse_lowlevel_new fuse_lowlevel_new_compat25
# elif FUSE_USE_VERSION == 24
# define fuse_lowlevel_ops fuse_lowlevel_ops_compat
# define fuse_lowlevel_new fuse_lowlevel_new_compat
# define fuse_file_info fuse_file_info_compat
# define fuse_reply_statfs fuse_reply_statfs_compat
# define fuse_reply_open fuse_reply_open_compat
# else
# error Compatibility with low-level API version < 24 not supported
# endif
#endif

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit 3c761b7

Please sign in to comment.