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/string.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/string.h') diff --git a/include/string.h b/include/string.h index 9f7d462..2f513ca 100644 --- a/include/string.h +++ b/include/string.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)) void * __fortify_memcpy(void *dest, const void *src, size_t n) @@ -186,6 +190,10 @@ __fortify_strlcpy(char *dest, const char *src, size_t n) #define strlcpy(dest, src, n) __fortify_strlcpy(dest, src, n) #endif +#ifdef __cplusplus +} +#endif + #endif #endif -- cgit v1.3