From 09c99dd2c3c5e53aaf7d68c87aa371085344d4c8 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 19:16:34 +0100 Subject: [PATCH 1/3] Fixed: Compatibility with CMake 2.8 --HG-- branch : develop --- code/CMakeModules/PCHSupport.cmake | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake index 50853c964..45e1aa766 100644 --- a/code/CMakeModules/PCHSupport.cmake +++ b/code/CMakeModules/PCHSupport.cmake @@ -27,6 +27,19 @@ ELSE() ENDIF() ENDIF() +MACRO(APPEND_DEFINITION _NAME _VAL) + # value is not empty + IF(${_VAL}) + IF(CMAKE_VERSION VERSION_LESS "2.8.12") + # don't support logical expressions, append definition + LIST(APPEND ${_NAME} "-D${_VAL}") + ELSE() + # support logical expressions, use them + LIST(APPEND ${_NAME} "$<$:-D$>") + ENDIF() + ENDIF() +ENDMACRO() + # Set PCH_FLAGS for common flags, PCH_ARCH_XXX_FLAGS for specific archs flags and PCH_ARCHS for archs MACRO(PCH_SET_COMPILE_FLAGS _target) SET(PCH_FLAGS) @@ -77,28 +90,28 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS "$<$:-D$>") + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) ENDFOREACH() ENDIF() GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD}) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS "$<$:-D$>") + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) ENDFOREACH() ENDIF() GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS "$<$:-D$>") + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) ENDFOREACH() ENDIF() GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS_${_UPPER_BUILD}) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS "$<$:-D$>") + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) ENDFOREACH() ENDIF() @@ -122,14 +135,14 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS "$<$:-D$>") + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) ENDFOREACH() ENDIF() GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS_${_UPPER_BUILD}) IF(DEFINITIONS) FOREACH(item ${DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS "$<$:-D$>") + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) ENDFOREACH() ENDIF() @@ -151,7 +164,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target) IF(_DEFINITIONS) FOREACH(item ${_DEFINITIONS}) - LIST(APPEND GLOBAL_DEFINITIONS "$<$:-D$>") + APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item}) ENDFOREACH() ENDIF() ENDIF() From c71f712d11ae1d30bc0886a61ceb2f2f37406896 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 19:17:21 +0100 Subject: [PATCH 2/3] Fixed: Release libxml2 structures before exit --HG-- branch : develop --- code/nel/include/nel/misc/i_xml.h | 5 +++++ code/nel/src/misc/i_xml.cpp | 7 +++++-- code/ryzom/client/src/release.cpp | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/code/nel/include/nel/misc/i_xml.h b/code/nel/include/nel/misc/i_xml.h index b078eb7ee..50fdddd04 100644 --- a/code/nel/include/nel/misc/i_xml.h +++ b/code/nel/include/nel/misc/i_xml.h @@ -171,6 +171,11 @@ public: */ static bool getContentString (std::string &result, xmlNodePtr node); + /** + * Release meory used by libxml2, to only call before exit. + */ + static void releaseLibXml(); + private: /// From IStream diff --git a/code/nel/src/misc/i_xml.cpp b/code/nel/src/misc/i_xml.cpp index 3c8a3c6ba..719d5f359 100644 --- a/code/nel/src/misc/i_xml.cpp +++ b/code/nel/src/misc/i_xml.cpp @@ -103,13 +103,11 @@ void CIXml::release () // Free it xmlClearParserCtxt (_Parser); xmlFreeParserCtxt (_Parser); - // commented due to the bug #857 xmlCleanupParser (); _Parser = NULL; } // Not initialized - _Parser = NULL; _CurrentElement = NULL; _CurrentNode = NULL; _PushBegin = false; @@ -1143,6 +1141,11 @@ bool CIXml::getContentString (std::string &result, xmlNodePtr node) // *************************************************************************** +void CIXml::releaseLibXml() +{ + xmlCleanupParser(); +} + } // NLMISC #endif // NL_DONT_USE_EXTERNAL_CODE diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index 543230609..eafc8ae86 100644 --- a/code/ryzom/client/src/release.cpp +++ b/code/ryzom/client/src/release.cpp @@ -664,6 +664,7 @@ void release() NLGUI::CDBManager::release(); CWidgetManager::release(); CViewRenderer::release(); + CIXml::releaseLibXml(); #if FINAL_VERSION // openURL ("http://www.ryzomcore.org/exit/"); From 6d651b9c688c9e30cbde6cbfe22d6bf5ad321fbc Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 19:18:08 +0100 Subject: [PATCH 3/3] Changed: Use !empty() instead of size() --HG-- branch : develop --- code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp b/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp index 997b935a9..c466b7055 100644 --- a/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp +++ b/code/nel/tools/3d/plugin_max/nel_export/nel_export_swt.cpp @@ -70,7 +70,7 @@ bool CNelExport::exportSWT(const std::string &sPath, std::vector& vectNo } } - if (aSWNodes.size()) + if (!aSWNodes.empty()) { CSkeletonWeight sw; COFile file;