summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-03-15 16:35:11 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-03-15 16:35:11 +0300
commitf621aac0cb42e0de9de6f1f05a0b4383eb791930 (patch)
tree92aa45efbd961da93cd0a76f73b6018a205d337e /src
parente183822028662cdd47d31c5f23fd9842c32cba6a (diff)
newStrW - Unicode version of the newStr() function
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
-rw-r--r--src/mir_core/src/utils.cpp8
3 files changed, 10 insertions, 0 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 9296b22011..1182fddbd6 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1577,3 +1577,4 @@ _newStr@4 @1789 NONAME
?Copy@MClipRtf@@UBEXXZ @1802 NONAME
?Copy@MClipUnicode@@UBEXXZ @1803 NONAME
?GetPlainRtf@CCtrlRichEdit@@QAEPAD_N@Z @1804 NONAME
+_newStrW@4 @1805 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index 0a4d9dcabc..140c69f7bf 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1577,3 +1577,4 @@ newStr @1789 NONAME
?Copy@MClipRtf@@UEBAXXZ @1802 NONAME
?Copy@MClipUnicode@@UEBAXXZ @1803 NONAME
?GetPlainRtf@CCtrlRichEdit@@QEAAPEAD_N@Z @1804 NONAME
+newStrW @1805 NONAME
diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp
index 09fc6a46ca..7fb0f96c40 100644
--- a/src/mir_core/src/utils.cpp
+++ b/src/mir_core/src/utils.cpp
@@ -32,6 +32,14 @@ MIR_CORE_DLL(char *) newStr(const char *src)
return strcpy(new char[strlen(src) + 1], src);
}
+MIR_CORE_DLL(wchar_t *) newStrW(const wchar_t *src)
+{
+ if (!src)
+ return nullptr;
+
+ return wcscpy(new wchar_t[wcslen(src) + 1], src);
+}
+
MIR_CORE_DLL(char*) replaceStr(char* &dest, const char *src)
{
if (dest != nullptr)