From d12254166a55d17932ea4143fbd50fb52539ff8b Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 13 Mar 2015 23:09:15 +0000 Subject: Restore C++ support --- include/sys/select.h | 6 +++++- include/sys/socket.h | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'include/sys') diff --git a/include/sys/select.h b/include/sys/select.h index 7838041..9c3afa5 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -5,7 +5,9 @@ #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 -#ifndef __cplusplus +#ifdef __cplusplus +extern "C" { +#endif static __inline __attribute__((__always_inline__,__gnu_inline__)) int __fortify_FD_CLR(int fd, fd_set *set) @@ -32,6 +34,8 @@ int __fortify_FD_SET(int fd, fd_set *set) #undef FD_SET #define FD_SET(fd, set) __fortify_FD_SET(fd, set) +#ifdef __cplusplus +} #endif #endif diff --git a/include/sys/socket.h b/include/sys/socket.h index 4602866..81358fd 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -5,7 +5,10 @@ #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 -#ifndef __cplusplus +#ifdef __cplusplus +extern "C" { +#endif + #undef recv #undef recvfrom #undef send @@ -61,6 +64,8 @@ ssize_t sendto(int sockfd, const void *buf, size_t n, int flags, return __sendto_orig(sockfd, buf, n, flags, sa, salen); } +#ifdef __cplusplus +} #endif #endif -- cgit v1.3