mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
support C++20
This commit is contained in:
parent
4011502f5f
commit
a6f9a56e40
@ -20,9 +20,12 @@ else ifeq ($(shell expr match ${CXXVER} "4\.[8-9]"),3) # gcc 4.8 - 4.9
|
|||||||
else ifeq ($(shell expr match ${CXXVER} "[5-6]"),1) # gcc 5 - 6
|
else ifeq ($(shell expr match ${CXXVER} "[5-6]"),1) # gcc 5 - 6
|
||||||
NEEDED_CXXFLAGS += -std=c++11
|
NEEDED_CXXFLAGS += -std=c++11
|
||||||
LDLIBS = -latomic
|
LDLIBS = -latomic
|
||||||
else ifeq ($(shell expr match ${CXXVER} "[1,7-9]"),1) # gcc >= 7
|
else ifeq ($(shell expr match ${CXXVER} "[7-9]"),1) # gcc 7 - 9
|
||||||
NEEDED_CXXFLAGS += -std=c++17
|
NEEDED_CXXFLAGS += -std=c++17
|
||||||
LDLIBS = -latomic
|
LDLIBS = -latomic
|
||||||
|
else ifeq ($(shell expr match ${CXXVER} "1[0-9]"),2) # gcc 10 - 19
|
||||||
|
NEEDED_CXXFLAGS += -std=c++20
|
||||||
|
LDLIBS = -latomic
|
||||||
else # not supported
|
else # not supported
|
||||||
$(error Compiler too old)
|
$(error Compiler too old)
|
||||||
endif
|
endif
|
||||||
|
@ -2273,7 +2273,11 @@ namespace transport
|
|||||||
{
|
{
|
||||||
if (!msg) return;
|
if (!msg) return;
|
||||||
int32_t msgID = msg->GetMsgID ();
|
int32_t msgID = msg->GetMsgID ();
|
||||||
|
#if __cplusplus >= 202002L // C++ 20 or higher
|
||||||
|
if (!m_ReceivedI2NPMsgIDs.contains (msgID))
|
||||||
|
#else
|
||||||
if (!m_ReceivedI2NPMsgIDs.count (msgID))
|
if (!m_ReceivedI2NPMsgIDs.count (msgID))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
if (!msg->IsExpired ())
|
if (!msg->IsExpired ())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user