فهرست منبع

Replaced pragmas with compiler define.

Thomas Roß 13 سال پیش
والد
کامیت
0922b7389f
2فایلهای تغییر یافته به همراه4 افزوده شده و 41 حذف شده
  1. 2 2
      tinyxml2/tinyxml2.vcxproj
  2. 2 39
      xmltest.cpp

+ 2 - 2
tinyxml2/tinyxml2.vcxproj

@@ -85,7 +85,7 @@
       </PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>false</ExceptionHandling>
     </ClCompile>
     <Link>
@@ -115,7 +115,7 @@
       <Optimization>MaxSpeed</Optimization>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
     </ClCompile>
     <Link>

+ 2 - 39
xmltest.cpp

@@ -153,11 +153,6 @@ int main( int /*argc*/, const char ** /*argv*/ )
 		_CrtMemCheckpoint( &startMemState );
 	#endif
 
-	#if defined(_MSC_VER)
-	#pragma warning ( push )
-	#pragma warning ( disable : 4996 )		// Fail to see a compelling reason why this should be deprecated.
-	#endif
-
 	#if defined(_MSC_VER)
 		_mkdir( "resources/out/" );
 	#else
@@ -178,10 +173,6 @@ int main( int /*argc*/, const char ** /*argv*/ )
 	}
 	fclose( fp );
 
-	#if defined(_MSC_VER)
-	#pragma warning ( pop )
-	#endif
-
 	XMLTest( "Example-1", 0, example_1() );
 	XMLTest( "Example-2", 0, example_2() );
 	XMLTest( "Example-3", 0, example_3() );
@@ -424,16 +415,8 @@ int main( int /*argc*/, const char ** /*argv*/ )
 		// Check the round trip.
 		int okay = 0;
 
-
-#if defined(_MSC_VER)
-#pragma warning ( push )
-#pragma warning ( disable : 4996 )		// Fail to see a compelling reason why this should be deprecated.
-#endif
 		FILE* saved  = fopen( "resources/out/utf8testout.xml", "r" );
 		FILE* verify = fopen( "resources/utf8testverify.xml", "r" );
-#if defined(_MSC_VER)
-#pragma warning ( pop )
-#endif
 
 		if ( saved && verify )
 		{
@@ -548,28 +531,15 @@ int main( int /*argc*/, const char ** /*argv*/ )
 
 		XMLTest( "Entity transformation: read. ", expected, context, true );
 
-#if defined(_MSC_VER)
-#pragma warning ( push )
-#pragma warning ( disable : 4996 )		// Fail to see a compelling reason why this should be deprecated.
-#endif
 		FILE* textfile = fopen( "resources/out/textfile.txt", "w" );
-#if defined(_MSC_VER)
-#pragma warning ( pop )
-#endif
 		if ( textfile )
 		{
 			XMLPrinter streamer( textfile );
 			psg->Accept( &streamer );
 			fclose( textfile );
 		}
-#if defined(_MSC_VER)
-#pragma warning ( push )
-#pragma warning ( disable : 4996 )		// Fail to see a compelling reason why this should be deprecated.
-#endif
-		textfile = fopen( "resources/out/textfile.txt", "r" );
-#if defined(_MSC_VER)
-#pragma warning ( pop )
-#endif
+
+        textfile = fopen( "resources/out/textfile.txt", "r" );
 		TIXMLASSERT( textfile );
 		if ( textfile )
 		{
@@ -980,14 +950,7 @@ int main( int /*argc*/, const char ** /*argv*/ )
 		QueryPerformanceFrequency( (LARGE_INTEGER*) &freq );
 #endif
 
-#if defined(_MSC_VER)
-#pragma warning ( push )
-#pragma warning ( disable : 4996 )		// Fail to see a compelling reason why this should be deprecated.
-#endif
 		FILE* fp  = fopen( "resources/dream.xml", "r" );
-#if defined(_MSC_VER)
-#pragma warning ( pop )
-#endif
 		fseek( fp, 0, SEEK_END );
 		long size = ftell( fp );
 		fseek( fp, 0, SEEK_SET );