From b72238c97fe2e3c9db550af7d4b22d41c8350eaf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 14 Apr 2021 14:05:47 -0400 Subject: Fix build on FreeBSD --- meson.build | 2 ++ src/filesystem.c | 3 +++ test/test_util.c | 1 + test/test_value.c | 6 ------ 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 135cf7b..843ccad 100644 --- a/meson.build +++ b/meson.build @@ -26,6 +26,7 @@ if get_option('strict') c_warnings = all_c_warnings if cc.get_id() == 'clang' c_warnings += [ + '-Wno-c11-extensions', '-Wno-cast-align', '-Wno-cast-qual', '-Wno-documentation-unknown-command', @@ -41,6 +42,7 @@ if get_option('strict') '-Wno-shorten-64-to-32', '-Wno-sign-conversion', '-Wno-switch-enum', + '-Wno-unused-macros', '-Wno-vla', ] elif cc.get_id() == 'gcc' diff --git a/src/filesystem.c b/src/filesystem.c index 03614ce..2b383a7 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -17,6 +17,7 @@ #define _POSIX_C_SOURCE 200809L /* for fileno */ #define _BSD_SOURCE 1 /* for realpath, symlink */ #define _DEFAULT_SOURCE 1 /* for realpath, symlink */ +#define __BSD_VISIBLE 1 #ifdef __APPLE__ # define _DARWIN_C_SOURCE 1 /* for flock */ @@ -39,6 +40,8 @@ #endif #if USE_FLOCK && USE_FILENO +# include +# # include #endif diff --git a/test/test_util.c b/test/test_util.c index 8c8f36a..b49b14e 100644 --- a/test/test_util.c +++ b/test/test_util.c @@ -15,6 +15,7 @@ */ #define _XOPEN_SOURCE 600 /* for mkstemp */ +#define __BSD_VISIBLE 1 #undef NDEBUG diff --git a/test/test_value.c b/test/test_value.c index b36737a..82b44b7 100644 --- a/test/test_value.c +++ b/test/test_value.c @@ -72,12 +72,6 @@ main(void) assert(fabs(lilv_node_as_float(fval) - 1.6180) < FLT_EPSILON); assert(isnan(lilv_node_as_float(sval))); -#if defined(__clang__) -# pragma clang diagnostic pop -#elif defined(__GNUC__) && __GNUC__ > 4 -# pragma GCC diagnostic pop -#endif - LilvNode* loc_abs = lilv_new_file_uri(world, NULL, "/foo/bar"); LilvNode* loc_rel = lilv_new_file_uri(world, NULL, "foo"); LilvNode* host_abs = lilv_new_file_uri(world, "host", "/foo/bar"); -- cgit v1.2.1