Only declare fuse_new_30() when FUSE_USE_VERSION == 30
authorNikolaus Rath <Nikolaus@rath.org>
Thu, 13 Jul 2017 11:23:32 +0000 (13:23 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Thu, 13 Jul 2017 11:27:43 +0000 (13:27 +0200)
This function shouldn't be called when using a newer fuse
version, so we should not define it in that case.

include/fuse.h
lib/fuse.c

index f4ac670f8c78ea2f3a6040ef011c63f92290225d..19fd12c047396965f4258dd9e02e4f08eeae1898 100644 (file)
@@ -835,13 +835,13 @@ void fuse_lib_help(struct fuse_args *args);
  * @return the created FUSE handle
  */
 #if FUSE_USE_VERSION == 30
+struct fuse *fuse_new_30(struct fuse_args *args, const struct fuse_operations *op,
+                        size_t op_size, void *private_data);
 #define fuse_new(args, op, size, data) fuse_new_30(args, op, size, data)
 #else
 struct fuse *fuse_new(struct fuse_args *args, const struct fuse_operations *op,
                      size_t op_size, void *private_data);
 #endif
-struct fuse *fuse_new_30(struct fuse_args *args, const struct fuse_operations *op,
-                        size_t op_size, void *private_data);
 
 /**
  * Mount a FUSE file system.
index 08dab22dfd297abf89a76be23ea0feb4a0e2e8a3..75f13d7b4305ba6ccf2b32f724789568e9de64e6 100644 (file)
@@ -4626,30 +4626,6 @@ void fuse_stop_cleanup_thread(struct fuse *f)
 }
 
 
-/* Emulates 3.0-style fuse_new(), which processes --help */
-FUSE_SYMVER(".symver fuse_new_30,fuse_new@FUSE_3.0");
-struct fuse *fuse_new_30(struct fuse_args *args,
-                        const struct fuse_operations *op,
-                        size_t op_size, void *user_data)
-{
-       struct fuse_config conf;
-       const struct fuse_opt opts[] = {
-               FUSE_LIB_OPT("-h", show_help, 1),
-               FUSE_LIB_OPT("--help", show_help, 1),
-               FUSE_OPT_END
-       };
-
-       if (fuse_opt_parse(args, &conf, opts,
-                          fuse_lib_opt_proc) == -1)
-               return NULL;
-
-       if (conf.show_help) {
-               fuse_lib_help(args);
-               return NULL;
-       } else
-               return fuse_new_31(args, op, op_size, user_data);
-}
-
 /* Explicit prototype to prevent compiler warnings
    (fuse.h only defines fuse_new()) */
 struct fuse *fuse_new_31(struct fuse_args *args, const struct fuse_operations *op,
@@ -4803,6 +4779,32 @@ out:
        return NULL;
 }
 
+/* Emulates 3.0-style fuse_new(), which processes --help */
+struct fuse *fuse_new_30(struct fuse_args *args, const struct fuse_operations *op,
+                        size_t op_size, void *private_data);
+FUSE_SYMVER(".symver fuse_new_30,fuse_new@FUSE_3.0");
+struct fuse *fuse_new_30(struct fuse_args *args,
+                        const struct fuse_operations *op,
+                        size_t op_size, void *user_data)
+{
+       struct fuse_config conf;
+       const struct fuse_opt opts[] = {
+               FUSE_LIB_OPT("-h", show_help, 1),
+               FUSE_LIB_OPT("--help", show_help, 1),
+               FUSE_OPT_END
+       };
+
+       if (fuse_opt_parse(args, &conf, opts,
+                          fuse_lib_opt_proc) == -1)
+               return NULL;
+
+       if (conf.show_help) {
+               fuse_lib_help(args);
+               return NULL;
+       } else
+               return fuse_new_31(args, op, op_size, user_data);
+}
+
 void fuse_destroy(struct fuse *f)
 {
        size_t i;