Author: shadowmaster
Date: Tue Mar 22 07:40:15 2011
New Revision: 48971

URL: http://svn.gna.org/viewcvs/wesnoth?rev=48971&view=rev
Log:
config: Add a new engine-defined VERSION preprocessor macro

This macro expands to the Wesnoth version number string as provided in
the game config code (e.g. same as displayed in the titlescreen, used
for comparing saved games versions).

Modified:
    trunk/changelog
    trunk/src/config_cache.cpp
    trunk/src/tests/test_config_cache.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=48971&r1=48970&r2=48971&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Tue Mar 22 07:40:15 2011
@@ -62,6 +62,8 @@
    * Introduced [move_unit]check_passability= (default yes, previously it was
      always yes/non-existent) key to allow disabling the check for suitable 
terrain.
    * Added TAKE_IT_STRING and LEAVE_IT_STRING arguments to PICKUPPABLE_ITEM
+   * Added an engine-defined VERSION macro that expands to the Wesnoth engine
+     version string.
    * The tags [remove_shroud] and [place_shroud] now take comma-separated 
lists of sides.
      They default to affecting all sides now if no side is set.
    * The [gold] tag now takes a comma-separated list of sides, and defaults to

Modified: trunk/src/config_cache.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/config_cache.cpp?rev=48971&r1=48970&r2=48971&view=diff
==============================================================================
--- trunk/src/config_cache.cpp (original)
+++ trunk/src/config_cache.cpp Tue Mar 22 07:40:15 2011
@@ -27,6 +27,7 @@
 #include "sha1.hpp"
 #include "serialization/binary_or_text.hpp"
 #include "serialization/parser.hpp"
+#include "version.hpp"
 
 #include <boost/algorithm/string/replace.hpp>
 
@@ -80,6 +81,8 @@
 #if defined(__APPLE__)
                defines_map_["APPLE"] = preproc_define();
 #endif
+
+               defines_map_["VERSION"] = 
preproc_define(game_config::wesnoth_version.str());
 
        }
 

Modified: trunk/src/tests/test_config_cache.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/tests/test_config_cache.cpp?rev=48971&r1=48970&r2=48971&view=diff
==============================================================================
--- trunk/src/tests/test_config_cache.cpp (original)
+++ trunk/src/tests/test_config_cache.cpp Tue Mar 22 07:40:15 2011
@@ -22,7 +22,7 @@
 #include "config.hpp"
 #include "game_config.hpp"
 #include "language.hpp"
-
+#include "version.hpp"
 
 #include "tests/utils/game_config_manager.hpp"
 
@@ -39,6 +39,8 @@
 #if defined(__APPLE__)
        defines_map["APPLE"] = preproc_define();
 #endif
+
+       defines_map["VERSION"] = 
preproc_define(game_config::wesnoth_version.str());
 
        return defines_map;
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to