mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
build: don't define _GNU_SOURCE manually
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.
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define _GNU_SOURCE // for strndup, asprintf
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#define _GNU_SOURCE // for strchrnul
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user