From 19fa1f86843230439f3032092d65bbb0f07a399e Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 1 Oct 2023 11:06:46 +0200 Subject: Linux: use "-std=c++11" for gcc 4.8 and adapt code to old compilers --- src/Common/EMVCard.cpp | 6 +++--- src/Common/Token.h | 4 ++-- src/Makefile | 4 ++-- src/Platform/SharedPtr.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Common/EMVCard.cpp b/src/Common/EMVCard.cpp index 172a9628..5f694240 100644 --- a/src/Common/EMVCard.cpp +++ b/src/Common/EMVCard.cpp @@ -43,9 +43,9 @@ namespace VeraCrypt map> InitializeSupportedAIDs() { map> supportedAIDs; - supportedAIDs.insert(std::make_pair(EMVCardType::AMEX, vector(EMVCard::AMEX_AID, EMVCard::AMEX_AID + (std::end(EMVCard::AMEX_AID) - std::begin(EMVCard::AMEX_AID))))); - supportedAIDs.insert(std::make_pair(EMVCardType::MASTERCARD, vector(EMVCard::MASTERCARD_AID, EMVCard::MASTERCARD_AID + (std::end(EMVCard::MASTERCARD_AID) - std::begin(EMVCard::MASTERCARD_AID))))); - supportedAIDs.insert(std::make_pair(EMVCardType::VISA, vector(EMVCard::VISA_AID, EMVCard::VISA_AID + (std::end(EMVCard::VISA_AID) - std::begin(EMVCard::VISA_AID))))); + supportedAIDs.insert(std::make_pair(EMVCardType::AMEX, vector(EMVCard::AMEX_AID, EMVCard::AMEX_AID + sizeof(EMVCard::AMEX_AID)))); + supportedAIDs.insert(std::make_pair(EMVCardType::MASTERCARD, vector(EMVCard::MASTERCARD_AID, EMVCard::MASTERCARD_AID + sizeof(EMVCard::MASTERCARD_AID)))); + supportedAIDs.insert(std::make_pair(EMVCardType::VISA, vector(EMVCard::VISA_AID, EMVCard::VISA_AID + sizeof(EMVCard::VISA_AID)))); return supportedAIDs; } diff --git a/src/Common/Token.h b/src/Common/Token.h index c1dd8ac4..754e2830 100644 --- a/src/Common/Token.h +++ b/src/Common/Token.h @@ -50,9 +50,9 @@ namespace VeraCrypt class Token { public: - static vector> GetAvailableKeyfiles(bool isEMVSupportEnabled); + static vector< shared_ptr > GetAvailableKeyfiles(bool isEMVSupportEnabled); static bool IsKeyfilePathValid(const wstring& tokenKeyfilePath, bool isEMVSupportEnabled); - static list > GetAvailableTokens(); + static list < shared_ptr > GetAvailableTokens(); static shared_ptr getTokenKeyfile(const TokenKeyfilePath& path); }; }; diff --git a/src/Makefile b/src/Makefile index ed62a4f0..3848b6c0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -203,8 +203,8 @@ ifeq "$(shell uname -s)" "Linux" # GCC version below 4.8 support minimal C++11 features through the switch -std=c++0x CXXFLAGS += -std=c++0x else ifeq ($(GCC_VERSION), 408) - # GCC version 4.8 supports C++11 features through the switch -std=gnu++11 - CXXFLAGS += -std=gnu++11 + # GCC version 4.8 supports C++11 features through the switch -std=c++11 + CXXFLAGS += -std=c++11 else ifeq ($(shell expr $(GCC_VERSION) \>= 1100), 1) # GNU GCC version 11 and higher compile with -std=gnu++17 by default # which breaks "byte" definitions in Crypto++ library. So set -std=gnu++14 instead. diff --git a/src/Platform/SharedPtr.h b/src/Platform/SharedPtr.h index 29669714..f80b2167 100644 --- a/src/Platform/SharedPtr.h +++ b/src/Platform/SharedPtr.h @@ -21,7 +21,7 @@ namespace VeraCrypt { -#if (__cplusplus >= 201103L) +#if (__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__) #define VC_USE_NATIVE_PTR 1 #endif -- cgit v1.2.3