summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-21 05:25:21 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-21 05:25:21 +0300
commit01ac8bad77156f50ba57ddff5306714dc3815ef3 (patch)
tree5595cba954c4ea6c7a656a165fb2f39860918096 /src
parent62fa493303fe3c191706090606ada885eaf184f5 (diff)
downloadManaVerse-01ac8bad77156f50ba57ddff5306714dc3815ef3.tar.gz
ManaVerse-01ac8bad77156f50ba57ddff5306714dc3815ef3.tar.bz2
ManaVerse-01ac8bad77156f50ba57ddff5306714dc3815ef3.tar.xz
ManaVerse-01ac8bad77156f50ba57ddff5306714dc3815ef3.zip
Fix compilation with pugixml.
Add macroses for XmlChar and XmlConstChar.
Diffstat (limited to 'src')
-rw-r--r--src/gui/theme.cpp8
-rw-r--r--src/resources/db/deaddb.cpp2
-rw-r--r--src/resources/db/questdb.cpp2
-rw-r--r--src/utils/xml/libxml.inc2
-rw-r--r--src/utils/xml/pugixml.inc2
5 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 9fa1b59ec..1888627d1 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -1179,7 +1179,7 @@ ImageSet *Theme::getImageSetFromThemeXml(const std::string &name,
#define readValue(name) \
{ \
- tmpData = reinterpret_cast<char*>( \
+ tmpData = reinterpret_cast<XmlChar*>( \
XmlNodeGetContent(infoNode)); \
info->name = tmpData; \
XmlFree(tmpData); \
@@ -1187,7 +1187,7 @@ ImageSet *Theme::getImageSetFromThemeXml(const std::string &name,
#define readIntValue(name) \
{ \
- tmpData = reinterpret_cast<char*>( \
+ tmpData = reinterpret_cast<XmlChar*>( \
XmlNodeGetContent(infoNode)); \
info->name = atoi(tmpData); \
XmlFree(tmpData); \
@@ -1195,7 +1195,7 @@ ImageSet *Theme::getImageSetFromThemeXml(const std::string &name,
#define readFloatValue(name) \
{ \
- tmpData = reinterpret_cast<char*>( \
+ tmpData = reinterpret_cast<XmlChar*>( \
XmlNodeGetContent(infoNode)); \
info->name = static_cast<float>(atof(tmpData)); \
XmlFree(tmpData); \
@@ -1231,7 +1231,7 @@ ThemeInfo *Theme::loadInfo(const std::string &themeName)
const std::string fontSize2("fontSize_" + mScreenDensity);
const std::string npcfontSize2("npcfontSize_" + mScreenDensity);
- char *tmpData = nullptr;
+ XmlChar *tmpData = nullptr;
for_each_xml_child_node(infoNode, rootNode)
{
if (xmlNameEqual(infoNode, "name"))
diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp
index 778d88a0b..2d9293e0f 100644
--- a/src/resources/db/deaddb.cpp
+++ b/src/resources/db/deaddb.cpp
@@ -73,7 +73,7 @@ void DeadDB::loadXmlFile(const std::string &fileName,
}
else if (xmlNameEqual(node, "message"))
{
- char *const data = reinterpret_cast<char*>(
+ XmlChar *const data = reinterpret_cast<XmlChar*>(
XmlNodeGetContent(node));
if (!data)
continue;
diff --git a/src/resources/db/questdb.cpp b/src/resources/db/questdb.cpp
index da05721b1..89228f038 100644
--- a/src/resources/db/questdb.cpp
+++ b/src/resources/db/questdb.cpp
@@ -83,7 +83,7 @@ static void loadQuest(const int var,
{
if (!xmlTypeEqual(dataNode, XML_ELEMENT_NODE))
continue;
- char *const data = reinterpret_cast<char*>(
+ XmlChar *const data = reinterpret_cast<XmlChar*>(
XmlNodeGetContent(dataNode));
if (!data)
continue;
diff --git a/src/utils/xml/libxml.inc b/src/utils/xml/libxml.inc
index b342fe59d..1bf4fddd5 100644
--- a/src/utils/xml/libxml.inc
+++ b/src/utils/xml/libxml.inc
@@ -61,6 +61,8 @@ __XML_XMLWRITER_H__
(node)->xmlChildrenNode->content)
#define XmlFree(ptr) xmlFree(ptr)
#define XmlNodeDefault nullptr
+#define XmlChar char
+#define XmlConstChar const char
#endif // ENABLE_LIBXML
#endif // UTILS_XML_LIBXML_INC
diff --git a/src/utils/xml/pugixml.inc b/src/utils/xml/pugixml.inc
index 31ceee0eb..d8ef38242 100644
--- a/src/utils/xml/pugixml.inc
+++ b/src/utils/xml/pugixml.inc
@@ -47,6 +47,8 @@
#define XmlTextWriterStartDocument(writer, p1, p2, p3)
#define XmlTextWriterEndDocument(writer) (writer)->endDocument()
#define XmlFreeTextWriter(writer) delete writer
+#define XmlChar const char
+#define XmlConstChar const char
#endif // ENABLE_PUGIXML
#endif // UTILS_XML_PUGIXML_INC