blob: 5b0c444be7541a5362b5cecb1363997a5e1bb16b [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 0130f4146ced320aadb01b22e36b13d269a8ebba Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 7 Jan 2016 19:48:14 +0000
4Subject: [PATCH 10/32] replace __BEGIN_DECLS and __END_DECLS
5
6They are not portable across libc implementations
7therefore replace them with expanded macros
8
9Include <asm-generic/types.h> to get __s32 definitions
10its not a generally available typedef
11
12Signed-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
18diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h
19index 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 */
43diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h
44index 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--
722.7.0
73