diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 17:42:08 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 17:42:08 +0000 |
commit | 5975b2d0903bd5df128d55e20cd27d7c13b4e46c (patch) | |
tree | 6696492511c591fa8bf3b65a64864245caa3e7c2 /plugins/CommonLibs/pcre.cpp | |
parent | 8617d7e00546f892c9084f7c382648b23d8bbb63 (diff) |
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CommonLibs/pcre.cpp')
-rw-r--r-- | plugins/CommonLibs/pcre.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/plugins/CommonLibs/pcre.cpp b/plugins/CommonLibs/pcre.cpp index 5bd85833d9..ae82e43435 100644 --- a/plugins/CommonLibs/pcre.cpp +++ b/plugins/CommonLibs/pcre.cpp @@ -128,11 +128,9 @@ TCString CompileRegexp(TCString Regexp, int bAddAsUsualSubstring, int ID) }
Regexp.ReleaseBuffer();
}
-#ifdef _UNICODE
+
PcreCompileData[NewID].pPcre = pcre_compile(WCHAR2UTF8(Regexp).GetData(), PCRE_UTF8 | PCRE_NO_UTF8_CHECK | Flags, &Err, &ErrOffs, NULL);
-#else
- PcreCompileData[NewID].pPcre = pcre_compile(Regexp, Flags, &Err, &ErrOffs, NULL);
-#endif
+
if (PcreCompileData[NewID].pPcre) {
PcreCompileData[NewID].pExtra = NULL;
if (pcre_study)
@@ -164,7 +162,7 @@ HMODULE LoadPcreLibrary(const char *szPath) *(FARPROC*)&pcre_free = *(FARPROC*)GetProcAddress(hModule, "pcre_free"); // pcre_free is a pointer to a variable containing pointer to the function %)
if (pcre_compile && pcre_exec && pcre_free)
{
-#ifdef _UNICODE
+
int Utf8Supported = 0;
if (pcre_config)
{
@@ -174,9 +172,7 @@ HMODULE LoadPcreLibrary(const char *szPath) {
return hModule;
}
-#else
- return hModule;
-#endif
+
}
FreeLibrary(hModule);
return NULL;
@@ -256,12 +252,10 @@ int PcreCheck(TCString Str, int StartingID) {
if (hPcreDLL && PcreCompileData[I].pPcre)
{
-#ifdef _UNICODE
+
CHARARRAY Utf8Str = WCHAR2UTF8(Str);
int Res = pcre_exec(PcreCompileData[I].pPcre, PcreCompileData[I].pExtra, Utf8Str.GetData(), Utf8Str.GetSize() - 1, 0, PCRE_NOTEMPTY | PCRE_NO_UTF8_CHECK, NULL, 0);
-#else
- int Res = pcre_exec(PcreCompileData[I].pPcre, PcreCompileData[I].pExtra, Str, Str.GetLen(), 0, PCRE_NOTEMPTY, NULL, 0);
-#endif
+
if (Res >= 0)
{
return PcreCompileData[I].ID;
|