Author: hpoussin
Date: Fri Oct 19 19:06:11 2007
New Revision: 29684
URL:
http://svn.reactos.org/svn/reactos?rev=29684&view=rev
Log:
Add an 'overridable' attribute on defines.
Suggestion by Marc Piulachs
Modified:
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
trunk/reactos/tools/rbuild/define.cpp
trunk/reactos/tools/rbuild/project.dtd
trunk/reactos/tools/rbuild/rbuild.h
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Fri Oct 19 19:06:11 2007
@@ -813,25 +813,35 @@
}
for ( i = 0; i < data.defines.size(); i++ )
{
- const Define& d = *data.defines[i];
- if (used_defs && used_defs->find(d.name) != used_defs->end())
+ const Define& define = *data.defines[i];
+ if ( used_defs && used_defs->find ( define.name ) != used_defs->end () )
{
+#if 0 /* FIXME: activate */
+ if ( !define.overridable )
+ {
+ throw InvalidOperationException ( __FILE__,
+ __LINE__,
+ "Invalid override of define '%s' in
'%s'",
+ define.name.c_str (),
+ module.name.c_str () );
+ }
+#endif
if ( backend->configuration.Verbose )
printf("%s define overridden in '%s' module\n",
- d.name.c_str (), module.name.c_str () );
+ define.name.c_str (), module.name.c_str () );
continue;
}
fprintf (
fMakefile,
" -D%s",
- d.name.c_str() );
- if ( d.value.size() )
+ define.name.c_str() );
+ if ( define.value.size() )
fprintf (
fMakefile,
"=%s",
- d.value.c_str() );
- if (used_defs)
- used_defs->insert(used_defs->begin(), d.name);
+ define.value.c_str() );
+ if ( used_defs )
+ used_defs->insert(used_defs->begin(), define.name);
}
if ( generateAssignment )
{
Modified: trunk/reactos/tools/rbuild/define.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/define.cpp?re…
==============================================================================
--- trunk/reactos/tools/rbuild/define.cpp (original)
+++ trunk/reactos/tools/rbuild/define.cpp Fri Oct 19 19:06:11 2007
@@ -63,12 +63,21 @@
Define::Initialize()
{
const XMLAttribute* att = node->GetAttribute ( "name", true );
- const XMLAttribute* bck = node->GetAttribute ( "backend", false );
+
+ att = node->GetAttribute ( "name", true );
assert(att);
name = att->value;
value = node->value;
- if ( bck )
- backend = bck->value;
+
+ att = node->GetAttribute ( "backend", false );
+ if ( att )
+ backend = att->value;
+
+ att = node->GetAttribute ( "overridable", false );
+ if ( att )
+ overridable = ( att->value == "true" || att->value == "yes"
);
+ else
+ overridable = false;
}
void
Modified: trunk/reactos/tools/rbuild/project.dtd
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/project.dtd?r…
==============================================================================
--- trunk/reactos/tools/rbuild/project.dtd (original)
+++ trunk/reactos/tools/rbuild/project.dtd Fri Oct 19 19:06:11 2007
@@ -37,6 +37,7 @@
<!ELEMENT define (#PCDATA)>
<!ATTLIST define
name %CIdentifier; #REQUIRED
+ overridable (true) #IMPLIED
<!ELEMENT directory
(compilationunit*|directory*|group*|cdfile|file*|if*|ifnot*|module+|pch*|xi:include*)+>
Modified: trunk/reactos/tools/rbuild/rbuild.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/rbuild.h?rev=…
==============================================================================
--- trunk/reactos/tools/rbuild/rbuild.h (original)
+++ trunk/reactos/tools/rbuild/rbuild.h Fri Oct 19 19:06:11 2007
@@ -426,6 +426,7 @@
std::string name;
std::string value;
std::string backend;
+ bool overridable;
Define ( const Project& project,
const XMLElement& defineNode );