Hello.
Here a two small patches to fix compilation under Windows.
The first, pc.patch, is against publish_campaign.cpp. Windows doesn't
handle variable definition in for loops the same as Unix, so declaration
should be before loops when using the same variable twice.
Second, mc.patch, is against multiplayer_create.cpp. Apparently in
Windows SDK (or whatever), std::auto_ptr does not have a reset method,
thus must do a constructor trick.
Note that this may be a limitation of the SDK I have on my computer, but
Ivanovic had the same issue, thus it may be worth patching.
Nicolas "Ryo"
Index: multiplayer_create.cpp
===================================================================
--- multiplayer_create.cpp (révision 8643)
+++ multiplayer_create.cpp (copie de travail)
@@ -306,7 +306,7 @@
std::auto_ptr<gamemap> map(NULL);
try {
- map.reset(new gamemap(game_config(), map_data));
+ map = std::auto_ptr<gamemap>(new gamemap(game_config(), map_data));
} catch(gamemap::incorrect_format_exception& e) {
LOG_STREAM(err,general) << "map could not be loaded: "
<< e.msg_ << "\n";
tooltips::clear_tooltips(minimap_rect_);
Index: publish_campaign.cpp
===================================================================
--- publish_campaign.cpp (révision 8643)
+++ publish_campaign.cpp (copie de travail)
@@ -190,12 +190,13 @@
bool check_names_legal(const config& dir)
{
+ config::child_list::const_iterator i;
const config::child_list& files = dir.get_children("file");
- for(config::child_list::const_iterator i = files.begin(); i !=
files.end(); ++i) {
+ for( i = files.begin(); i != files.end(); ++i) {
if (!campaign_name_legal((**i)["name"])) return false;
}
const config::child_list& dirs = dir.get_children("dir");
- for(config::child_list::const_iterator i = dirs.begin(); i !=
dirs.end(); ++i) {
+ for(i = dirs.begin(); i != dirs.end(); ++i) {
if (!campaign_name_legal((**i)["name"])) return false;
if (!check_names_legal(**i)) return false;
}