aboutsummaryrefslogtreecommitdiff
path: root/projects/cros-ec/patches/nyan/0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch
blob: ef3d40dc0473ebab01e44d9456855ba00d580507 (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 b98bd2808f4185970781bd4dcca141cbda9b03c6 Mon Sep 17 00:00:00 2001
From: Mike Frysinger <vapier@chromium.org>
Date: Mon, 7 Dec 2015 21:46:13 -0500
Subject: [PATCH 1/4] 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 fbf4a5e..bfd0642 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 2e73bcf..f65cd64 100644
--- a/util/stm32mon.c
+++ b/util/stm32mon.c
@@ -6,7 +6,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