aboutsummaryrefslogtreecommitdiffstats
path: root/package/libs/elfutils/patches/110-no-cdefs.patch
blob: f95625a91310ef531da629a75cf99b9c069d629b (plain)
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
From e399540ab67ffe83ca3c4cb768a2f0f2f32a9057 Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sun, 5 Apr 2020 15:56:59 -0700
Subject: [PATCH] libelf: remove usage of sys/cdefs

sys/cdefs is a deprecated glibc header that is unavailable with other
libc implementations such as musl.

features.h under glibc includes sys/cdefs whereas it does not under musl.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 lib/fixedsizehash.h |  1 -
 libelf/elf.h        | 10 ++++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

--- a/lib/fixedsizehash.h
+++ b/lib/fixedsizehash.h
@@ -30,7 +30,6 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/cdefs.h>
 
 #include <system.h>
 
--- a/libelf/elf.h
+++ b/libelf/elf.h
@@ -19,9 +19,9 @@
 #ifndef _ELF_H
 #define	_ELF_H 1
 
-#include <features.h>
-
-__BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* Standard ELF types.  */
 
@@ -4103,6 +4103,8 @@ enum
 #define R_ARC_TLS_LE_S9		0x4a
 #define R_ARC_TLS_LE_32		0x4b
 
-__END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif	/* elf.h */