Compare commits
6 Commits
firewave-e
...
lthomaso/c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2d675139b | ||
|
|
a1ea80ba74 | ||
|
|
435c0a1199 | ||
|
|
4cc4145d7f | ||
|
|
6cc405853b | ||
|
|
f6c991658b |
22
meson.build
22
meson.build
@@ -62,26 +62,6 @@ if meson.version().version_compare('>= 0.54.0')
|
||||
endif
|
||||
|
||||
if get_option('tests')
|
||||
# Try to find a copy command. If this is windows we probably don't have cp,
|
||||
# but if this is msys then we do, so make cp not required in that case, and
|
||||
# try Xcopy if cp isn't found
|
||||
prog_cp = find_program('cp', required : build_machine.system() != 'windows')
|
||||
command = ['-r']
|
||||
if not prog_cp.found()
|
||||
prog_cp = find_program('Xcopy')
|
||||
command = ['/E', '/I']
|
||||
endif
|
||||
|
||||
# Copy the test resources into the build dir
|
||||
run_command(
|
||||
prog_cp,
|
||||
[
|
||||
command,
|
||||
meson.current_source_dir() / 'resources',
|
||||
meson.current_build_dir(),
|
||||
],
|
||||
)
|
||||
|
||||
test(
|
||||
'xmltest',
|
||||
executable(
|
||||
@@ -89,7 +69,7 @@ if get_option('tests')
|
||||
['xmltest.cpp'],
|
||||
link_with : [lib_tinyxml2],
|
||||
),
|
||||
workdir : meson.current_build_dir(),
|
||||
workdir : meson.current_source_dir(),
|
||||
)
|
||||
endif
|
||||
|
||||
|
||||
20
tinyxml2.cpp
20
tinyxml2.cpp
@@ -104,7 +104,7 @@ distribution.
|
||||
#define TIXML_FSEEK _fseeki64
|
||||
#define TIXML_FTELL _ftelli64
|
||||
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) \
|
||||
|| defined(__NetBSD__) || defined(__DragonFly__) || defined(__ANDROID__)
|
||||
|| defined(__NetBSD__) || defined(__DragonFly__) || defined(__ANDROID__) || (__CYGWIN__)
|
||||
#define TIXML_FSEEK fseeko
|
||||
#define TIXML_FTELL ftello
|
||||
#elif defined(__unix__) && defined(__x86_64__)
|
||||
@@ -1777,11 +1777,11 @@ XMLError XMLElement::QueryInt64Text(int64_t* ival) const
|
||||
}
|
||||
|
||||
|
||||
XMLError XMLElement::QueryUnsigned64Text(uint64_t* ival) const
|
||||
XMLError XMLElement::QueryUnsigned64Text(uint64_t* uval) const
|
||||
{
|
||||
if(FirstChild() && FirstChild()->ToText()) {
|
||||
const char* t = FirstChild()->Value();
|
||||
if(XMLUtil::ToUnsigned64(t, ival)) {
|
||||
if(XMLUtil::ToUnsigned64(t, uval)) {
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
return XML_CAN_NOT_CONVERT_TEXT;
|
||||
@@ -2413,21 +2413,21 @@ XMLError XMLDocument::SaveFile( FILE* fp, bool compact )
|
||||
}
|
||||
|
||||
|
||||
XMLError XMLDocument::Parse( const char* p, size_t len )
|
||||
XMLError XMLDocument::Parse( const char* xml, size_t nBytes )
|
||||
{
|
||||
Clear();
|
||||
|
||||
if ( len == 0 || !p || !*p ) {
|
||||
if ( nBytes == 0 || !xml || !*xml ) {
|
||||
SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );
|
||||
return _errorID;
|
||||
}
|
||||
if ( len == static_cast<size_t>(-1) ) {
|
||||
len = strlen( p );
|
||||
if ( nBytes == static_cast<size_t>(-1) ) {
|
||||
nBytes = strlen( xml );
|
||||
}
|
||||
TIXMLASSERT( _charBuffer == 0 );
|
||||
_charBuffer = new char[ len+1 ];
|
||||
memcpy( _charBuffer, p, len );
|
||||
_charBuffer[len] = 0;
|
||||
_charBuffer = new char[ nBytes+1 ];
|
||||
memcpy( _charBuffer, xml, nBytes );
|
||||
_charBuffer[nBytes] = 0;
|
||||
|
||||
Parse();
|
||||
if ( Error() ) {
|
||||
|
||||
Reference in New Issue
Block a user