mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-06-07 07:03:41 +00:00
Shut up visual studio
This commit is contained in:
parent
77d7f206f6
commit
186476c665
34
tinyxml2.cpp
34
tinyxml2.cpp
@ -1509,16 +1509,15 @@ int XMLDocument::LoadFile( const char* filename )
|
|||||||
{
|
{
|
||||||
DeleteChildren();
|
DeleteChildren();
|
||||||
InitDocument();
|
InitDocument();
|
||||||
|
FILE* fp = 0;
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
|
||||||
#pragma warning ( push )
|
errno_t err = fopen_s(&fp, filename, "rb" );
|
||||||
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
if ( !fp || err) {
|
||||||
#endif
|
#else
|
||||||
FILE* fp = fopen( filename, "rb" );
|
fp = fopen( filename, "rb" );
|
||||||
#if defined(_MSC_VER)
|
if ( !fp) {
|
||||||
#pragma warning ( pop )
|
#endif
|
||||||
#endif
|
|
||||||
if ( !fp ) {
|
|
||||||
SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 );
|
SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 );
|
||||||
return errorID;
|
return errorID;
|
||||||
}
|
}
|
||||||
@ -1565,15 +1564,14 @@ int XMLDocument::LoadFile( FILE* fp )
|
|||||||
|
|
||||||
int XMLDocument::SaveFile( const char* filename )
|
int XMLDocument::SaveFile( const char* filename )
|
||||||
{
|
{
|
||||||
#if defined(_MSC_VER)
|
FILE* fp = 0;
|
||||||
#pragma warning ( push )
|
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
|
||||||
#pragma warning ( disable : 4996 ) // Fail to see a compelling reason why this should be deprecated.
|
errno_t err = fopen_s(&fp, filename, "w" );
|
||||||
#endif
|
if ( !fp || err) {
|
||||||
FILE* fp = fopen( filename, "w" );
|
#else
|
||||||
#if defined(_MSC_VER)
|
fp = fopen( filename, "rb" );
|
||||||
#pragma warning ( pop )
|
if ( !fp) {
|
||||||
#endif
|
#endif
|
||||||
if ( !fp ) {
|
|
||||||
SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );
|
SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );
|
||||||
return errorID;
|
return errorID;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user