Author: mordante
Date: Tue Feb 26 22:00:55 2008
New Revision: 24095
URL: http://svn.gna.org/viewcvs/wesnoth?rev=24095&view=rev
Log:
Fixed a bug where addons with recusive INCLUDES could no longer be loaded
(bug #11160).
Modified:
trunk/changelog
trunk/players_changelog
trunk/src/serialization/preprocessor.cpp
Modified: trunk/changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=24095&r1=24094&r2=24095&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Feb 26 22:00:55 2008
@@ -14,6 +14,9 @@
* added new music track, "The King is Dead" by Mattias Westlund.
* updated music track, "Traveling Minstrels" by Mattias Westlund.
* changed the default story screen music from loyalists.ogg to
revelation.ogg
+ * WML engine:
+ * fixed a bug where addons with recusive INCLUDES could no longer be loaded
+ (bug #11160)
* miscellaneous and bug fixes:
* units with a death sound but no death animation now play their death
sound correctly
Modified: trunk/players_changelog
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/players_changelog?rev=24095&r1=24094&r2=24095&view=diff
==============================================================================
--- trunk/players_changelog (original)
+++ trunk/players_changelog Tue Feb 26 22:00:55 2008
@@ -12,6 +12,8 @@
* New music track, "The King is Dead" by Mattias Westlund.
* Updated music track, "Traveling Minstrels" by Mattias Westlund.
+ * Miscellaneous and bug fixes
+ * Some addons failed to load, this has been fixed.
Version 1.3.19:
* Language and translations
Modified: trunk/src/serialization/preprocessor.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.cpp?rev=24095&r1=24094&r2=24095&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.cpp (original)
+++ trunk/src/serialization/preprocessor.cpp Tue Feb 26 22:00:55 2008
@@ -720,22 +720,24 @@
}
// If this is a known pre-processing symbol, then we
insert it,
// otherwise we assume it's a file name to load.
- preproc_map::const_iterator macro =
target_.defines_->find(symbol),
- unknown_macro =
target_.defines_->end();
- if (macro != unknown_macro) {
+ preproc_map::const_iterator macro =
target_.defines_->find(symbol);
+ if(macro != target_.defines_->end()) {
- for(std::vector<std::string>::iterator
iter=called_macros_->begin(); iter!=called_macros_->end(); ++iter)
- {
- if(*iter==symbol)
- {
- std::ostringstream error;
- error << "symbol '" << symbol << "' will cause a
recursive macro call";
- std::ostringstream location;
- location<<linenum_<<' '<<target_.location_;
- target_.error(error.str(), location.str());
- }
- }
-
+ // INCLUDE is special and is allowed to be used
recusively.
+ if(symbol != "INCLUDE") {
+ for(std::vector<std::string>::iterator
+
iter=called_macros_->begin();
+
iter!=called_macros_->end(); ++iter) {
+ if(*iter==symbol) {
+ std::ostringstream
error;
+ error << "symbol '" <<
symbol << "' will cause a recursive macro call";
+ std::ostringstream
location;
+ location<<linenum_<<'
'<<target_.location_;
+
target_.error(error.str(), location.str());
+ }
+ }
+ }
+
preproc_define const &val = macro->second;
size_t nb_arg = strings_.size() -
token.stack_pos - 1;
if (nb_arg != val.arguments.size()) {
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits