aboutsummaryrefslogtreecommitdiff
path: root/src/string.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-07-09 15:27:45 +0100
committerGitHub <noreply@github.com>2024-07-09 15:27:45 +0100
commit9782d7b928a0aea4ed86f6a51ef8593bcc14fb7e (patch)
treebf26703022465f3902fbf4fc5e29da54ba61e1ba /src/string.cpp
parent9575d85f1aadf6ad501328990b9017d825096750 (diff)
parent5627af582a7882c640f0f4c5b285bafb6377fce1 (diff)
Merge pull request #3896 from odin-lang/cached-builds
Internal Cached Builds
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 42bf51f80..3c7d96934 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) {