xref: /OK3568_Linux_fs/buildroot/package/android-tools/0007-include-cdefs-h-when-needed.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Include cdefs.h wherever it is needed
2
3cdefs.h is included from within a lot of glibc headers, so it almost
4invariably and automagically gets pulled in with glibc.
5
6However, this might not be the case with other C libraries. musl does
7not provide cdefs.h so it does not include it from its own headers
8(cdefs.h must be provided separately).
9
10So we must include it when we are going to use macros it provides.
11
12Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
13---
14 core/adbd/services.c                  |  1 +
15 core/libcutils/android_reboot.c       |  1 +
16 2 files changed, 2 insertions(+), 0 deletion(-)
17
18diff --git a/core/adbd/services.c b/core/adbd/services.c
19index 20c08d2..48e0241 100644
20--- a/core/adbd/services.c
21+++ b/core/adbd/services.c
22@@ -20,6 +20,7 @@
23 #include <string.h>
24 #include <errno.h>
25 #include <pwd.h>
26+#include <sys/cdefs.h>
27
28 #include "sysdeps.h"
29
30diff --git a/core/libcutils/android_reboot.c b/core/libcutils/android_reboot.c
31index 20c08d2..48e0241 100644
32--- a/core/libcutils/android_reboot.c
33+++ b/core/libcutils/android_reboot.c
34@@ -23,6 +23,7 @@
35 #include <string.h>
36 #include <linux/reboot.h>
37 #include <sys/syscall.h>
38+#include <sys/cdefs.h>
39
40 #include <cutils/android_reboot.h>
41
42