diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2017-11-09 11:35:21 -0600 |
---|---|---|
committer | Eric Sandeen <sandeen@redhat.com> | 2017-11-09 11:35:21 -0600 |
commit | c143657382578abfb77e22e2dc9c3b175d55325a (patch) | |
tree | 45a708b592d6ae04aef6d8e3af27194574768753 /m4 | |
parent | 070c4a9364978d708d48b770f0371029cc5c43b7 (diff) | |
download | xfsprogs-dev-c143657382578abfb77e22e2dc9c3b175d55325a.tar.gz |
build: define _DEFAULT_SOURCE with _BSD_SOURCE for preadv
_BSD_SOURCE has been deprecated and replaced with _DEFAULT_SOURCE
for feature test macros. We use this for preadv in the configure
script, but the latest preadv(2) manpage says:
preadv(), pwritev():
since glibc 2.19:
_DEFAULT_SOURCE
Glibc 2.19 and earlier:
_BSD_SOURCE
and the latest feature_test_macros(7) manpage says:
Since glibc 2.20, this macro is deprecated. It now has the same
effect as defining _DEFAULT_SOURCE, but generates a compile-time
warning (unless _DEFAULT_SOURCE is also defined). Use
_DEFAULT_SOURCE instead. To allow code that requires
_BSD_SOURCE in glibc 2.19 and earlier and _DEFAULT_SOURCE in
glibc 2.20 and later to compile without warnings, define both
_BSD_SOURCE and _DEFAULT_SOURCE.
So add both to our configure test. They were completely missing
from the actual preadv usage in xfs_io, so add them there too.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
[sandeen@redhat.com: clarify changelog, add defines to code use too]
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Diffstat (limited to 'm4')
-rw-r--r-- | m4/package_libcdev.m4 | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index fa5b639787..af2a9631b8 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -137,6 +137,7 @@ AC_DEFUN([AC_HAVE_PREADV], [ AC_MSG_CHECKING([for preadv]) AC_TRY_LINK([ #define _BSD_SOURCE +#define _DEFAULT_SOURCE #include <sys/uio.h> ], [ preadv(0, 0, 0, 0); |