we do not need a USE_LIBXML define, xml is a hard requirement.

This commit is contained in:
Enno Rehling 2017-12-09 21:04:27 +01:00
parent 866abcc92c
commit ffbc9596d7
7 changed files with 0 additions and 28 deletions

View File

@ -294,5 +294,4 @@ include_directories (${LIBXML2_INCLUDE_DIR})
target_link_libraries(eressea ${LIBXML2_LIBRARIES})
target_link_libraries(convert ${LIBXML2_LIBRARIES})
target_link_libraries(test_eressea ${LIBXML2_LIBRARIES})
add_definitions(-DUSE_LIBXML2)
endif (LIBXML2_FOUND)

View File

@ -1,10 +1,8 @@
#include <platform.h>
#ifdef USE_LIBXML2
#include <kernel/xmlreader.h>
#include <util/xml.h>
#endif
#include <kernel/race.h>
#include <kernel/rules.h>
#include <races/races.h>
@ -21,12 +19,9 @@ int main(int argc, char **argv) {
const char *mode;
register_races();
#ifdef USE_LIBXML2
register_xmlreader();
#endif
if (argc < 2) return usage();
mode = argv[1];
#ifdef USE_LIBXML2
if (strcmp(mode, "rules")==0) {
const char *xmlfile, *catalog;
if (argc < 4) return usage();
@ -36,7 +31,6 @@ int main(int argc, char **argv) {
write_rules("rules.dat");
return 0;
}
#endif
if (strcmp(mode, "po")==0) {
return 0;
}

View File

@ -85,9 +85,7 @@ void game_init(void)
register_weapons();
register_xerewards();
#ifdef USE_LIBXML2
register_xmlreader();
#endif
register_attributes();
register_gmcmd();

View File

@ -73,11 +73,9 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "guard.h"
#include "prefix.h"
#ifdef USE_LIBXML2
/* libxml includes */
#include <libxml/tree.h>
#include <libxml/xpath.h>
#endif
/* external libraries */
#include <iniparser.h>
@ -602,9 +600,7 @@ void kernel_done(void)
/* calling this function releases memory assigned to static variables, etc.
* calling it is optional, e.g. a release server will most likely not do it.
*/
#ifdef USE_LIBXML2
xml_done();
#endif
attrib_done();
item_done();
message_done();

View File

@ -48,12 +48,10 @@ without prior permission by the authors of Eressea.
#include <util/nrmessage.h>
#include <util/xml.h>
#ifdef USE_LIBXML2
/* libxml includes */
#include <libxml/tree.h>
#include <libxml/xpath.h>
#include <libxml/encoding.h>
#endif
/* libc includes */
#include <assert.h>
@ -61,7 +59,6 @@ without prior permission by the authors of Eressea.
#include <limits.h>
#include <string.h>
#ifdef USE_LIBXML2
static variant xml_fraction(xmlNodePtr node, const char *name) {
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
@ -1761,4 +1758,3 @@ void register_xmlreader(void)
xml_register_callback(parse_strings);
xml_register_callback(parse_messages);
}
#endif

View File

@ -16,10 +16,8 @@
#include "log.h"
#include "assert.h"
#ifdef USE_LIBXML2
#include <libxml/catalog.h>
#include <libxml/xmlstring.h>
#endif
/* libc includes */
#include <stdio.h>
@ -27,7 +25,6 @@
#include <string.h>
#include <ctype.h>
#ifdef USE_LIBXML2
int xml_ivalue(xmlNodePtr node, const char *name, int dflt)
{
int i = dflt;
@ -110,11 +107,9 @@ void xml_register_callback(xml_callback callback)
insert = &(*insert)->next;
*insert = reader;
}
#endif
int read_xml(const char *filename, const char *catalog)
{
#ifdef USE_LIBXML2
xml_reader *reader = xmlReaders;
xmlDocPtr doc;
int result;
@ -141,8 +136,4 @@ int read_xml(const char *filename, const char *catalog)
}
xmlFreeDoc(doc);
return result;
#else
log_error("LIBXML2 disabled, cannot read %s.\n", filename);
return -1;
#endif
}

View File

@ -19,7 +19,6 @@
extern "C" {
#endif
#ifdef USE_LIBXML2
/* new xml functions: */
#include <libxml/tree.h>
@ -30,7 +29,6 @@ extern "C" {
double xml_fvalue(xmlNodePtr node, const char *name, double dflt);
int xml_ivalue(xmlNodePtr node, const char *name, int dflt);
bool xml_bvalue(xmlNodePtr node, const char *name, bool dflt);
#endif
void xml_done(void);
int read_xml(const char *filename, const char *catalog);