From d85e0a7893ae857204e5ec3f0f4891cfb2e8ac4a Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 10 Feb 2021 15:22:31 +0000 Subject: [PATCH 1/2] =?UTF-8?q?ascli:=20Don=E2=80=99t=20use=20GNU=20C=20ex?= =?UTF-8?q?tension=20type=20names?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Philip Withnall --- tools/ascli-actions-mdata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ascli-actions-mdata.c b/tools/ascli-actions-mdata.c index 2230917a..22e53e3c 100644 --- a/tools/ascli-actions-mdata.c +++ b/tools/ascli-actions-mdata.c @@ -209,7 +209,7 @@ ascli_what_provides (const gchar *cachepath, const gchar *kind_str, const gchar kind = as_provided_kind_from_string (kind_str); if (kind == AS_PROVIDED_KIND_UNKNOWN) { - uint i; + unsigned int i; g_printerr ("%s\n", _("Invalid type for provided item selected. Valid values are:")); for (i = 1; i < AS_PROVIDED_KIND_LAST; i++) g_printerr (" • %s\n", as_provided_kind_to_string (i)); From 8c86c0e825e6723319fb96c21e6edec77f842343 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 10 Feb 2021 15:22:49 +0000 Subject: [PATCH 2/2] build: Use c11 rather than gnu11 and define vendor extensions separately This makes the code a little more amenable to being built as a subproject for projects like gnome-software, which use standard C. See `man 7 feature_test_macros` for details of the vendor extension macros. Signed-off-by: Philip Withnall --- meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index a76ebc4f..dc1fb1a5 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('AppStream', 'c', meson_version: '>=0.48', - default_options: ['c_std=gnu11', 'cpp_std=gnu++14'], + default_options: ['c_std=c11', 'cpp_std=gnu++14'], license: 'LGPL-2.1+ and GPL-2.0+', version: '0.14.1', @@ -80,6 +80,9 @@ add_project_arguments('-Werror=implicit-function-declaration', '-Wno-unused-para add_project_arguments('-Wno-unused-parameter', language: 'cpp') add_project_arguments('-DAS_COMPILATION', language: 'c') +# Vendor extensions in system headers +add_project_arguments('-D_POSIX_C_SOURCE=200112L', language: 'c') + # # Dependencies #