Commit fb2385900d6586a4e6f77cc901d7523320921926

Nick Gasson 2014-01-06T11:01:41

Add extern "C" around linenoise.h when compiled as C++

diff --git a/linenoise.h b/linenoise.h
index b0a168e..9549c91 100644
--- a/linenoise.h
+++ b/linenoise.h
@@ -37,6 +37,10 @@
 #ifndef __LINENOISE_H
 #define __LINENOISE_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef struct linenoiseCompletions {
   size_t len;
   char **cvec;
@@ -54,4 +58,8 @@ int linenoiseHistoryLoad(const char *filename);
 void linenoiseClearScreen(void);
 void linenoiseSetMultiLine(int ml);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __LINENOISE_H */