aboutsummaryrefslogtreecommitdiffstats
path: root/gb_string.h
diff options
context:
space:
mode:
authorGravatar gingerBill 2015-09-27 10:29:13 +0100
committerGravatar gingerBill 2015-09-27 10:29:13 +0100
commita247237ee86e52a3bdbfcbc2b714281099a9fe89 (patch)
tree01771008c048a4637c3f558052bc9749259a4b4b /gb_string.h
parentAdd gb_ini.h (diff)
Add extern "C" if compiling as C++
Diffstat (limited to '')
-rw-r--r--gb_string.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/gb_string.h b/gb_string.h
index 7d777b1..c5bd397 100644
--- a/gb_string.h
+++ b/gb_string.h
@@ -1,7 +1,8 @@
-// gb_string.h - v0.91 - public domain string library - no warranty implied; use at your own risk
+// gb_string.h - v0.92 - public domain string library - no warranty implied; use at your own risk
// A Simple Dynamic Strings Library for C and C++
//
// Version History:
+// 0.92 - Add extern "C" if compiling as C++
// 0.91 - Remove `char* cstr` from String_Header
// 0.90 - Initial Version
//
@@ -207,6 +208,10 @@ void string_test()
#include <string.h> // Needed for memcpy and cstring functions
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef char* gb_String;
typedef signed int gb_bool;
@@ -265,6 +270,11 @@ gb_bool gb_strings_are_equal(const gb_String lhs, const gb_String rhs);
gb_String gb_trim_string(gb_String str, const char* cut_set);
+
+#ifdef __cplusplus
+}
+#endif
+
#ifdef GB_STRING_IMPLEMENTATION
static void gb_set_string_length(gb_String str, gb_usize len)
{