From 13e2da698a1c3ec840944da5161a90dd3a2bb224 Mon Sep 17 00:00:00 2001 From: Jan Boon Date: Tue, 3 Jul 2018 16:09:15 +0800 Subject: [PATCH] Fix build under Visual Studio 2008 --HG-- branch : develop --- code/CMakeModules/GetRevision.cmake | 2 ++ code/nel/include/nel/gui/http_hsts.h | 4 ++-- code/nel/src/gui/CMakeLists.txt | 4 ++-- code/nel/src/gui/http_hsts.cpp | 16 ++++++++++------ 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake index b29a8763e..dba90c765 100644 --- a/code/CMakeModules/GetRevision.cmake +++ b/code/CMakeModules/GetRevision.cmake @@ -83,4 +83,6 @@ ENDIF() IF(DEFINED REVISION) MESSAGE(STATUS "Found revision ${REVISION}") +ELSE() + SET(REVISION 0) ENDIF() diff --git a/code/nel/include/nel/gui/http_hsts.h b/code/nel/include/nel/gui/http_hsts.h index 2693461cd..28f1b5f5b 100644 --- a/code/nel/include/nel/gui/http_hsts.h +++ b/code/nel/include/nel/gui/http_hsts.h @@ -42,7 +42,7 @@ namespace NLGUI class CStrictTransportSecurity { public: - typedef std::map THSTSObject; + typedef std::map THSTSObjectMap; static CStrictTransportSecurity* getInstance(); static void release(); @@ -66,7 +66,7 @@ namespace NLGUI ~CStrictTransportSecurity(); std::string _Filename; - THSTSObject _Domains; + THSTSObjectMap _Domains; }; } diff --git a/code/nel/src/gui/CMakeLists.txt b/code/nel/src/gui/CMakeLists.txt index 5233b8ceb..cdd090f0b 100644 --- a/code/nel/src/gui/CMakeLists.txt +++ b/code/nel/src/gui/CMakeLists.txt @@ -6,9 +6,9 @@ SOURCE_GROUP("src" FILES ${SRC}) NL_TARGET_LIB(nelgui ${SRC} ${HEADERS}) -INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${CURL_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${LUABIND_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) -TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES}) +TARGET_LINK_LIBRARIES(nelgui nelmisc nel3d ${LUA_LIBRARIES} ${LUABIND_LIBRARIES} ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) NL_DEFAULT_PROPS(nelgui "NeL, Library: NeL GUI") NL_ADD_RUNTIME_FLAGS(nelgui) diff --git a/code/nel/src/gui/http_hsts.cpp b/code/nel/src/gui/http_hsts.cpp index c69062538..c57bb738c 100644 --- a/code/nel/src/gui/http_hsts.cpp +++ b/code/nel/src/gui/http_hsts.cpp @@ -87,9 +87,12 @@ namespace NLGUI { if (domain.empty() || _Domains.empty()) return false; - if (_Domains.count(domain) > 0) + THSTSObjectMap::const_iterator itHsts; + + itHsts = _Domains.find(domain); + if (itHsts != _Domains.end()) { - hsts = _Domains.at(domain); + hsts = itHsts->second; return true; } @@ -99,11 +102,12 @@ namespace NLGUI { { std::string tmp; tmp = domain.substr(firstOf+1); - if (_Domains.count(tmp)) + itHsts = _Domains.find(tmp); + if (itHsts != _Domains.end()) { - if (_Domains.at(tmp).IncludeSubDomains) + if (itHsts->second.IncludeSubDomains) { - hsts = _Domains.at(tmp); + hsts = itHsts->second; return true; } @@ -182,7 +186,7 @@ namespace NLGUI { { uint32 nbItems = _Domains.size(); f.serial(nbItems); - for (THSTSObject::iterator it = _Domains.begin(); it != _Domains.end(); ++it) + for (THSTSObjectMap::iterator it = _Domains.begin(); it != _Domains.end(); ++it) { std::string domain(it->first); f.serial(domain);