1
0
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:
Mounir IDRASSI
2026-05-26 20:49:36 +09:00
parent 9b20099255
commit 4ad36447b2
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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;