Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 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> |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 13 | |
| 14 | Upstream-Status: Pending |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 15 | --- |
| 16 | testcases/kernel/syscalls/epoll2/include/epoll.h | 8 ++++++-- |
| 17 | utils/sctp/include/netinet/sctp.h | 9 +++++++-- |
| 18 | 2 files changed, 13 insertions(+), 4 deletions(-) |
| 19 | |
| 20 | diff --git a/testcases/kernel/syscalls/epoll2/include/epoll.h b/testcases/kernel/syscalls/epoll2/include/epoll.h |
| 21 | index be599c7..8cc5e7e 100644 |
| 22 | --- a/testcases/kernel/syscalls/epoll2/include/epoll.h |
| 23 | +++ b/testcases/kernel/syscalls/epoll2/include/epoll.h |
| 24 | @@ -85,7 +85,9 @@ struct epoll_event |
| 25 | } EPOLL_PACKED; |
| 26 | |
| 27 | |
| 28 | -__BEGIN_DECLS |
| 29 | +#ifdef __cplusplus |
| 30 | +extern "C" { |
| 31 | +#endif |
| 32 | |
| 33 | /* Creates an epoll instance. Returns an fd for the new instance. |
| 34 | The "size" parameter is a hint specifying the number of file |
| 35 | @@ -114,6 +116,8 @@ extern int epoll_ctl (int __epfd, int __op, int __fd, |
| 36 | extern int epoll_wait (int __epfd, struct epoll_event *__events, |
| 37 | int __maxevents, int __timeout) __THROW; |
| 38 | |
| 39 | -__END_DECLS |
| 40 | +#ifdef __cplusplus |
| 41 | +} |
| 42 | +#endif |
| 43 | |
| 44 | #endif /* sys/epoll.h */ |
| 45 | diff --git a/utils/sctp/include/netinet/sctp.h b/utils/sctp/include/netinet/sctp.h |
| 46 | index 51f5bfb..c61aef3 100644 |
| 47 | --- a/utils/sctp/include/netinet/sctp.h |
| 48 | +++ b/utils/sctp/include/netinet/sctp.h |
| 49 | @@ -35,9 +35,12 @@ |
| 50 | |
| 51 | #include <stdint.h> |
| 52 | #include <linux/types.h> |
| 53 | +#include <asm-generic/types.h> |
| 54 | #include <sys/socket.h> |
| 55 | |
| 56 | -__BEGIN_DECLS |
| 57 | +#ifdef __cplusplus |
| 58 | +extern "C" { |
| 59 | +#endif |
| 60 | |
| 61 | typedef __s32 sctp_assoc_t; |
| 62 | |
| 63 | @@ -862,6 +865,8 @@ int sctp_recvmsg(int s, void *msg, size_t len, struct sockaddr *from, |
| 64 | /* Return the address length for an address family. */ |
| 65 | int sctp_getaddrlen(sa_family_t family); |
| 66 | |
| 67 | -__END_DECLS |
| 68 | +#ifdef __cplusplus |
| 69 | +} |
| 70 | +#endif |
| 71 | |
| 72 | #endif /* __linux_sctp_h__ */ |
| 73 | -- |
| 74 | 2.7.0 |
| 75 | |