From 8604f138c55ab4904a2fd9b7edce2b688c70e6c0 Mon Sep 17 00:00:00 2001 From: sin Date: Wed, 11 Mar 2015 09:26:11 +0000 Subject: Add ifdef guards for C++ code --- include/sys/select.h | 8 ++++++++ include/sys/socket.h | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'include/sys') diff --git a/include/sys/select.h b/include/sys/select.h index 9101b51..50bdb6a 100644 --- a/include/sys/select.h +++ b/include/sys/select.h @@ -5,6 +5,10 @@ #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 +#ifdef __cplusplus +extern "C" { +#endif + static inline __attribute__ ((always_inline)) int __fortify_FD_CLR(int fd, fd_set *set) @@ -32,6 +36,10 @@ __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 #endif diff --git a/include/sys/socket.h b/include/sys/socket.h index 7044f65..fc7381a 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -5,6 +5,10 @@ #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 +#ifdef __cplusplus +extern "C" { +#endif + static inline __attribute__ ((always_inline)) ssize_t __fortify_recv(int sockfd, void *buf, size_t n, int flags) @@ -60,6 +64,10 @@ __fortify_sendto(int sockfd, const void *buf, size_t n, int flags, #undef sendto #define sendto(sockfd, buf, n, flags, sa, salen) __fortify_sendto(sockfd, buf, n, flags, sa, salen) +#ifdef __cplusplus +} +#endif + #endif #endif -- cgit v1.3