some platform compatibility fixes: now able to build on MSVC again

This commit is contained in:
Patrick Parker 2007-12-09 09:14:25 +00:00
parent ca89b9c9fa
commit b057c242ce
4 changed files with 9 additions and 2 deletions

View file

@ -51,7 +51,8 @@ void write_possibly_compressed(std::ostream &out, config &cfg, bool compress)
config_writer::config_writer(
std::ostream &out, bool compress, const std::string &textdomain) :
filter_(),
out_(compress ? filter_ : out),
out_ptr_(compress ? &filter_ : &out), //ternary indirection creates a temporary
out_(*out_ptr_), //now MSVC will allow binding to the reference member
compress_(compress),
level_(0),
textdomain_(textdomain)

View file

@ -50,7 +50,7 @@ public:
private:
boost::iostreams::filtering_stream<boost::iostreams::output> filter_;
std::ostream *out_ptr_;
std::ostream &out_;
bool compress_;
unsigned int level_;

View file

@ -15,6 +15,7 @@
//! @file wml_exeption.cpp
//! Implementation for wml_exeption.hpp.
#include "global.hpp"
#include "wml_exception.hpp"
#include "display.hpp"

View file

@ -29,6 +29,11 @@ class display;
//!
//! @param cond The condition to test, if false and exception is generated.
//! @param message The translatable message to show at the user.
#ifdef _MSC_VER
#if _MSC_VER < 1300
#define __FUNCTION__ "(Unspecified)"
#endif
#endif
#define WML_ASSERT(cond, message) if(!(cond)) wml_exception(#cond, __FILE__, __LINE__, __FUNCTION__, message)
//! Helper function, don't call this directly.