diff options
author | XhmikosR <xhmikosr@gmail.com> | 2014-12-02 21:38:30 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2014-12-08 22:11:28 +0300 |
commit | ad7cdbceec23007d20bd78bc375a4c499d03ce35 (patch) | |
tree | a793590a3fb029afad49673f65218bcdf89f0f2d /src/thirdparty/unrar | |
parent | bf6460971f00efb788d3498fb4d5465501db9fc9 (diff) |
Update unrar to v5.2.3.
Diffstat (limited to 'src/thirdparty/unrar')
-rw-r--r-- | src/thirdparty/unrar/dll.rc | 8 | ||||
-rw-r--r-- | src/thirdparty/unrar/threadmisc.cpp | 20 | ||||
-rw-r--r-- | src/thirdparty/unrar/unicode.cpp | 15 | ||||
-rw-r--r-- | src/thirdparty/unrar/version.hpp | 6 |
4 files changed, 41 insertions, 8 deletions
diff --git a/src/thirdparty/unrar/dll.rc b/src/thirdparty/unrar/dll.rc index 4c378030b..1481d7632 100644 --- a/src/thirdparty/unrar/dll.rc +++ b/src/thirdparty/unrar/dll.rc @@ -2,8 +2,8 @@ #include <commctrl.h>
VS_VERSION_INFO VERSIONINFO
-FILEVERSION 5, 20, 3, 1404
-PRODUCTVERSION 5, 20, 3, 1404
+FILEVERSION 5, 20, 100, 1433
+PRODUCTVERSION 5, 20, 100, 1433
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
@@ -14,8 +14,8 @@ FILETYPE VFT_APP VALUE "CompanyName", "Alexander Roshal\0"
VALUE "ProductName", "RAR decompression library\0"
VALUE "FileDescription", "RAR decompression library\0"
- VALUE "FileVersion", "5.20.3\0"
- VALUE "ProductVersion", "5.20.3\0"
+ VALUE "FileVersion", "5.20.0\0"
+ VALUE "ProductVersion", "5.20.0\0"
VALUE "LegalCopyright", "Copyright © Alexander Roshal 1993-2014\0"
VALUE "OriginalFilename", "Unrar.dll\0"
}
diff --git a/src/thirdparty/unrar/threadmisc.cpp b/src/thirdparty/unrar/threadmisc.cpp index d56867be4..d1524e0cf 100644 --- a/src/thirdparty/unrar/threadmisc.cpp +++ b/src/thirdparty/unrar/threadmisc.cpp @@ -58,6 +58,20 @@ ThreadPool* CreateThreadPool() if (GlobalPoolUseCount++ == 0) GlobalPool=new ThreadPool(MaxPoolThreads); +#ifdef RARDLL + // We use a simple thread pool, which does not allow to add tasks from + // different functions and threads in the same time. It is ok for RAR, + // but UnRAR.dll can be used in multithreaded environment. So if one of + // threads requests a copy of global pool and another copy is already + // in use, we create and return a new pool instead of existing global. + if (GlobalPoolUseCount > 1) + { + ThreadPool *Pool = new ThreadPool(MaxPoolThreads); + CriticalSectionEnd(&PoolCreateSync.CritSection); + return Pool; + } +#endif + CriticalSectionEnd(&PoolCreateSync.CritSection); return GlobalPool; } @@ -69,6 +83,12 @@ void DestroyThreadPool(ThreadPool *Pool) if (Pool!=NULL && Pool==GlobalPool && GlobalPoolUseCount > 0 && --GlobalPoolUseCount == 0) delete GlobalPool; +#ifdef RARDLL + // To correctly work in multithreaded environment UnRAR.dll creates + // new pools if global pool is already in use. We delete such pools here. + if (Pool!=NULL && Pool!=GlobalPool) + delete Pool; +#endif CriticalSectionEnd(&PoolCreateSync.CritSection); } diff --git a/src/thirdparty/unrar/unicode.cpp b/src/thirdparty/unrar/unicode.cpp index d63849ca0..9c1080aa7 100644 --- a/src/thirdparty/unrar/unicode.cpp +++ b/src/thirdparty/unrar/unicode.cpp @@ -433,7 +433,7 @@ const wchar_t* wcscasestr(const wchar_t *str, const wchar_t *search) { if (search[j]==0) return str+i; - if (towlower(str[i+j])!=towlower(search[j])) + if (tolowerw(str[i+j])!=tolowerw(search[j])) break; } return NULL; @@ -472,13 +472,26 @@ wchar* wcsupper(wchar *s) int toupperw(int ch) { +#ifdef _WIN_ALL + // CharUpper is more reliable than towupper in Windows, which seems to be + // C locale dependent even in Unicode version. For example, towupper failed + // to convert lowercase Russian characters. + return (int)CharUpper((wchar *)ch); +#else return towupper(ch); +#endif } int tolowerw(int ch) { +#ifdef _WIN_ALL + // CharLower is more reliable than towlower in Windows. + // See comment for towupper above. + return (int)CharLower((wchar *)ch); +#else return towlower(ch); +#endif } diff --git a/src/thirdparty/unrar/version.hpp b/src/thirdparty/unrar/version.hpp index 0d4175c5c..3a36f22b3 100644 --- a/src/thirdparty/unrar/version.hpp +++ b/src/thirdparty/unrar/version.hpp @@ -1,6 +1,6 @@ #define RARVER_MAJOR 5 #define RARVER_MINOR 20 -#define RARVER_BETA 3 -#define RARVER_DAY 3 -#define RARVER_MONTH 11 +#define RARVER_BETA 0 +#define RARVER_DAY 2 +#define RARVER_MONTH 12 #define RARVER_YEAR 2014 |