0007-Include-cdefs.h-wherever-it-is-needed.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From d3f0157bf2ac1afc9a810ccbe188110df724129d Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Sun, 1 Dec 2024 15:46:15 +0100
  4. Subject: [PATCH] Include cdefs.h wherever it is needed
  5. cdefs.h is included from within a lot of glibc headers, so it almost
  6. invariably and automagically gets pulled in with glibc.
  7. However, this might not be the case with other C libraries. musl does
  8. not provide cdefs.h so it does not include it from its own headers
  9. (cdefs.h must be provided separately).
  10. So we must include it when we are going to use macros it provides.
  11. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  12. ---
  13. core/adbd/services.c | 1 +
  14. core/libcutils/android_reboot.c | 1 +
  15. 2 files changed, 2 insertions(+)
  16. diff --git a/core/adbd/services.c b/core/adbd/services.c
  17. index 5adcefe..6de1951 100644
  18. --- a/core/adbd/services.c
  19. +++ b/core/adbd/services.c
  20. @@ -20,6 +20,7 @@
  21. #include <string.h>
  22. #include <errno.h>
  23. #include <pwd.h>
  24. +#include <sys/cdefs.h>
  25. #include "sysdeps.h"
  26. diff --git a/core/libcutils/android_reboot.c b/core/libcutils/android_reboot.c
  27. index 79c05f8..9386006 100644
  28. --- a/core/libcutils/android_reboot.c
  29. +++ b/core/libcutils/android_reboot.c
  30. @@ -23,6 +23,7 @@
  31. #include <string.h>
  32. #include <linux/reboot.h>
  33. #include <sys/syscall.h>
  34. +#include <sys/cdefs.h>
  35. #include <cutils/android_reboot.h>
  36. --
  37. 2.47.0