Selaa lähdekoodia

Merge branch 'master' of github.com:leethomason/tinyxml2

Lee Thomason (grinliz) 13 vuotta sitten
vanhempi
commit
99024dc20b
2 muutettua tiedostoa jossa 7 lisäystä ja 42 poistoa
  1. 5 3
      tinyxml2/tinyxml2.vcxproj
  2. 2 39
      xmltest.cpp

+ 5 - 3
tinyxml2/tinyxml2.vcxproj

@@ -85,7 +85,7 @@
       </PrecompiledHeader>
       <WarningLevel>Level4</WarningLevel>
       <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>;_CONSOLE;WIN32;_DEBUG;%(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>
@@ -145,7 +145,9 @@
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\tinyxml2.cpp" />
-    <ClCompile Include="..\xmltest.cpp" />
+    <ClCompile Include="..\xmltest.cpp">
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">_CRT_SECURE_NO_WARNINGS;_CONSOLE;WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\tinyxml2.h" />

+ 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 )
 		{
@@ -999,14 +969,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 );