aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-07-08 23:39:14 +0100
committergingerBill <bill@gingerbill.org>2024-07-08 23:39:14 +0100
commit87ac68fcf2b5fcaa02118929b820e61bbd8c10c4 (patch)
treee39b1d5203b780d611a67f4bddb3e9c60689df4c /src/string.cpp
parent48aef5016499291996f0710449a26f1f92078d51 (diff)
Add `-internal-cached`
Diffstat (limited to 'src/string.cpp')
-rw-r--r--src/string.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/string.cpp b/src/string.cpp
index ab08e3d4a..a39d93ad9 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -88,6 +88,13 @@ gb_internal char *alloc_cstring(gbAllocator a, String s) {
return c_str;
}
+gb_internal wchar_t *alloc_wstring(gbAllocator a, String16 s) {
+ wchar_t *c_str = gb_alloc_array(a, wchar_t, s.len+1);
+ gb_memmove(c_str, s.text, s.len*2);
+ c_str[s.len] = '\0';
+ return c_str;
+}
+
gb_internal gb_inline bool str_eq_ignore_case(String const &a, String const &b) {
if (a.len == b.len) {