mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-06-10 06:46:59 -05:00
Linux: fix CentOS 6 build with GCC 4.4
CentOS 6 builds VeraCrypt with GCC 4.4.7 and -std=c++0x. That compiler does not support range-based for loops, and its libstdc++ does not provide std::string::back() or std::string::pop_back(). Avoid those constructs in the affected Unix/Linux code paths: use VeraCrypt's existing foreach helper when iterating PKCS#11 object handles, and use indexing plus erase() when trimming trailing slashes from PATH entries. This keeps the code valid for newer Linux toolchains while restoring compatibility with the CentOS 6 build environment.
This commit is contained in:
@@ -220,7 +220,7 @@ namespace VeraCrypt
|
||||
throw;
|
||||
}
|
||||
|
||||
for(const CK_OBJECT_HANDLE & dataHandle: GetObjects(slotId, CKO_DATA))
|
||||
foreach(const CK_OBJECT_HANDLE & dataHandle, GetObjects(slotId, CKO_DATA))
|
||||
{
|
||||
SecurityTokenKeyfile keyfile;
|
||||
keyfile.Handle = dataHandle;
|
||||
|
||||
Reference in New Issue
Block a user