From d5296df68396ae6a2adfa093a04ad465a043e07d Mon Sep 17 00:00:00 2001 From: Ricky Su Date: Thu, 27 Aug 2015 13:58:36 +0800 Subject: [PATCH] add extern c in c++ --- include/r3.h | 1 + include/r3_str.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/r3.h b/include/r3.h index dc7cbda..fe1926d 100644 --- a/include/r3.h +++ b/include/r3.h @@ -14,6 +14,7 @@ #include #include "r3_define.h" #include "str_array.h" +#include "r3_str.h" #ifdef __cplusplus extern "C" { diff --git a/include/r3_str.h b/include/r3_str.h index b44ff7f..1243697 100644 --- a/include/r3_str.h +++ b/include/r3_str.h @@ -7,8 +7,9 @@ #ifndef STR_H #define STR_H -#include "r3.h" -#include "config.h" +#ifdef __cplusplus +extern "C" { +#endif char * r3_slug_compile(const char * str, int len); @@ -51,6 +52,9 @@ char *strdup(const char *s); char *strndup(const char *s, int n); #endif +#ifdef __cplusplus +} +#endif #endif /* !STR_H */