Less header dependencies, some compilation fixes for Borland/Intel/MW compilers

git-svn-id: http://pugixml.googlecode.com/svn/trunk@103 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2009-01-06 00:02:42 +00:00
parent 5a2fa3fe50
commit c507d9b10e
3 changed files with 10 additions and 7 deletions

View File

@ -15,15 +15,18 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <new> #include <new>
#include <exception>
#if !defined(PUGIXML_NO_XPATH) && defined(PUGIXML_NO_EXCEPTIONS) #if !defined(PUGIXML_NO_XPATH) && defined(PUGIXML_NO_EXCEPTIONS)
#error No exception mode can't be used with XPath support #error No exception mode can't be used with XPath support
#endif #endif
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
# include <fstream> # include <istream>
# include <ostream>
#endif #endif
#ifdef _MSC_VER #ifdef _MSC_VER
@ -39,6 +42,7 @@
#ifdef __BORLANDC__ #ifdef __BORLANDC__
// BC workaround // BC workaround
using std::memmove; using std::memmove;
using std::memcpy;
#endif #endif
#define STATIC_ASSERT(cond) { static const char condition_failed[(cond) ? 1 : -1] = {0}; (void)condition_failed[0]; } #define STATIC_ASSERT(cond) { static const char condition_failed[(cond) ? 1 : -1] = {0}; (void)condition_failed[0]; }
@ -1412,7 +1416,7 @@ namespace
unsigned int ch = (unsigned char)*s++; unsigned int ch = (unsigned char)*s++;
char buf[8]; char buf[8];
sprintf(buf, "&#%d;", ch); sprintf(buf, "&#%u;", ch);
writer.write(buf); writer.write(buf);
} }
@ -1578,7 +1582,7 @@ namespace pugi
void xml_writer_stream::write(const void* data, size_t size) void xml_writer_stream::write(const void* data, size_t size)
{ {
stream->write(reinterpret_cast<const char*>(data), size); stream->write(reinterpret_cast<const char*>(data), static_cast<std::streamsize>(size));
} }
#endif #endif

View File

@ -18,8 +18,7 @@
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
# include <string> # include <string>
# include <istream> # include <iosfwd>
# include <exception>
#endif #endif
// No XPath without STL // No XPath without STL
@ -30,7 +29,6 @@
#endif #endif
#include <stddef.h> #include <stddef.h>
#include <string.h>
/// The PugiXML Parser namespace. /// The PugiXML Parser namespace.
namespace pugi namespace pugi

View File

@ -17,12 +17,13 @@
#include <algorithm> #include <algorithm>
#include <cassert> #include <assert.h>
#include <stdio.h> #include <stdio.h>
#include <math.h> #include <math.h>
#include <float.h> #include <float.h>
#include <ctype.h> #include <ctype.h>
#include <string.h>
#if defined(_MSC_VER) #if defined(_MSC_VER)
# pragma warning(disable: 4127) // conditional expression is constant # pragma warning(disable: 4127) // conditional expression is constant