use _DEFAULT_SOURCE for newer glibc

Newer versions of glibc have moved to _DEFAULT_SOURCE and away from
_BSD_SOURCE.  Trying to use the BSD define by itself leads to warnings
which causes build failures.

BRANCH=none
BUG=None
TEST=precq still works

Signed-off-by: Mike Frysinger <vapier@chromium.org>
Change-Id: Ice24b84dc6a540695fc7b76e8f22a4c85c301976
Reviewed-on: https://chromium-review.googlesource.com/316730
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Mike Frysinger
2015-12-07 21:46:13 -05:00
committed by chrome-bot
parent 9af4610be4
commit 85cac7ec14
2 changed files with 4 additions and 2 deletions

View File

@@ -11,7 +11,8 @@
*/
/* Force header files to define grantpt(), posix_openpt(), cfmakeraw() */
#define _BSD_SOURCE
#define _DEFAULT_SOURCE /* Newer glibc */
#define _BSD_SOURCE /* Older glibc */
#define _XOPEN_SOURCE 600
/* Force header file to declare ptsname_r(), etc. */
#ifndef _GNU_SOURCE

View File

@@ -13,7 +13,8 @@
*/
/* use cfmakeraw() */
#define _BSD_SOURCE
#define _DEFAULT_SOURCE /* Newer glibc */
#define _BSD_SOURCE /* Older glibc */
#include <arpa/inet.h>
#include <errno.h>