Refactor GenerateGlobalCFlagsAndProperties
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h

Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp
--- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp	2005-01-15 22:32:01 UTC (rev 13068)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.cpp	2005-01-15 23:00:02 UTC (rev 13069)
@@ -60,8 +60,43 @@
 }
 
 void
+MingwBackend::GenerateProjectCFlagsMacro ( const char* assignmentOperation,
+                                           const vector<Include*>& includes,
+                                           const vector<Define*>& defines ) const
+{
+	size_t i;
+
+	fprintf (
+		fMakefile,
+		"PROJECT_CFLAGS %s",
+		assignmentOperation );
+	for ( i = 0; i < includes.size(); i++ )
+	{
+		fprintf (
+			fMakefile,
+			" -I%s",
+			includes[i]->directory.c_str() );
+	}
+	
+	for ( i = 0; i < defines.size(); i++ )
+	{
+		Define& d = *defines[i];
+		fprintf (
+			fMakefile,
+			" -D%s",
+			d.name.c_str() );
+		if ( d.value.size() )
+			fprintf (
+				fMakefile,
+				"=%s",
+				d.value.c_str() );
+	}
+	fprintf ( fMakefile, "\n" );
+}
+
+void
 MingwBackend::GenerateGlobalCFlagsAndProperties (
-	const char* op,
+	const char* assignmentOperation,
 	const vector<Property*>& properties,
 	const vector<Include*>& includes,
 	const vector<Define*>& defines,
@@ -79,31 +114,9 @@
 
 	if ( includes.size() || defines.size() )
 	{
-		fprintf (
-			fMakefile,
-			"PROJECT_CFLAGS %s",
-			op );
-		for ( i = 0; i < includes.size(); i++ )
-		{
-			fprintf (
-				fMakefile,
-				" -I%s",
-				includes[i]->directory.c_str() );
-		}
-		for ( i = 0; i < defines.size(); i++ )
-		{
-			Define& d = *defines[i];
-			fprintf (
-				fMakefile,
-				" -D%s",
-				d.name.c_str() );
-			if ( d.value.size() )
-				fprintf (
-					fMakefile,
-					"=%s",
-					d.value.c_str() );
-		}
-		fprintf ( fMakefile, "\n" );
+		GenerateProjectCFlagsMacro ( assignmentOperation,
+                                     includes,
+                                     defines );
 	}
 
 	for ( i = 0; i < ifs.size(); i++ )

Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h
--- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h	2005-01-15 22:32:01 UTC (rev 13068)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/mingw.h	2005-01-15 23:00:02 UTC (rev 13069)
@@ -14,13 +14,14 @@
 	void CreateMakefile ();
 	void CloseMakefile ();
 	void GenerateHeader ();
-	void
-	MingwBackend::GenerateGlobalCFlagsAndProperties (
-		const char* op,
-		const std::vector<Property*>& properties,
-		const std::vector<Include*>& includes,
-		const std::vector<Define*>& defines,
-		const std::vector<If*>& ifs );
+	void GenerateProjectCFlagsMacro ( const char* assignmentOperation,
+	                                  const std::vector<Include*>& includes,
+	                                  const std::vector<Define*>& defines ) const;
+	void GenerateGlobalCFlagsAndProperties ( const char* op,
+	                                         const std::vector<Property*>& properties,
+	                                         const std::vector<Include*>& includes,
+	                                         const std::vector<Define*>& defines,
+	                                         const std::vector<If*>& ifs );
 	std::string GenerateProjectLFLAGS ();
 	void GenerateGlobalVariables ();
 	void GenerateAllTarget ();