summarylogtreecommitdiffstats
path: root/tinyxml6.patch
blob: 2ceee954c14d9722a9c5f6a9d6d8293658dc245d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# HG changeset patch
# User Steve Peters <scpeters@openrobotics.org>
# Date 1513105358 28800
# Branch tinyxml2_6_gazebo8
# Node ID be154a72c765abd6d9517c04cd46c96870edf5c2
# Parent  028285bda338b580f60775c57dfbcb44781538d3
support tinyxml2 version 6.0.0 on gazebo8

diff --git a/gazebo/util/CMakeLists.txt b/gazebo/util/CMakeLists.txt
--- a/gazebo/util/CMakeLists.txt
+++ b/gazebo/util/CMakeLists.txt
@@ -89,6 +89,14 @@
   ${IGNITION-MSGS_LIBRARIES}
 )
 
+# define if tinxml2 major version >= 6
+# https://bitbucket.org/ignitionrobotics/ign-common/issues/28
+if (NOT tinyxml2_VERSION VERSION_LESS "6.0.0")
+  message(STATUS "tinyxml2_VERSION ${tinyxml2_VERSION} >= 6.0.0")
+  target_compile_definitions(gazebo_util
+    PRIVATE "TINYXML2_MAJOR_VERSION_GE_6")
+endif()
+
 if (WIN32)
   include_directories(IGNITION-MSGS_INCLUDE_DIR)
   set_target_properties(gazebo_util PROPERTIES COMPILE_FLAGS "/FIignition/msgs/System.hh")
diff --git a/gazebo/util/LogPlay.cc b/gazebo/util/LogPlay.cc
--- a/gazebo/util/LogPlay.cc
+++ b/gazebo/util/LogPlay.cc
@@ -125,8 +125,13 @@
   {
     gzerr << "Unable to load file[" << _logFile << "]. "
       << "Check the Gazebo server log file for more information.\n";
+#ifdef TINYXML2_MAJOR_VERSION_GE_6
+    const char *errorStr1 = this->dataPtr->xmlDoc.ErrorStr();
+    const char *errorStr2 = nullptr;
+#else
     const char *errorStr1 = this->dataPtr->xmlDoc.GetErrorStr1();
     const char *errorStr2 = this->dataPtr->xmlDoc.GetErrorStr2();
+#endif
     if (errorStr1)
       gzlog << "Log Error 1:\n" << errorStr1 << std::endl;
     if (errorStr2)