aboutsummaryrefslogtreecommitdiff
path: root/projects/cros-ec/patches/veyron/0002-use-_DEFAULT_SOURCE-for-newer-glibc.patch
blob: 7da2c967bf750c92ba56a6816cee42b8e99e5cc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From d2f946caf27adf4518cb657da39e296366d0b53f Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@chromium.org>
Date: Mon, 7 Dec 2015 21:46:13 -0500
Subject: [PATCH 2/6] 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>
---
 util/ec_uartd.c | 3 ++-
 util/stm32mon.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/util/ec_uartd.c b/util/ec_uartd.c
index 82823c4..678932e 100644
--- a/util/ec_uartd.c
+++ b/util/ec_uartd.c
@@ -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
diff --git a/util/stm32mon.c b/util/stm32mon.c
index 2de9400..ed1a7ee 100644
--- a/util/stm32mon.c
+++ b/util/stm32mon.c
@@ -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>
-- 
2.9.0