diff options
-rw-r--r-- | bin10/lib/mir_core.lib | bin | 31562 -> 32090 bytes | |||
-rw-r--r-- | bin10/lib/mir_core64.lib | bin | 28820 -> 29332 bytes | |||
-rw-r--r-- | bin11/lib/mir_core.lib | bin | 31562 -> 32090 bytes | |||
-rw-r--r-- | bin11/lib/mir_core64.lib | bin | 28820 -> 29332 bytes | |||
-rw-r--r-- | copylib.cmd | 5 | ||||
-rw-r--r-- | include/delphi/m_core.inc | 2 | ||||
-rw-r--r-- | include/m_core.h | 2 | ||||
-rw-r--r-- | src/mir_core/memory.cpp | 35 | ||||
-rw-r--r-- | src/mir_core/mir_core.def | 1 |
9 files changed, 33 insertions, 12 deletions
diff --git a/bin10/lib/mir_core.lib b/bin10/lib/mir_core.lib Binary files differindex 2eb78c467b..168b57782f 100644 --- a/bin10/lib/mir_core.lib +++ b/bin10/lib/mir_core.lib diff --git a/bin10/lib/mir_core64.lib b/bin10/lib/mir_core64.lib Binary files differindex e02d6a9c3e..e2ddd40a35 100644 --- a/bin10/lib/mir_core64.lib +++ b/bin10/lib/mir_core64.lib diff --git a/bin11/lib/mir_core.lib b/bin11/lib/mir_core.lib Binary files differindex ab60239c88..a47fbce589 100644 --- a/bin11/lib/mir_core.lib +++ b/bin11/lib/mir_core.lib diff --git a/bin11/lib/mir_core64.lib b/bin11/lib/mir_core64.lib Binary files differindex d8cf47f751..99eb113b38 100644 --- a/bin11/lib/mir_core64.lib +++ b/bin11/lib/mir_core64.lib diff --git a/copylib.cmd b/copylib.cmd new file mode 100644 index 0000000000..6cd462b85c --- /dev/null +++ b/copylib.cmd @@ -0,0 +1,5 @@ +@echo off
+copy /Y .\Bin10\Debug\Obj\mir_core\mir_core.lib .\Bin10\lib
+copy /Y .\Bin10\Debug64\Obj\mir_core\mir_core64.lib .\Bin10\lib
+copy /Y .\Bin11\Debug\Obj\mir_core\mir_core.lib .\Bin11\lib
+copy /Y .\Bin11\Debug64\Obj\mir_core\mir_core64.lib .\Bin11\lib
\ No newline at end of file diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index fb7d7034ba..fe6c08de9d 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -414,6 +414,8 @@ function mir_wstrdup(const src:PWideChar):PWideChar; stdcall; external CoreDLL name 'mir_wstrdup';
function mir_strndup(const src:PAnsiChar; len:size_t):PAnsiChar; stdcall;
external CoreDLL name 'mir_strndup';
+function mir_wstrndup(const src:PWideChar; len:size_t):PWideChar; stdcall;
+ external CoreDLL name 'mir_wstrndup';
///////////////////////////////////////////////////////////////////////////////
diff --git a/include/m_core.h b/include/m_core.h index 220289995e..6baf15d32e 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -346,7 +346,9 @@ MIR_C_CORE_DLL(void) mir_free(void* ptr); MIR_CORE_DLL(char*) mir_strdup(const char* str);
MIR_CORE_DLL(WCHAR*) mir_wstrdup(const WCHAR* str);
+
MIR_CORE_DLL(char*) mir_strndup(const char* str, size_t len);
+MIR_CORE_DLL(WCHAR*) mir_wstrndup(const WCHAR *str, size_t len);
///////////////////////////////////////////////////////////////////////////////
// modules
diff --git a/src/mir_core/memory.cpp b/src/mir_core/memory.cpp index 0ed432a610..b8bf481aad 100644 --- a/src/mir_core/memory.cpp +++ b/src/mir_core/memory.cpp @@ -142,10 +142,10 @@ MIR_C_CORE_DLL(void) mir_free(void* ptr) /******************************************************************************/
-MIR_CORE_DLL(char*) mir_strdup(const char* str)
+MIR_CORE_DLL(char*) mir_strdup(const char *str)
{
if (str != NULL) {
- char* p = (char*)mir_alloc(strlen(str)+1);
+ char *p = (char*)mir_alloc(strlen(str)+1);
if (p)
strcpy(p, str);
return p;
@@ -153,13 +153,24 @@ MIR_CORE_DLL(char*) mir_strdup(const char* str) return NULL;
}
+MIR_CORE_DLL(WCHAR*) mir_wstrdup(const WCHAR *str)
+{
+ if (str != NULL) {
+ WCHAR *p = (WCHAR*)mir_alloc(sizeof(WCHAR)*(wcslen(str)+1));
+ if (p)
+ wcscpy(p, str);
+ return p;
+ }
+ return NULL;
+}
+
/******************************************************************************/
-MIR_CORE_DLL(char*) mir_strndup(const char* str, size_t len)
+MIR_CORE_DLL(char*) mir_strndup(const char *str, size_t len)
{
if (str != NULL && len != 0) {
- char* p = (char*)mir_alloc(len + 1);
- if ( !p) {
+ char *p = (char*)mir_alloc(len+1);
+ if (p) {
memcpy(p, str, len);
p[ len ] = 0;
}
@@ -168,14 +179,14 @@ MIR_CORE_DLL(char*) mir_strndup(const char* str, size_t len) return NULL;
}
-/******************************************************************************/
-
-MIR_CORE_DLL(WCHAR*) mir_wstrdup(const WCHAR* str)
+MIR_CORE_DLL(WCHAR*) mir_wstrndup(const WCHAR *str, size_t len)
{
- if (str != NULL) {
- WCHAR* p = (WCHAR*)mir_alloc(sizeof(WCHAR)*(wcslen(str)+1));
- if (p)
- wcscpy(p, str);
+ if (str != NULL && len != 0) {
+ WCHAR *p = (WCHAR*)mir_alloc(sizeof(WCHAR)*(len+1));
+ if (p) {
+ memcpy(p, str, sizeof(WCHAR)*len);
+ p[ len ] = 0;
+ }
return p;
}
return NULL;
diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def index a5978b9ddb..c124c559e5 100644 --- a/src/mir_core/mir_core.def +++ b/src/mir_core/mir_core.def @@ -139,3 +139,4 @@ Icon_RegisterT @136 mir_subclassWindow @137
mir_callNextSubclass @138
KillModuleSubclassing @139
+mir_wstrndup @140
|