add extern c in c++

This commit is contained in:
Ricky Su 2015-08-27 13:58:36 +08:00
parent 5eb3e483b3
commit d5296df683
2 changed files with 7 additions and 2 deletions

View file

@ -14,6 +14,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "r3_define.h" #include "r3_define.h"
#include "str_array.h" #include "str_array.h"
#include "r3_str.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View file

@ -7,8 +7,9 @@
#ifndef STR_H #ifndef STR_H
#define STR_H #define STR_H
#include "r3.h" #ifdef __cplusplus
#include "config.h" extern "C" {
#endif
char * r3_slug_compile(const char * str, int len); 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); char *strndup(const char *s, int n);
#endif #endif
#ifdef __cplusplus
}
#endif
#endif /* !STR_H */ #endif /* !STR_H */