diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/src/mir_core.def | 4 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 4 | ||||
-rw-r--r-- | src/mir_core/src/utils.cpp | 36 |
3 files changed, 44 insertions, 0 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 8412723e7f..57f8bfcfd9 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -977,3 +977,7 @@ GetOSDisplayString @1134 IsWinVer10Plus @1135
IsWinVer81Plus @1136
IsWinVer8Plus @1137
+mir_strncmp @1138
+mir_strncmpi @1139
+mir_wstrncmp @1140
+mir_wstrncmpi @1141
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index b29f37541d..c44c595634 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -977,3 +977,7 @@ GetOSDisplayString @1134 IsWinVer10Plus @1135
IsWinVer81Plus @1136
IsWinVer8Plus @1137
+mir_strncmp @1138
+mir_strncmpi @1139
+mir_wstrncmp @1140
+mir_wstrncmpi @1141
diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp index af1685a63e..5f4d0d063b 100644 --- a/src/mir_core/src/utils.cpp +++ b/src/mir_core/src/utils.cpp @@ -410,6 +410,42 @@ MIR_CORE_DLL(int) mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2) return CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, -1, p2, -1) - 2;
}
+MIR_CORE_DLL(int) mir_strncmp(const char *p1, const char *p2, size_t n)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : -1;
+ if (p2 == NULL)
+ return 1;
+ return CompareStringA(LOCALE_USER_DEFAULT, 0, p1, (int)n, p2, (int)n) - 2;
+}
+
+MIR_CORE_DLL(int) mir_wstrncmp(const wchar_t *p1, const wchar_t *p2, size_t n)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : -1;
+ if (p2 == NULL)
+ return 1;
+ return CompareStringW(LOCALE_USER_DEFAULT, 0, p1, (int)n, p2, (int)n) - 2;
+}
+
+MIR_CORE_DLL(int) mir_strncmpi(const char *p1, const char *p2, size_t n)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : -1;
+ if (p2 == NULL)
+ return 1;
+ return CompareStringA(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, (int)n, p2, (int)n) - 2;
+}
+
+MIR_CORE_DLL(int) mir_wstrncmpi(const wchar_t *p1, const wchar_t *p2, size_t n)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : -1;
+ if (p2 == NULL)
+ return 1;
+ return CompareStringW(LOCALE_USER_DEFAULT, NORM_IGNORECASE, p1, (int)n, p2, (int)n) - 2;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
PGENRANDOM pfnRtlGenRandom;
|