From 9ef6541cecde4ebc16bcfc9c5860006f0d8fb2a9 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 7 Feb 2024 13:28:15 +0100 Subject: [PATCH] examples: Define _GNU_SOURCE for more examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some of our examples use GNU/Linux extensions functions/variables: 1) domtop.c uses usleep(3), 2) logging.c uses getopt(3). Put _GNU_SOURCE definition at the top of corresponding files so that users can just grab the code and compile it (in contrast with the rest of the code where _GNU_SOURCE is declared in meson-config.h). Signed-off-by: Michal Privoznik Reviewed-by: Ján Tomko --- examples/c/admin/logging.c | 1 + examples/c/domain/domtop.c | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/c/admin/logging.c b/examples/c/admin/logging.c index 575d15a3a6..f7620b2ab5 100644 --- a/examples/c/admin/logging.c +++ b/examples/c/admin/logging.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include #include diff --git a/examples/c/domain/domtop.c b/examples/c/domain/domtop.c index 65663a1c39..2345a5953c 100644 --- a/examples/c/domain/domtop.c +++ b/examples/c/domain/domtop.c @@ -18,6 +18,7 @@ * . */ +#define _GNU_SOURCE #include #include #include