[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH libguestfs 5/5] build: don't define _GNU_SOURCE manually



From: Jim Meyering <meyering redhat com>

Now that we're using gnulib in earnest, any manual definition
would provoke a redefinition warning.
* fish/fish.c (_GNU_SOURCE): Don't define.
* fish/destpaths.c (_GNU_SOURCE): Likewise.
* src/guestfs.c (_GNU_SOURCE): Likewise.
* bootstrap (modules): Add asprintf, strchrnul, strerror, strndup
and vasprintf.
* fish/fish.c (main): Set argv[0] to sanitized program_name, so
functions like getopt_long that use argv[0] use the clean name.
---
 bootstrap        |    7 ++++++-
 fish/destpaths.c |    2 --
 fish/fish.c      |    2 --
 src/guestfs.c    |    1 -
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bootstrap b/bootstrap
index f5f8aaf..2eba6a7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -50,6 +50,7 @@ gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
 (cd daemon && mkdir -p tests lib && ../$gnulib_tool --update)

 modules='
+asprintf
 closeout
 gitlog-to-changelog
 gnu-make
@@ -58,8 +59,12 @@ ignore-value
 maintainer-makefile
 manywarnings
 progname
-warnings
+strchrnul
+strerror
+strndup
+vasprintf
 vc-list-files
+warnings
 '

 $gnulib_tool			\
diff --git a/fish/destpaths.c b/fish/destpaths.c
index 275db49..1e42ae8 100644
--- a/fish/destpaths.c
+++ b/fish/destpaths.c
@@ -18,8 +18,6 @@

 #include <config.h>

-#define _GNU_SOURCE		// for strndup, asprintf
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
diff --git a/fish/fish.c b/fish/fish.c
index 1790c1a..9f0f8df 100644
--- a/fish/fish.c
+++ b/fish/fish.c
@@ -18,8 +18,6 @@

 #include <config.h>

-#define _GNU_SOURCE // for strchrnul
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/src/guestfs.c b/src/guestfs.c
index 04bd4e8..4a9f11a 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -19,7 +19,6 @@
 #include <config.h>

 #define _BSD_SOURCE /* for mkdtemp, usleep */
-#define _GNU_SOURCE /* for vasprintf, GNU strerror_r, strchrnul */

 #include <stdio.h>
 #include <stdlib.h>
-- 
1.6.4.378.g88f2f


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]