summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 20:25:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 20:25:58 +0000
commitce2d4f19e3f810b282eb7d47d470d426ff459e1f (patch)
treea49f3e9dd42399756b2ce33a3d91caec535b77ab /src
parent1bb83288c063ce1864e46f6f675751c8c631b530 (diff)
mir_strcmp, mir_strcmpi, mir_wstrcmp, mir_wstrcmpi
git-svn-id: http://svn.miranda-ng.org/main/trunk@11179 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/mir_core.def4
-rw-r--r--src/mir_core/utils.cpp38
2 files changed, 41 insertions, 1 deletions
diff --git a/src/mir_core/mir_core.def b/src/mir_core/mir_core.def
index b0b369f320..312540f081 100644
--- a/src/mir_core/mir_core.def
+++ b/src/mir_core/mir_core.def
@@ -276,3 +276,7 @@ mir_strcat @273
mir_wstrcat @274
mir_strncat @275
mir_wstrncat @276
+mir_strcmp @277
+mir_strcmpi @278
+mir_wstrcmp @279
+mir_wstrcmpi @280
diff --git a/src/mir_core/utils.cpp b/src/mir_core/utils.cpp
index 6c584e9c82..5e9c640c4e 100644
--- a/src/mir_core/utils.cpp
+++ b/src/mir_core/utils.cpp
@@ -262,7 +262,7 @@ MIR_CORE_DLL(WCHAR*) bin2hexW(const void *pData, size_t len, WCHAR *dest)
/////////////////////////////////////////////////////////////////////////////////////////
-#pragma intrinsic(strlen, strcpy, strcat, wcslen, wcscpy, wcscat)
+#pragma intrinsic(strlen, strcpy, strcat, strcmp, wcslen, wcscpy, wcscat, wcscmp)
MIR_CORE_DLL(size_t) mir_strlen(const char *p)
{
@@ -373,3 +373,39 @@ MIR_CORE_DLL(wchar_t*) mir_wstrncat(wchar_t *dest, const wchar_t *src, size_t le
wcsncat_s(dest, len, src, _TRUNCATE);
return dest;
}
+
+MIR_CORE_DLL(int) mir_strcmp(const char *p1, const char *p2)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : 1;
+ if (p2 == NULL)
+ return -1;
+ return strcmp(p1, p2);
+}
+
+MIR_CORE_DLL(int) mir_wstrcmp(const wchar_t *p1, const wchar_t *p2)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : 1;
+ if (p2 == NULL)
+ return -1;
+ return wcscmp(p1, p2);
+}
+
+MIR_CORE_DLL(int) mir_strcmpi(const char *p1, const char *p2)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : 1;
+ if (p2 == NULL)
+ return -1;
+ return stricmp(p1, p2);
+}
+
+MIR_CORE_DLL(int) mir_wstrcmpi(const wchar_t *p1, const wchar_t *p2)
+{
+ if (p1 == NULL)
+ return (p2 == NULL) ? 0 : 1;
+ if (p2 == NULL)
+ return -1;
+ return wcsicmp(p1, p2);
+}