Skip to content

Commit

Permalink
Fix FreeBSD compilation compatibility (attempt to fix #165)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangfufu committed Oct 28, 2024
1 parent de9e594 commit 43bdf7e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,25 @@ srcs = [
]

c_args = [
'-Wstrict-prototypes',
'-pthread',
'-D_GNU_SOURCE',
'-DVERSION="' + meson.project_version() + '"'
]

cc = meson.get_compiler('c')

gumbo_dep = dependency('gumbo')
libcurl_dep = dependency('libcurl')
fuse_dep = dependency('fuse3')
uuid_dep = dependency('uuid')
expat_dep = dependency('expat')
openssl_dep = dependency('openssl')
execinfo_dep = cc.find_library('execinfo', required: false)

httpdirfs = executable('httpdirfs',
srcs,
dependencies : [gumbo_dep, libcurl_dep, fuse_dep, uuid_dep, expat_dep, openssl_dep],
dependencies : [gumbo_dep, libcurl_dep, fuse_dep, uuid_dep, expat_dep, openssl_dep, execinfo_dep],
c_args: c_args,
install: true,
install_dir: get_option('bindir'),
Expand Down
2 changes: 1 addition & 1 deletion src/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ int CacheDir_create(const char *dirn)
/**
* \brief Allocate a new cache data structure
*/
static Cache *Cache_alloc()
static Cache *Cache_alloc(void)
{
Cache *cf = CALLOC(1, sizeof(Cache));

Expand Down
6 changes: 3 additions & 3 deletions src/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ void CacheSystem_init(const char *path, int url_supplied);
/**
* \brief clear the content of the cache directory
*/
void CacheSystem_clear();
void CacheSystem_clear(void);

/**
* \brief Return the fullpath to the cache directory
*/
char *CacheSystem_get_cache_dir();
char *CacheSystem_get_cache_dir(void);

/**
* \brief Create directories under the cache directory structure, if they do
Expand Down Expand Up @@ -153,4 +153,4 @@ void Cache_delete(const char *fn);
*/
long Cache_read(Cache *cf, char *const output_buf, const off_t len,
const off_t offset_start);
#endif
#endif
6 changes: 3 additions & 3 deletions src/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ typedef enum {
/**
* \brief Get the log level from the environment.
*/
int log_level_init();
int log_level_init(void);

/**
* \brief Log printf
Expand All @@ -44,6 +44,6 @@ void log_printf(LogType type, const char *file, const char *func, int line,
/**
* \brief Print the version information for HTTPDirFS
*/
void print_version();
void print_version(void);

#endif
#endif
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

void add_arg(char ***fuse_argv_ptr, int *fuse_argc, char *opt_string);
static void print_help(char *program_name, int long_help);
static void print_long_help();
static void print_long_help(void);
static int
parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc);
void parse_config_file(char ***argv, int *argc);
Expand Down Expand Up @@ -114,7 +114,7 @@ activate Sonic mode.\n");
return 0;
}

static char *get_XDG_CONFIG_HOME()
static char *get_XDG_CONFIG_HOME(void)
{
const char *default_config_subdir = "/.config";
char *config_dir = NULL;
Expand Down Expand Up @@ -431,4 +431,4 @@ HTTPDirFS options:\n\
using the insecure username / hex encoded password\n\
scheme\n\
\n");
}
}
2 changes: 1 addition & 1 deletion src/memcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ size_t write_memory_callback(void *recv_data, size_t size, size_t nmemb,
ts->data[ts->curr_size] = '\0';

return recv_size;
}
}
2 changes: 1 addition & 1 deletion src/memcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ struct TransferStruct {
size_t write_memory_callback(void *contents, size_t size, size_t nmemb,
void *userp);

#endif
#endif

0 comments on commit 43bdf7e

Please sign in to comment.