From 1ea53e16dd8d4f37092813e8da7839b96f599bc6 Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Fri, 8 Dec 2006 14:25:56 +0000 Subject: More NO_STL fixes git-svn-id: http://pugixml.googlecode.com/svn/trunk@14 99668b35-9821-0410-8761-19e4c4f06640 --- src/pugixml.cpp | 19 ++++++++++++------- src/pugixml.hpp | 3 +++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 382bf50..b77a21d 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -13,6 +13,11 @@ #include "pugixml.hpp" +#include +#include + +#include + namespace pugi { /// A 'name=value' XML attribute structure. @@ -539,7 +544,7 @@ namespace pugi // \return pointer to the new node xml_node_struct* append_node(xml_node_struct* parent, xml_node_type type = node_element) { - if(!parent) return NULL; // Must have a parent. + if(!parent) return 0; // Must have a parent. xml_node_struct* child = alloc.allocate(type); // Allocate a new child. child->parent = parent; // Set it's parent pointer. @@ -558,7 +563,7 @@ namespace pugi // \return pointer to appended xml_attribute_struct. xml_attribute_struct* append_attribute(xml_node_struct* node) { - if(!node) return NULL; + if(!node) return 0; xml_attribute_struct* a = alloc.allocate(); if (node->last_attribute) @@ -594,7 +599,7 @@ namespace pugi // \param s - pointer to XML-formatted string. // \param xmldoc - pointer to root. // \param optmsk - parse options mask. - // \return last string position or null. + // \return last string position or NULL. char* parse(register char* s,xml_node_struct* xmldoc,unsigned int optmsk = parse_default) { if(!s || !xmldoc) return s; @@ -1098,7 +1103,7 @@ namespace pugi return true; } - xml_attribute::xml_attribute(): _attr(NULL) + xml_attribute::xml_attribute(): _attr(0) { } @@ -1189,7 +1194,7 @@ namespace pugi bool xml_attribute::empty() const { - return (_attr == NULL); + return (_attr == 0); } const char* xml_attribute::name() const @@ -1915,7 +1920,7 @@ namespace pugi char* xml_parser::parse(char* xmlstr,unsigned int optmsk) { - if(!xmlstr) return NULL; + if(!xmlstr) return 0; xml_allocator alloc(&_memory); @@ -1930,7 +1935,7 @@ namespace pugi char* xml_parser::parse(const transfer_ownership_tag&, char* xmlstr,unsigned int optmsk) { - if(!xmlstr) return NULL; + if(!xmlstr) return 0; delete[] _buffer; _buffer = xmlstr; diff --git a/src/pugixml.hpp b/src/pugixml.hpp index 6f9bd6e..739caaa 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -14,6 +14,9 @@ #ifndef HEADER_PUGIXML_HPP #define HEADER_PUGIXML_HPP +// Uncomment this to disable STL +// #define PUGIXML_NO_STL + #ifndef PUGIXML_NO_STL # include # include -- cgit v1.2.3