From 5da47deadde627b1849e21aa97fa3522cef73340 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 13 Apr 2022 11:01:09 +0200 Subject: [PATCH] Squashed 'src/c-stdaux/' changes from 8652c488b8f1..9582a563c25e 9582a563c25e build: update dependency handling c1cda3600991 test: remove possible wrong warning in possible unused variable git-subtree-dir: src/c-stdaux git-subtree-split: 9582a563c25e75896794a7b32e4d6b0f0bdfa19a --- README.md | 2 +- meson.build | 7 +++++-- src/meson.build | 6 +++--- src/test-basic.c | 8 ++++---- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 51bff9778f..124c692e12 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The requirements for this project are: At build-time, the following software is required: - * `meson >= 0.41` + * `meson >= 0.60` * `pkg-config >= 0.29` ### Build diff --git a/meson.build b/meson.build index c8c5da536f..367d8b5fee 100644 --- a/meson.build +++ b/meson.build @@ -1,15 +1,18 @@ project( 'c-stdaux', 'c', - version: '1', - license: 'Apache', default_options: [ 'c_std=c11' ], + license: 'Apache', + version: '1.0.0', ) +major = meson.project_version().split('.')[0] project_description = 'Auxiliary macros and functions for the C standard library' add_project_arguments('-D_GNU_SOURCE', language: 'c') mod_pkgconfig = import('pkgconfig') subdir('src') + +meson.override_dependency('libcstdaux-'+major, libcstdaux_dep, static: true) diff --git a/src/meson.build b/src/meson.build index f6db824d24..7c2e3a13ca 100644 --- a/src/meson.build +++ b/src/meson.build @@ -13,10 +13,10 @@ if not meson.is_subproject() install_headers('c-stdaux.h') mod_pkgconfig.generate( - version: meson.project_version(), - name: 'libcstdaux', - filebase: 'libcstdaux', description: project_description, + filebase: 'libcstdaux-'+major, + name: 'libcstdaux', + version: meson.project_version(), ) endif diff --git a/src/test-basic.c b/src/test-basic.c index d58d561d23..15499353cb 100644 --- a/src/test-basic.c +++ b/src/test-basic.c @@ -359,7 +359,7 @@ static void test_destructors(void) { /* make sure c_closep() deals fine with negative FDs */ { - _c_cleanup_(c_closep) int t = 0; + _c_cleanup_(c_closep) _c_unused_ int t = 0; t = -1; } @@ -370,7 +370,7 @@ static void test_destructors(void) { * path works as well. */ for (i = 0; i < 2; ++i) { - _c_cleanup_(c_closep) int t = -1; + _c_cleanup_(c_closep) _c_unused_ int t = -1; t = eventfd(0, EFD_CLOEXEC); c_assert(t >= 0); @@ -401,7 +401,7 @@ static void test_destructors(void) { /* make sure c_flosep() deals fine with NULL */ { - _c_cleanup_(c_fclosep) FILE *t = (void *)0xdeadbeef; + _c_cleanup_(c_fclosep) _c_unused_ FILE *t = (void *)0xdeadbeef; t = NULL; } @@ -412,7 +412,7 @@ static void test_destructors(void) { * path works as well. */ for (i = 0; i < 2; ++i) { - _c_cleanup_(c_fclosep) FILE *t = NULL; + _c_cleanup_(c_fclosep) _c_unused_ FILE *t = NULL; int tfd; tfd = eventfd(0, EFD_CLOEXEC);