Author: shadowmaster
Date: Tue Mar 22 09:40:33 2011
New Revision: 48972
URL: http://svn.gna.org/viewcvs/wesnoth?rev=48972&view=rev
Log:
config: Treat VERSION specially when probing cache invalidation scenarios
It's not explained in the code at all, but I guess the point of
invalidating the cache when a non-empty or non-argless macro has been
defined is to make sure the cache was really automatically generated and
not tampered with by the user. In such case it should be safe to make an
exception for VERSION, the first engine-generated non-empty macro so
far.
I can't imagine a situation where this would break any other assumptions
at the moment, so I'll leave it to the testers.
Modified:
trunk/src/config_cache.cpp
Modified: trunk/src/config_cache.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config_cache.cpp?rev=48972&r1=48971&r2=48972&view=diff
==============================================================================
--- trunk/src/config_cache.cpp (original)
+++ trunk/src/config_cache.cpp Tue Mar 22 09:40:33 2011
@@ -162,9 +162,13 @@
defines_string << path;
for(preproc_map::const_iterator i = defines_map_.begin(); i !=
defines_map_.end(); ++i) {
if(i->second.value != "" || i->second.arguments.empty()
== false) {
- is_valid = false;
- ERR_CACHE << "Preprocessor define not valid\n";
- break;
+ // VERSION is defined non-empty by the engine,
+ // it should be safe to rely on caches
containing it.
+ if(i->first != "VERSION") {
+ is_valid = false;
+ ERR_CACHE << "Preprocessor define not
valid\n";
+ break;
+ }
}
defines_string << " " << i->first;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits