diff options
author | George Hazan <george.hazan@gmail.com> | 2024-03-15 16:35:11 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-03-15 16:35:11 +0300 |
commit | f621aac0cb42e0de9de6f1f05a0b4383eb791930 (patch) | |
tree | 92aa45efbd961da93cd0a76f73b6018a205d337e | |
parent | e183822028662cdd47d31c5f23fd9842c32cba6a (diff) |
newStrW - Unicode version of the newStr() function
-rw-r--r-- | include/m_core.h | 1 | ||||
-rw-r--r-- | libs/win32/mir_core.lib | bin | 498110 -> 498286 bytes | |||
-rw-r--r-- | libs/win64/mir_core.lib | bin | 503440 -> 503602 bytes | |||
-rw-r--r-- | src/mir_core/src/mir_core.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 1 | ||||
-rw-r--r-- | src/mir_core/src/utils.cpp | 8 |
6 files changed, 11 insertions, 0 deletions
diff --git a/include/m_core.h b/include/m_core.h index 2c0d9fa927..c3e3df35a6 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -424,6 +424,7 @@ __forceinline char* lrtrim(char *str) { return ltrim(rtrim(str)); }; __forceinline char* lrtrimp(char *str) { return ltrimp(rtrim(str)); };
MIR_CORE_DLL(char *) newStr(const char *src);
+MIR_CORE_DLL(wchar_t *) newStrW(const wchar_t *src);
#if defined( __cplusplus )
MIR_CORE_DLL(char*) replaceStr(char* &dest, const char *src);
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex 364a71df83..580a31a887 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex 5a428145c5..94f7763c36 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib 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)
|