Removed the USE_GZIP ifdefs,...
...everything except the editor now needs the boost library. Since the odds of only compiling the editor is slim so removed it. The -DUSE_GZIP flag is thus no longer needed.
This commit is contained in:
parent
7b12cffb91
commit
accdbb5c0f
5 changed files with 0 additions and 41 deletions
16
configure.ac
16
configure.ac
|
@ -882,22 +882,6 @@ CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
|
|||
LDFLAGS="$BOOST_IOSTREAMS_LDFLAGS $LDFLAGS"
|
||||
LIBS="$BOOST_IOSTREAMS_LIBS $LIBS"
|
||||
|
||||
# test for gzip
|
||||
gzip_found="yes"
|
||||
|
||||
# When gzip and boost are found they are used everywhere. They are
|
||||
# mandatory for the game, so bail out if not found.
|
||||
if test "x$gzip_found" = "xyes"
|
||||
then
|
||||
CPPFLAGS="$CPPFLAGS -DUSE_GZIP"
|
||||
LIBS="$LIBS -lboost_iostreams"
|
||||
else
|
||||
if test "x$game" = "xyes"
|
||||
then
|
||||
AC_MSG_ERROR([*** Missing gzip or boost_iostreams support.])
|
||||
fi
|
||||
fi
|
||||
|
||||
#######################################################################
|
||||
# Tune gettext stuff for our needs #
|
||||
#######################################################################
|
||||
|
|
|
@ -24,12 +24,9 @@
|
|||
#include "serialization/binary_wml.hpp"
|
||||
#include "serialization/parser.hpp"
|
||||
|
||||
#include <cassert> // used when USE_GZIP is false
|
||||
#include <sstream>
|
||||
|
||||
#ifdef USE_GZIP
|
||||
#include <boost/iostreams/filter/gzip.hpp>
|
||||
#endif
|
||||
|
||||
bool detect_format_and_read(config &cfg, std::istream &in, std::string* error_log)
|
||||
{
|
||||
|
@ -53,25 +50,15 @@ void write_possibly_compressed(std::ostream &out, config &cfg, bool compress)
|
|||
|
||||
config_writer::config_writer(
|
||||
std::ostream &out, bool compress, const std::string &textdomain) :
|
||||
#ifdef USE_GZIP
|
||||
filter_(),
|
||||
out_(compress ? filter_ : out),
|
||||
#else
|
||||
out_(out),
|
||||
#endif
|
||||
compress_(compress),
|
||||
level_(0),
|
||||
textdomain_(textdomain)
|
||||
{
|
||||
if(compress_) {
|
||||
#ifdef USE_GZIP
|
||||
filter_.push(boost::iostreams::gzip_compressor());
|
||||
filter_.push(out);
|
||||
#else
|
||||
// it can't hurt to use the compress option here but
|
||||
// it does nothing.
|
||||
assert(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
#include <iosfwd>
|
||||
#include <string>
|
||||
|
||||
#ifdef USE_GZIP
|
||||
#include <boost/iostreams/filtering_stream.hpp>
|
||||
#endif
|
||||
|
||||
class config;
|
||||
|
||||
|
@ -51,15 +49,12 @@ public:
|
|||
bool good() const;
|
||||
|
||||
private:
|
||||
#ifdef USE_GZIP
|
||||
boost::iostreams::filtering_stream<boost::iostreams::output> filter_;
|
||||
#endif
|
||||
|
||||
std::ostream &out_;
|
||||
bool compress_;
|
||||
unsigned int level_;
|
||||
std::string textdomain_;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -36,10 +36,8 @@
|
|||
#include <sstream>
|
||||
#include <stack>
|
||||
|
||||
#ifdef USE_GZIP
|
||||
#include <boost/iostreams/filtering_stream.hpp>
|
||||
#include <boost/iostreams/filter/gzip.hpp>
|
||||
#endif
|
||||
|
||||
#define ERR_CF LOG_STREAM(err, config)
|
||||
#define WRN_CF LOG_STREAM(warn, config)
|
||||
|
@ -352,7 +350,6 @@ void read(config &cfg, std::string &in, std::string* error_log)
|
|||
parser(cfg, in)(error_log);
|
||||
}
|
||||
|
||||
#ifdef USE_GZIP
|
||||
void read_gz(config &cfg, std::istream &file, std::string* error_log)
|
||||
{
|
||||
|
||||
|
@ -362,7 +359,6 @@ void read_gz(config &cfg, std::istream &file, std::string* error_log)
|
|||
|
||||
parser(cfg, filter)(error_log);
|
||||
}
|
||||
#endif
|
||||
|
||||
static char const *AttributeEquals = "=";
|
||||
|
||||
|
|
|
@ -30,10 +30,7 @@ class t_string;
|
|||
// Read data in, clobbering existing data.
|
||||
void read(config &cfg, std::istream &in, std::string* error_log = NULL); // Throws config::error
|
||||
void read(config &cfg, std::string &in, std::string* error_log = NULL); // Throws config::error
|
||||
|
||||
#ifdef USE_GZIP
|
||||
void read_gz(config &cfg, std::istream &in, std::string* error_log=NULL);
|
||||
#endif
|
||||
|
||||
void write(std::ostream &out, config const &cfg, unsigned int level=0);
|
||||
void write_key_val(std::ostream &out, const std::string &key, const t_string &value, unsigned int level, std::string &textdomain);
|
||||
|
|
Loading…
Add table
Reference in a new issue