Update to spice2x-25-04-25 (pre-apply)

> broken commit
This commit is contained in:
[ ]
2025-05-07 00:25:31 +09:00
parent 04dee88276
commit c94de456b5
543 changed files with 78491 additions and 91698 deletions
+36 -8
View File
@@ -2110,7 +2110,23 @@ XMLUnknown* XMLDocument::NewUnknown( const char* str )
return unk;
}
static FILE* callfopen( const char* filepath, const char* mode )
static FILE* callfopen( const wchar_t* filepath, const wchar_t* mode )
{
TIXMLASSERT( filepath );
TIXMLASSERT( mode );
#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)
FILE* fp = 0;
errno_t err = _wfopen_s( &fp, filepath, mode );
if ( err ) {
return 0;
}
#else
FILE* fp = _wfopen( filepath, mode );
#endif
return fp;
}
static FILE* callfopenA( const char* filepath, const char* mode )
{
TIXMLASSERT( filepath );
TIXMLASSERT( mode );
@@ -2143,13 +2159,25 @@ void XMLDocument::DeleteNode( XMLNode* node ) {
}
}
XMLError XMLDocument::LoadFile( const char* filename )
XMLError XMLDocument::LoadFile( const wchar_t* filename )
{
Clear();
FILE* fp = callfopen( filename, "rb" );
FILE* fp = callfopen( filename, L"rb" );
if ( !fp ) {
SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0, 0 );
SetError( XML_ERROR_FILE_NOT_FOUND, 0, 0, 0 );
return _errorID;
}
LoadFile( fp );
fclose( fp );
return _errorID;
}
XMLError XMLDocument::LoadFileA( const char* filename )
{
Clear();
FILE* fp = callfopenA( filename, "rb" );
if ( !fp ) {
SetError( XML_ERROR_FILE_NOT_FOUND, 0, 0, 0 );
return _errorID;
}
LoadFile( fp );
@@ -2226,11 +2254,11 @@ XMLError XMLDocument::LoadFile( FILE* fp )
}
XMLError XMLDocument::SaveFile( const char* filename, bool compact )
XMLError XMLDocument::SaveFile( const wchar_t* filename, bool compact )
{
FILE* fp = callfopen( filename, "w" );
FILE* fp = callfopen( filename, L"w" );
if ( !fp ) {
SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0, 0 );
SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, 0, 0 );
return _errorID;
}
SaveFile(fp, compact);
+3 -2
View File
@@ -1665,7 +1665,8 @@ public:
Returns XML_SUCCESS (0) on success, or
an errorID.
*/
XMLError LoadFile( const char* filename );
XMLError LoadFile( const wchar_t* filename );
XMLError LoadFileA( const char* filename );
/**
Load an XML file from disk. You are responsible
@@ -1685,7 +1686,7 @@ public:
Returns XML_SUCCESS (0) on success, or
an errorID.
*/
XMLError SaveFile( const char* filename, bool compact = false );
XMLError SaveFile( const wchar_t* filename, bool compact = false );
/**
Save the XML file to disk. You are responsible