From c53133e7f273c3ff6cb1f54257495ab2bd5030c2 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 4 Dec 2016 19:19:15 +0100 Subject: [PATCH] Merge with develop --- code/CMakeModules/PCHSupport.cmake | 27 ++++++++++++++----- code/nel/include/nel/misc/i_xml.h | 5 ++++ code/nel/src/misc/i_xml.cpp | 7 +++-- .../plugin_max/nel_export/nel_export_swt.cpp | 2 +- code/ryzom/client/src/release.cpp | 1 + 5 files changed, 32 insertions(+), 10 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() 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/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; diff --git a/code/ryzom/client/src/release.cpp b/code/ryzom/client/src/release.cpp index 6e90d2d3d..0c6514418 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://ryzom.com/exit/");