From: Michal Privoznik Date: Wed, 7 Feb 2024 12:28:15 +0000 (+0100) Subject: examples: Define _GNU_SOURCE for more examples X-Git-Tag: v10.1.0-rc1~89 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ef6541cecde4ebc16bcfc9c5860006f0d8fb2a9;p=thirdparty%2Flibvirt.git examples: Define _GNU_SOURCE for more examples 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 --- 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