0001-use-_DEFAULT_SOURCE-for-newer-glibc.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From b98bd2808f4185970781bd4dcca141cbda9b03c6 Mon Sep 17 00:00:00 2001
  2. From: Mike Frysinger <vapier@chromium.org>
  3. Date: Mon, 7 Dec 2015 21:46:13 -0500
  4. Subject: [PATCH 1/4] use _DEFAULT_SOURCE for newer glibc
  5. Newer versions of glibc have moved to _DEFAULT_SOURCE and away from
  6. _BSD_SOURCE. Trying to use the BSD define by itself leads to warnings
  7. which causes build failures.
  8. BRANCH=none
  9. BUG=None
  10. TEST=precq still works
  11. Signed-off-by: Mike Frysinger <vapier@chromium.org>
  12. Change-Id: Ice24b84dc6a540695fc7b76e8f22a4c85c301976
  13. Reviewed-on: https://chromium-review.googlesource.com/316730
  14. Reviewed-by: Bill Richardson <wfrichar@chromium.org>
  15. ---
  16. util/ec_uartd.c | 3 ++-
  17. util/stm32mon.c | 3 ++-
  18. 2 files changed, 4 insertions(+), 2 deletions(-)
  19. diff --git a/util/ec_uartd.c b/util/ec_uartd.c
  20. index fbf4a5e..bfd0642 100644
  21. --- a/util/ec_uartd.c
  22. +++ b/util/ec_uartd.c
  23. @@ -11,7 +11,8 @@
  24. */
  25. /* Force header files to define grantpt(), posix_openpt(), cfmakeraw() */
  26. -#define _BSD_SOURCE
  27. +#define _DEFAULT_SOURCE /* Newer glibc */
  28. +#define _BSD_SOURCE /* Older glibc */
  29. #define _XOPEN_SOURCE 600
  30. /* Force header file to declare ptsname_r(), etc. */
  31. #ifndef _GNU_SOURCE
  32. diff --git a/util/stm32mon.c b/util/stm32mon.c
  33. index 2e73bcf..f65cd64 100644
  34. --- a/util/stm32mon.c
  35. +++ b/util/stm32mon.c
  36. @@ -6,7 +6,8 @@
  37. */
  38. /* use cfmakeraw() */
  39. -#define _BSD_SOURCE
  40. +#define _DEFAULT_SOURCE /* Newer glibc */
  41. +#define _BSD_SOURCE /* Older glibc */
  42. #include <arpa/inet.h>
  43. #include <errno.h>
  44. --
  45. 2.9.0