From b055abae444795e824e63fb6c2f5066d6b58a4e8 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 15 Nov 2012 15:55:38 -0800 Subject: [PATCH] Fix compliation with gcc 4.7 --- aegisub/configure.ac | 2 +- aegisub/libaegisub/common/calltip_provider.cpp | 2 +- aegisub/libaegisub/common/charset_ucd.cpp | 4 +--- aegisub/libaegisub/common/thesaurus.cpp | 6 ++++-- aegisub/src/dialog_autosave.cpp | 2 +- aegisub/src/dialog_spellchecker.cpp | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/aegisub/configure.ac b/aegisub/configure.ac index 22f4df798..9b1ecd0e0 100644 --- a/aegisub/configure.ac +++ b/aegisub/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ(2.57) ################### # Required packages ################### -m4_define([boost_required_version], [1.50.0]) +m4_define([boost_required_version], [1.49.0]) m4_define([curl_required_version], [7.18.2]) m4_define([ffms2_required_version], [2.16]) m4_define([fftw3_required_version], [3.3]) diff --git a/aegisub/libaegisub/common/calltip_provider.cpp b/aegisub/libaegisub/common/calltip_provider.cpp index b3272e688..545c2e6cb 100644 --- a/aegisub/libaegisub/common/calltip_provider.cpp +++ b/aegisub/libaegisub/common/calltip_provider.cpp @@ -116,7 +116,7 @@ CalltipProvider::CalltipProvider() { if (proto.has_parens) p.text.back() = ')'; - protos.emplace(std::move(tag_name), std::move(p)); + protos.insert(make_pair(tag_name, p)); } } diff --git a/aegisub/libaegisub/common/charset_ucd.cpp b/aegisub/libaegisub/common/charset_ucd.cpp index 0cf6886f1..cc96f1151 100644 --- a/aegisub/libaegisub/common/charset_ucd.cpp +++ b/aegisub/libaegisub/common/charset_ucd.cpp @@ -23,8 +23,6 @@ #include "../../universalchardet/nsCharSetProber.h" -#include - namespace agi { namespace charset { @@ -97,7 +95,7 @@ UCDetect::UCDetect(const std::string &file) throw UnknownCharset("Unknown character set."); typedef std::pair const& result; - boost::sort(list, [](result lft, result rgt) { return lft.first > rgt.first; }); + sort(begin(list), end(list), [](result lft, result rgt) { return lft.first > rgt.first; }); } } diff --git a/aegisub/libaegisub/common/thesaurus.cpp b/aegisub/libaegisub/common/thesaurus.cpp index 511fe9534..dfbfc9020 100644 --- a/aegisub/libaegisub/common/thesaurus.cpp +++ b/aegisub/libaegisub/common/thesaurus.cpp @@ -71,7 +71,8 @@ void Thesaurus::Lookup(std::string const& word, std::vector *out) { std::string temp; getline(*dat, temp); std::vector header; - boost::split(header, conv->Convert(temp), _1 == '|'); + std::string converted(conv->Convert(temp)); + boost::split(header, converted, _1 == '|'); if (header.size() != 2) return; int meanings = atoi(header[1].c_str()); @@ -79,7 +80,8 @@ void Thesaurus::Lookup(std::string const& word, std::vector *out) { for (int i = 0; i < meanings; ++i) { std::vector line; getline(*dat, temp); - boost::split(line, conv->Convert(temp), _1 == '|'); + std::string converted(conv->Convert(temp)); + boost::split(line, converted, _1 == '|'); // The "definition" is just the part of speech plus the word it's // giving synonyms for (which may not be the passed word) diff --git a/aegisub/src/dialog_autosave.cpp b/aegisub/src/dialog_autosave.cpp index 9e55e81c3..0ada2aa45 100644 --- a/aegisub/src/dialog_autosave.cpp +++ b/aegisub/src/dialog_autosave.cpp @@ -112,7 +112,7 @@ void DialogAutosave::Populate(std::map &files_map, std:: auto it = files_map.find(name); if (it == files_map.end()) - it = files_map.emplace(name, name).first; + it = files_map.insert(std::make_pair(name, name)).first; it->second.versions.emplace_back(wxFileName(directory, fn).GetFullPath(), date, wxString::Format(name_fmt, date.Format())); } while (dir.GetNext(&fn)); } diff --git a/aegisub/src/dialog_spellchecker.cpp b/aegisub/src/dialog_spellchecker.cpp index f0050dad1..5cb6f20b6 100644 --- a/aegisub/src/dialog_spellchecker.cpp +++ b/aegisub/src/dialog_spellchecker.cpp @@ -180,7 +180,7 @@ void DialogSpellChecker::OnIgnore(wxCommandEvent&) { } void DialogSpellChecker::OnIgnoreAll(wxCommandEvent&) { - auto_ignore.emplace(from_wx(orig_word->GetValue())); + auto_ignore.insert(from_wx(orig_word->GetValue())); FindNext(); }