Generate .dsp files with matching !IF/!ELSEIF and !ENDIF directives to make NMAKE accept them.
Modified: trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp

Modified: trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
--- trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp	2005-11-21 20:41:34 UTC (rev 19420)
+++ trunk/reactos/tools/rbuild/backend/msvc/msvcmaker.cpp	2005-11-21 20:46:55 UTC (rev 19421)
@@ -261,26 +261,21 @@
 	if ( !lib && !exe ) fprintf ( OUT, "MTL=midl.exe\r\n" );
 	fprintf ( OUT, "RSC=rc.exe\r\n" );
 
-	int n = 0;
-
 	std::string output_dir;
 	for ( size_t icfg = 0; icfg < cfgs.size(); icfg++ )
 	{
 		std::string& cfg = cfgs[icfg];
-		if ( icfg )
+		if ( icfg == 0 )
 		{
-			if ( n == 0 )
-			{
-				fprintf ( OUT, "!IF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
-				fprintf ( OUT, "\r\n" );
-			}
-			else
-			{
-				fprintf ( OUT, "\r\n" );
-				fprintf ( OUT, "!ELSEIF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
-				fprintf ( OUT, "\r\n" );
-			}
+			fprintf ( OUT, "!IF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
+			fprintf ( OUT, "\r\n" );
 		}
+		else
+		{
+			fprintf ( OUT, "\r\n" );
+			fprintf ( OUT, "!ELSEIF  \"$(CFG)\" == \"%s\"\r\n", cfg.c_str() );
+			fprintf ( OUT, "\r\n" );
+		}
 
 		bool debug = !strstr ( cfg.c_str(), "Release" );
 		bool msvc_headers = ( 0 != strstr ( cfg.c_str(), "MSVC Headers" ) );
@@ -569,8 +564,6 @@
 			fprintf ( OUT, "# ADD BASE LIB32 /nologo\r\n" );
 			fprintf ( OUT, "# ADD LIB32 /nologo\r\n" );
 		}
-
-		n++;
 	}
 
 	if ( cfgs.size() != 0 )