Skip to content

Commit fa96586

Browse files
committed
Fix FreeBSD compilation compatibility (fix #165)
1 parent de9e594 commit fa96586

File tree

7 files changed

+17
-13
lines changed

7 files changed

+17
-13
lines changed

meson.build

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,25 @@ srcs = [
2222
]
2323

2424
c_args = [
25+
'-Wstrict-prototypes',
2526
'-pthread',
2627
'-D_GNU_SOURCE',
2728
'-DVERSION="' + meson.project_version() + '"'
2829
]
2930

31+
cc = meson.get_compiler('c')
32+
3033
gumbo_dep = dependency('gumbo')
3134
libcurl_dep = dependency('libcurl')
3235
fuse_dep = dependency('fuse3')
3336
uuid_dep = dependency('uuid')
3437
expat_dep = dependency('expat')
3538
openssl_dep = dependency('openssl')
39+
execinfo_dep = cc.find_library('execinfo', required: false)
3640

3741
httpdirfs = executable('httpdirfs',
3842
srcs,
39-
dependencies : [gumbo_dep, libcurl_dep, fuse_dep, uuid_dep, expat_dep, openssl_dep],
43+
dependencies : [gumbo_dep, libcurl_dep, fuse_dep, uuid_dep, expat_dep, openssl_dep, execinfo_dep],
4044
c_args: c_args,
4145
install: true,
4246
install_dir: get_option('bindir'),

src/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ int CacheDir_create(const char *dirn)
519519
/**
520520
* \brief Allocate a new cache data structure
521521
*/
522-
static Cache *Cache_alloc()
522+
static Cache *Cache_alloc(void)
523523
{
524524
Cache *cf = CALLOC(1, sizeof(Cache));
525525

src/cache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ void CacheSystem_init(const char *path, int url_supplied);
9595
/**
9696
* \brief clear the content of the cache directory
9797
*/
98-
void CacheSystem_clear();
98+
void CacheSystem_clear(void);
9999

100100
/**
101101
* \brief Return the fullpath to the cache directory
102102
*/
103-
char *CacheSystem_get_cache_dir();
103+
char *CacheSystem_get_cache_dir(void);
104104

105105
/**
106106
* \brief Create directories under the cache directory structure, if they do
@@ -153,4 +153,4 @@ void Cache_delete(const char *fn);
153153
*/
154154
long Cache_read(Cache *cf, char *const output_buf, const off_t len,
155155
const off_t offset_start);
156-
#endif
156+
#endif

src/log.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ typedef enum {
2525
/**
2626
* \brief Get the log level from the environment.
2727
*/
28-
int log_level_init();
28+
int log_level_init(void);
2929

3030
/**
3131
* \brief Log printf
@@ -44,6 +44,6 @@ void log_printf(LogType type, const char *file, const char *func, int line,
4444
/**
4545
* \brief Print the version information for HTTPDirFS
4646
*/
47-
void print_version();
47+
void print_version(void);
4848

49-
#endif
49+
#endif

src/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
void add_arg(char ***fuse_argv_ptr, int *fuse_argc, char *opt_string);
1111
static void print_help(char *program_name, int long_help);
12-
static void print_long_help();
12+
static void print_long_help(void);
1313
static int
1414
parse_arg_list(int argc, char **argv, char ***fuse_argv, int *fuse_argc);
1515
void parse_config_file(char ***argv, int *argc);
@@ -114,7 +114,7 @@ activate Sonic mode.\n");
114114
return 0;
115115
}
116116

117-
static char *get_XDG_CONFIG_HOME()
117+
static char *get_XDG_CONFIG_HOME(void)
118118
{
119119
const char *default_config_subdir = "/.config";
120120
char *config_dir = NULL;
@@ -431,4 +431,4 @@ HTTPDirFS options:\n\
431431
using the insecure username / hex encoded password\n\
432432
scheme\n\
433433
\n");
434-
}
434+
}

src/memcache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ size_t write_memory_callback(void *recv_data, size_t size, size_t nmemb,
2525
ts->data[ts->curr_size] = '\0';
2626

2727
return recv_size;
28-
}
28+
}

src/memcache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ struct TransferStruct {
3232
size_t write_memory_callback(void *contents, size_t size, size_t nmemb,
3333
void *userp);
3434

35-
#endif
35+
#endif

0 commit comments

Comments
 (0)