diff options
Diffstat (limited to 'meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch')
-rw-r--r-- | meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch b/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch new file mode 100644 index 0000000000..5b0c444be7 --- /dev/null +++ b/meta/recipes-extended/ltp/ltp/0010-replace-__BEGIN_DECLS-and-__END_DECLS.patch | |||
@@ -0,0 +1,73 @@ | |||
1 | From 0130f4146ced320aadb01b22e36b13d269a8ebba Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 7 Jan 2016 19:48:14 +0000 | ||
4 | Subject: [PATCH 10/32] replace __BEGIN_DECLS and __END_DECLS | ||
5 | |||
6 | They are not portable across libc implementations | ||
7 | therefore replace them with expanded macros | ||
8 | |||
9 | Include <asm-generic/types.h> to get __s32 definitions | ||
10 | its not a generally available typedef | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | testcases/kernel/syscalls/epoll2/include/epoll.h | 8 ++++++-- | ||
15 | utils/sctp/include/netinet/sctp.h | 9 +++++++-- | ||
16 | 2 files changed, 13 insertions(+), 4 deletions(-) | ||
17 | |||
18 | diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h | ||
19 | index be599c7..8cc5e7e 100644 | ||
20 | --- a/testcases/kernel/syscalls/epoll2/include/epoll.h | ||
21 | +++ b/testcases/kernel/syscalls/epoll2/include/epoll.h | ||
22 | @@ -85,7 +85,9 @@ struct epoll_event | ||
23 | } EPOLL_PACKED; | ||
24 | |||
25 | |||
26 | -__BEGIN_DECLS | ||
27 | +#ifdef __cplusplus | ||
28 | +extern "C" { | ||
29 | +#endif | ||
30 | |||
31 | /* Creates an epoll instance. Returns an fd for the new instance. | ||
32 | The "size" parameter is a hint specifying the number of file | ||
33 | @@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd, | ||
34 | extern int epoll_wait (int __epfd, struct epoll_event *__events, | ||
35 | int __maxevents, int __timeout) __THROW; | ||
36 | |||
37 | -__END_DECLS | ||
38 | +#ifdef __cplusplus | ||
39 | +} | ||
40 | +#endif | ||
41 | |||
42 | #endif /* sys/epoll.h */ | ||
43 | diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h | ||
44 | index 51f5bfb..c61aef3 100644 | ||
45 | --- a/utils/sctp/include/netinet/sctp.h | ||
46 | +++ b/utils/sctp/include/netinet/sctp.h | ||
47 | @@ -35,9 +35,12 @@ | ||
48 | |||
49 | #include <stdint.h> | ||
50 | #include <linux/types.h> | ||
51 | +#include <asm-generic/types.h> | ||
52 | #include <sys/socket.h> | ||
53 | |||
54 | -__BEGIN_DECLS | ||
55 | +#ifdef __cplusplus | ||
56 | +extern "C" { | ||
57 | +#endif | ||
58 | |||
59 | typedef __s32 sctp_assoc_t; | ||
60 | |||
61 | @@ -862,6 +865,8 @@ int sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from, | ||
62 | /* Return the address length for an address family. */ | ||
63 | int sctp_getaddrlen(sa_family_t family); | ||
64 | |||
65 | -__END_DECLS | ||
66 | +#ifdef __cplusplus | ||
67 | +} | ||
68 | +#endif | ||
69 | |||
70 | #endif /* __linux_sctp_h__ */ | ||
71 | -- | ||
72 | 2.7.0 | ||
73 | |||