multimedia/aegisub: simplify + unbreak boost 1.62 on 9.x

In file included from libaegisub/ass/time.cpp:20:0:
libaegisub/include/libaegisub/format.h: In static member function 'static Out agi::format_detail::runtime_cast_helper<In, Out, <anonymous> >::cast(const In&)':
libaegisub/include/libaegisub/format.h:31:37: error: 'bad_cast' is not a member of 'std'
  static Out cast(In const&) { throw std::bad_cast(); }
                                     ^
In file included from libaegisub/lua/script_reader.cpp:19:0:
libaegisub/include/libaegisub/file_mapping.h:37:3: error: 'unique_ptr' in namespace 'std' does not name a type
   std::unique_ptr<boost::interprocess::mapped_region> region;
   ^
libaegisub/include/libaegisub/file_mapping.h:54:3: error: 'unique_ptr' in namespace 'std' does not name a type
   std::unique_ptr<boost::interprocess::mapped_region> read_region;
   ^
libaegisub/include/libaegisub/file_mapping.h:56:3: error: 'unique_ptr' in namespace 'std' does not name a type
   std::unique_ptr<boost::interprocess::mapped_region> write_region;
   ^

PR:		199601
This commit is contained in:
Jan Beich 2016-11-13 18:49:41 +00:00
parent 2aa337bbdb
commit cae37f0016
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=426061
34 changed files with 39 additions and 950 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= aegisub
PORTVERSION= 3.2.2
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= multimedia
MASTER_SITES= http://ftp.aegisub.org/pub/archives/releases/source/ \
ftp://ftp.aegisub.org/pub/archives/releases/source/ \
@ -25,8 +25,11 @@ USES= compiler:c++11-lib desktop-file-utils gettext gmake iconv \
USE_GNOME= intltool
USE_WX= 3.0
WX_CONF_ARGS= absolute
USE_GL= glu
USE_GL= gl
USE_CSTD= c99
USE_CXXSTD= c++11
CXXFLAGS+= -D_GLIBCXX_USE_C99 # XXX ports/193528
LDFLAGS+= -Wl,--as-needed # freetype
GNU_CONFIGURE= yes
CONFIGURE_ENV= ICONV_LIBS="${ICONV_LIB}" PTHREAD_LIBS="-pthread" \
agi_cv_with_iconv=yes
@ -61,25 +64,10 @@ PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio
PULSEAUDIO_CONFIGURE_OFF=\
--without-libpulse
.include <bsd.port.pre.mk>
.if ${COMPILER_TYPE} == "gcc"
USE_CXXSTD= gnu++11
# src/audio_display.o: undefined reference to symbol '__atomic_load_8@@LIBATOMIC_1.0'
.if empty(CFLAGS:M-march=*)
CFLAGS_i386= -march=pentium
.endif
.else
USE_CXXSTD= c++11
CXXFLAGS+= -Wno-c++11-narrowing
.if ${COMPILER_VERSION} < 34
BUILD_DEPENDS+= ${LOCALBASE}/lib/c++/libstdc++.so:devel/libc++ \
${LOCALBASE}/bin/clang34:lang/clang34
CPP= clang-cpp34
CC= clang34
CXX= clang++34
CXXFLAGS+= -nostdinc++ -isystem ${LOCALBASE}/include/c++/v1
LDFLAGS+= -L${LOCALBASE}lib/c++
.endif
CFLAGS+= ${CFLAGS_${ARCH}_${CHOSEN_COMPILER_TYPE}}
CFLAGS_i386_gcc= -march=pentium
.endif
post-patch:
@ -91,14 +79,10 @@ post-patch:
's|^CC=|CC?=| ; \
/^CCOPT_/s|=.*|=| ; \
/^CCDEBUG/s|=.*|=|' ${WRKSRC}/vendor/luajit/src/Makefile
.if ${COMPILER_TYPE} == "gcc"
@${FIND} ${WRKSRC} -name "*.h" | ${XARGS} ${REINPLACE_CMD} -e \
'/virtual /s|= default;$$|{ }|'
.endif
post-install:
(cd ${WRKSRC} && ${COPYTREE_SHARE} \
automation/v4-docs ${STAGEDIR}${DOCSDIR})
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/aegisub-*
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View file

@ -1,28 +0,0 @@
--- libaegisub/common/cajun/reader.cpp.orig
+++ libaegisub/common/cajun/reader.cpp
@@ -10,6 +10,8 @@
#include <boost/interprocess/streams/bufferstream.hpp>
#include <cassert>
+#include <cstdio>
+#include <set>
/*
@@ -231,8 +233,16 @@
}
void Reader::MatchNumber(std::string& sNumber, InputStream& inputStream) {
+#if defined(_LIBCPP_VERSION)
const char numericChars[] = "0123456789.eE-+";
while (!inputStream.EOS() && std::find(numericChars, std::end(numericChars), inputStream.Peek()) != std::end(numericChars))
+#else
+ const char sNumericChars[] = "0123456789.eE-+";
+ std::set<char> numericChars;
+ numericChars.insert(sNumericChars, sNumericChars + sizeof(sNumericChars));
+
+ while (!inputStream.EOS()&& numericChars.count(inputStream.Peek()))
+#endif
sNumber.push_back(inputStream.Get());
}

View file

@ -1,25 +0,0 @@
--- libaegisub/common/color.cpp.orig 2014-08-05 20:04:54.000000000 +0900
+++ libaegisub/common/color.cpp 2014-08-05 20:06:27.000000000 +0900
@@ -18,6 +18,13 @@
#include "libaegisub/format.h"
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
namespace agi {
Color::Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
@@ -37,7 +44,7 @@
}
std::string Color::GetSsaFormatted() const {
- return std::to_string((a << 24) + (b << 16) + (g << 8) + r);
+ return TO_STRING((a << 24) + (b << 16) + (g << 8) + r);
}
std::string Color::GetHexFormatted(bool rgba) const {

View file

@ -0,0 +1,10 @@
--- libaegisub/common/cajun/reader.cpp.orig 2014-12-08 00:07:09 UTC
+++ libaegisub/common/cajun/reader.cpp
@@ -9,6 +9,7 @@ Author: Terry Caton
#include "libaegisub/cajun/reader.h"
#include <boost/interprocess/streams/bufferstream.hpp>
+#include <algorithm> // std::find
#include <cassert>
/*

View file

@ -0,0 +1,10 @@
--- libaegisub/include/libaegisub/file_mapping.h.orig 2014-12-08 00:07:09 UTC
+++ libaegisub/include/libaegisub/file_mapping.h
@@ -18,6 +18,7 @@
#include <boost/interprocess/detail/os_file_functions.hpp>
#include <cstdint>
+#include <memory> // std::unique_ptr
namespace agi {
// boost::interprocess::file_mapping is awesome and uses CreateFileA on Windows

View file

@ -0,0 +1,10 @@
--- libaegisub/include/libaegisub/format.h.orig 2014-12-08 00:07:09 UTC
+++ libaegisub/include/libaegisub/format.h
@@ -19,6 +19,7 @@
#include <boost/interprocess/streams/vectorstream.hpp>
#include <boost/io/ios_state.hpp>
#include <type_traits>
+#include <typeinfo> // std::bad_cast
class wxString;

View file

@ -1,27 +0,0 @@
--- src/ass_file.cpp.orig
+++ src/ass_file.cpp
@@ -29,6 +29,13 @@
#include <boost/filesystem/path.hpp>
#include <cassert>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
AssFile::AssFile() { }
AssFile::~AssFile() {
@@ -42,8 +49,8 @@
Info.emplace_back("WrapStyle", "0");
Info.emplace_back("ScaledBorderAndShadow", "yes");
if (!OPT_GET("Subtitle/Default Resolution/Auto")->GetBool()) {
- Info.emplace_back("PlayResX", std::to_string(OPT_GET("Subtitle/Default Resolution/Width")->GetInt()));
- Info.emplace_back("PlayResY", std::to_string(OPT_GET("Subtitle/Default Resolution/Height")->GetInt()));
+ Info.emplace_back("PlayResX", TO_STRING(OPT_GET("Subtitle/Default Resolution/Width")->GetInt()));
+ Info.emplace_back("PlayResY", TO_STRING(OPT_GET("Subtitle/Default Resolution/Height")->GetInt()));
}
Info.emplace_back("YCbCr Matrix", "None");

View file

@ -1,25 +0,0 @@
--- src/ass_override.cpp.orig
+++ src/ass_override.cpp
@@ -44,6 +44,13 @@
#include <boost/range/adaptor/transformed.hpp>
#include <functional>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
using namespace boost::adaptors;
AssOverrideParameter::AssOverrideParameter(VariableDataType type, AssParameterClass classification)
@@ -126,7 +133,7 @@
if (classification == AssParameterClass::ALPHA)
Set(agi::format("&H%02X&", mid(0, new_value, 255)));
else
- Set(std::to_string(new_value));
+ Set(TO_STRING(new_value));
}
template<> void AssOverrideParameter::Set<double>(double new_value) {

View file

@ -1,34 +0,0 @@
--- src/auto4_lua_dialog.cpp.orig
+++ src/auto4_lua_dialog.cpp
@@ -60,6 +60,13 @@
#include <wx/stattext.h>
#include <wx/valgen.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
using namespace agi::lua;
namespace {
inline void get_if_right_type(lua_State *L, std::string &def) {
@@ -249,7 +256,7 @@
}
bool CanSerialiseValue() const override { return true; }
- std::string SerialiseValue() const override { return std::to_string(value); }
+ std::string SerialiseValue() const override { return TO_STRING(value); }
void UnserialiseValue(const std::string &serialised) override { value = atoi(serialised.c_str()); }
wxControl *Create(wxWindow *parent) override {
@@ -287,7 +294,7 @@
}
bool CanSerialiseValue() const override { return true; }
- std::string SerialiseValue() const override { return std::to_string(value); }
+ std::string SerialiseValue() const override { return TO_STRING(value); }
void UnserialiseValue(const std::string &serialised) override { value = atof(serialised.c_str()); }
wxControl *Create(wxWindow *parent) override {

View file

@ -1,43 +0,0 @@
--- src/command/edit.cpp.orig
+++ src/command/edit.cpp
@@ -69,6 +69,13 @@
#include <wx/fontdlg.h>
#include <wx/textentry.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
namespace {
using namespace boost::adaptors;
using cmd::Command;
@@ -516,13 +523,13 @@
if (font.GetFaceName() != startfont.GetFaceName())
do_set_tag("\\fn", from_wx(font.GetFaceName()));
if (font.GetPointSize() != startfont.GetPointSize())
- do_set_tag("\\fs", std::to_string(font.GetPointSize()));
+ do_set_tag("\\fs", TO_STRING(font.GetPointSize()));
if (font.GetWeight() != startfont.GetWeight())
- do_set_tag("\\b", std::to_string(font.GetWeight() == wxFONTWEIGHT_BOLD));
+ do_set_tag("\\b", TO_STRING(font.GetWeight() == wxFONTWEIGHT_BOLD));
if (font.GetStyle() != startfont.GetStyle())
- do_set_tag("\\i", std::to_string(font.GetStyle() == wxFONTSTYLE_ITALIC));
+ do_set_tag("\\i", TO_STRING(font.GetStyle() == wxFONTSTYLE_ITALIC));
if (font.GetUnderlined() != startfont.GetUnderlined())
- do_set_tag("\\i", std::to_string(font.GetUnderlined()));
+ do_set_tag("\\i", TO_STRING(font.GetUnderlined()));
return shift;
});
@@ -761,7 +768,7 @@
}
static void combine_karaoke(AssDialogue *first, AssDialogue *second) {
- first->Text = first->Text.get() + "{\\k" + std::to_string((second->Start - first->End) / 10) + "}" + second->Text.get();
+ first->Text = first->Text.get() + "{\\k" + TO_STRING((second->Start - first->End) / 10) + "}" + second->Text.get();
}
static void combine_concat(AssDialogue *first, AssDialogue *second) {

View file

@ -1,25 +0,0 @@
--- src/command/recent.cpp.orig
+++ src/command/recent.cpp
@@ -44,6 +44,13 @@
#include <wx/event.h>
#include <wx/msgdlg.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
namespace {
using cmd::Command;
@@ -124,7 +131,7 @@
void operator()(agi::Context *c) {
T::operator()(c, id);
}
- mru_wrapper(int id) : id(id) , full_name(T::name() + std::to_string(id)) { }
+ mru_wrapper(int id) : id(id) , full_name(T::name() + TO_STRING(id)) { }
};
}

View file

@ -1,25 +0,0 @@
--- src/command/video.cpp.orig
+++ src/command/video.cpp
@@ -67,6 +67,13 @@
#include <wx/msgdlg.h>
#include <wx/textdlg.h>
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
namespace {
using cmd::Command;
@@ -119,7 +126,7 @@
std::string value = from_wx(wxGetTextFromUser(
_("Enter aspect ratio in either:\n decimal (e.g. 2.35)\n fractional (e.g. 16:9)\n specific resolution (e.g. 853x480)"),
_("Enter aspect ratio"),
- std::to_wstring(c->videoController->GetAspectRatioValue())));
+ TO_WSTRING(c->videoController->GetAspectRatioValue())));
if (value.empty()) return;
double numval = 0;

View file

@ -1,25 +0,0 @@
--- src/dialog_jumpto.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/dialog_jumpto.cpp 2014-08-05 21:03:34.000000000 +0900
@@ -43,6 +43,13 @@
#include <wx/stattext.h>
#include <wx/textctrl.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
namespace {
struct DialogJumpTo {
wxDialog d;
@@ -74,7 +81,7 @@
auto LabelTime = new wxStaticText(&d, -1, _("Time: "));
JumpFrame = new wxTextCtrl(&d,-1,"",wxDefaultPosition,wxSize(-1,-1),wxTE_PROCESS_ENTER, IntValidator((int)jumpframe));
- JumpFrame->SetMaxLength(std::to_string(c->project->VideoProvider()->GetFrameCount() - 1).size());
+ JumpFrame->SetMaxLength(TO_STRING(c->project->VideoProvider()->GetFrameCount() - 1).size());
JumpTime = new TimeEdit(&d, -1, c, agi::Time(c->videoController->TimeAtFrame(jumpframe)).GetAssFormatted(), wxSize(-1,-1));
auto TimesSizer = new wxGridSizer(2, 5, 5);

View file

@ -1,25 +0,0 @@
--- src/dialog_kara_timing_copy.cpp.orig
+++ src/dialog_kara_timing_copy.cpp
@@ -53,6 +53,13 @@
#include <wx/stattext.h>
#include <wx/string.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
namespace {
#define TEXT_LABEL_SOURCE _("Source: ")
#define TEXT_LABEL_DEST _("Dest: ")
@@ -343,7 +350,7 @@
int duration = 0;
for (auto const& syl : match.src)
duration += syl.duration;
- res += "{\\k" + std::to_string(duration / 10) + "}" + match.dst;
+ res += "{\\k" + TO_STRING(duration / 10) + "}" + match.dst;
}
return res;

View file

@ -1,38 +0,0 @@
--- src/dialog_properties.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/dialog_properties.cpp 2014-08-05 20:27:38.000000000 +0900
@@ -47,6 +47,15 @@
#include <wx/stattext.h>
#include <wx/textctrl.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
namespace {
class DialogProperties {
wxDialog d;
@@ -186,7 +195,7 @@
count += SetInfoIfDifferent("PlayResX", from_wx(ResX->GetValue()));
count += SetInfoIfDifferent("PlayResY", from_wx(ResY->GetValue()));
- count += SetInfoIfDifferent("WrapStyle", std::to_string(WrapStyle->GetSelection()));
+ count += SetInfoIfDifferent("WrapStyle", TO_STRING(WrapStyle->GetSelection()));
count += SetInfoIfDifferent("ScaledBorderAndShadow", ScaleBorder->GetValue() ? "yes" : "no");
count += SetInfoIfDifferent("YCbCr Matrix", from_wx(YCbCrMatrix->GetValue()));
@@ -204,8 +213,8 @@
}
void DialogProperties::OnSetFromVideo(wxCommandEvent &) {
- ResX->SetValue(std::to_wstring(c->project->VideoProvider()->GetWidth()));
- ResY->SetValue(std::to_wstring(c->project->VideoProvider()->GetHeight()));
+ ResX->SetValue(TO_WSTRING(c->project->VideoProvider()->GetWidth()));
+ ResY->SetValue(TO_WSTRING(c->project->VideoProvider()->GetHeight()));
}
}

View file

@ -1,25 +0,0 @@
--- src/dialog_shift_times.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/dialog_shift_times.cpp 2014-08-05 20:21:09.000000000 +0900
@@ -48,6 +48,13 @@
#include <wx/sizer.h>
#include <wx/textctrl.h>
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
namespace {
class DialogShiftTimes final : public wxDialog {
agi::Context *context;
@@ -118,7 +125,7 @@
int beg = (int64_t)range["start"];
int end = (int64_t)range["end"];
if (beg == end)
- lines += std::to_wstring(beg);
+ lines += TO_WSTRING(beg);
else
lines += fmt_wx("%d-%d", beg, end);
if (it + 1 != sel.end())

View file

@ -1,34 +0,0 @@
--- src/dialog_style_editor.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/dialog_style_editor.cpp 2014-08-05 20:30:35.000000000 +0900
@@ -61,6 +61,13 @@
#include <wx/spinctrl.h>
#include <wx/stattext.h>
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
/// Style rename helper that walks a file searching for a style and optionally
/// updating references to it
class StyleRenamer {
@@ -166,7 +173,7 @@
};
// Prepare control values
- wxString EncodingValue = std::to_wstring(style->encoding);
+ wxString EncodingValue = TO_WSTRING(style->encoding);
wxString alignValues[9] = { "7", "8", "9", "4", "5", "6", "1", "2", "3" };
// Encoding options
@@ -197,7 +204,7 @@
new ColourButton(this, wxSize(55, 16), true, style->shadow, ColorValidator(&work->shadow))
};
for (int i = 0; i < 3; i++)
- margin[i] = new wxSpinCtrl(this, -1, std::to_wstring(style->Margin[i]),
+ margin[i] = new wxSpinCtrl(this, -1, TO_WSTRING(style->Margin[i]),
wxDefaultPosition, wxSize(60, -1),
wxSP_ARROW_KEYS, 0, 9999, style->Margin[i]);

View file

@ -1,38 +0,0 @@
--- src/dialog_video_properties.cpp 2014-07-28 23:29:16.000000000 +0900
+++ /home/jungle/dialog_video_properties.cpp 2014-08-05 20:35:18.000000000 +0900
@@ -27,6 +27,13 @@
#include <wx/sizer.h>
#include <wx/stattext.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
namespace {
enum {
MISMATCH_IGNORE,
@@ -103,8 +110,8 @@
// If the script resolution hasn't been set at all just force it to the
// video resolution
if (sx == 0 && sy == 0) {
- file->SetScriptInfo("PlayResX", std::to_string(vx));
- file->SetScriptInfo("PlayResY", std::to_string(vy));
+ file->SetScriptInfo("PlayResX", TO_STRING(vx));
+ file->SetScriptInfo("PlayResY", TO_STRING(vy));
return true;
}
@@ -126,8 +133,8 @@
return commit_subs;
case MISMATCH_SET:
- file->SetScriptInfo("PlayResX", std::to_string(vx));
- file->SetScriptInfo("PlayResY", std::to_string(vy));
+ file->SetScriptInfo("PlayResX", TO_STRING(vx));
+ file->SetScriptInfo("PlayResY", TO_STRING(vy));
return true;
case MISMATCH_RESAMPLE:

View file

@ -1,25 +0,0 @@
--- src/ffmpegsource_common.cpp.orig
+++ src/ffmpegsource_common.cpp
@@ -56,6 +56,13 @@
#include <wx/config.h>
#include <wx/choicdlg.h> // Keep this last so wxUSE_CHOICEDLG is set.
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
#ifdef _WIN32
#include <objbase.h>
@@ -221,7 +228,7 @@
hash.process_bytes(filename.string().c_str(), filename.string().size());
// Generate the filename
- auto result = config::path->Decode("?local/ffms2cache/" + std::to_string(hash.checksum()) + "_" + std::to_string(len) + "_" + std::to_string(agi::fs::ModifiedTime(filename)) + ".ffindex");
+ auto result = config::path->Decode("?local/ffms2cache/" + TO_STRING(hash.checksum()) + "_" + TO_STRING(len) + "_" + TO_STRING(agi::fs::ModifiedTime(filename)) + ".ffindex");
// Ensure that folder exists
agi::fs::CreateDirectory(result.parent_path());

View file

@ -1,10 +0,0 @@
--- src/ffmpegsource_common.h.orig
+++ src/ffmpegsource_common.h
@@ -34,6 +34,7 @@
#ifdef WITH_FFMS2
#include <map>
+#include <string>
#include <ffms.h>

View file

@ -1,103 +0,0 @@
--- src/grid_column.cpp.orig 2014-08-05 23:58:58.000000000 +0900
+++ src/grid_column.cpp 2014-08-06 00:01:32.000000000 +0900
@@ -27,6 +27,13 @@
#include <wx/dc.h>
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
int WidthHelper::operator()(boost::flyweight<std::string> const& str) {
if (str.get().empty()) return 0;
auto it = widths.find(str);
@@ -84,7 +91,7 @@
bool Centered() const override { return true; }
wxString Value(const AssDialogue *d, const agi::Context * = nullptr) const override {
- return std::to_wstring(d->Row + 1);
+ return TO_WSTRING(d->Row + 1);
}
int Width(const agi::Context *c, WidthHelper &helper) const override {
@@ -108,12 +115,12 @@
bool Centered() const override { return true; }
wxString Value(const AssDialogue *d, const agi::Context *) const override {
- return d->Layer ? wxString(std::to_wstring(d->Layer)) : wxString();
+ return d->Layer ? wxString(TO_WSTRING(d->Layer)) : wxString();
}
int Width(const agi::Context *c, WidthHelper &helper) const override {
int max_layer = max_value(&AssDialogue::Layer, c->ass->Events);
- return max_layer == 0 ? 0 : helper(std::to_wstring(max_layer));
+ return max_layer == 0 ? 0 : helper(TO_WSTRING(max_layer));
}
};
@@ -130,7 +137,7 @@
wxString Value(const AssDialogue *d, const agi::Context *c) const override {
if (by_frame)
- return std::to_wstring(c->videoController->FrameAtTime(d->Start, agi::vfr::START));
+ return TO_WSTRING(c->videoController->FrameAtTime(d->Start, agi::vfr::START));
return to_wx(d->Start.GetAssFormatted());
}
@@ -138,7 +145,7 @@
if (!by_frame)
return helper(wxS("0:00:00.00"));
int frame = c->videoController->FrameAtTime(max_value(&AssDialogue::Start, c->ass->Events), agi::vfr::START);
- return helper(std::to_wstring(frame));
+ return helper(TO_WSTRING(frame));
}
};
@@ -148,7 +155,7 @@
wxString Value(const AssDialogue *d, const agi::Context *c) const override {
if (by_frame)
- return std::to_wstring(c->videoController->FrameAtTime(d->End, agi::vfr::END));
+ return TO_WSTRING(c->videoController->FrameAtTime(d->End, agi::vfr::END));
return to_wx(d->End.GetAssFormatted());
}
@@ -156,7 +163,7 @@
if (!by_frame)
return helper(wxS("0:00:00.00"));
int frame = c->videoController->FrameAtTime(max_value(&AssDialogue::End, c->ass->Events), agi::vfr::END);
- return helper(std::to_wstring(frame));
+ return helper(TO_WSTRING(frame));
}
};
@@ -220,7 +227,7 @@
bool Centered() const override { return true; }
wxString Value(const AssDialogue *d, const agi::Context *) const override {
- return d->Margin[Index] ? wxString(std::to_wstring(d->Margin[Index])) : wxString();
+ return d->Margin[Index] ? wxString(TO_WSTRING(d->Margin[Index])) : wxString();
}
int Width(const agi::Context *c, WidthHelper &helper) const override {
@@ -229,7 +236,7 @@
if (line.Margin[Index] > max)
max = line.Margin[Index];
}
- return max == 0 ? 0 : helper(std::to_wstring(max));
+ return max == 0 ? 0 : helper(TO_WSTRING(max));
}
};
@@ -296,7 +303,7 @@
int cps = CPS(d);
if (cps < 0 || cps > 100) return;
- wxString str = std::to_wstring(cps);
+ wxString str = TO_WSTRING(cps);
wxSize ext = dc.GetTextExtent(str);
auto tc = dc.GetTextForeground();

View file

@ -1,42 +0,0 @@
--- src/preferences_base.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/preferences_base.cpp 2014-08-05 07:56:10.000000000 +0900
@@ -40,6 +40,13 @@
#undef Bool
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
#define OPTION_UPDATER(type, evttype, opt, body) \
class type { \
std::string name; \
@@ -124,14 +131,14 @@
}
case agi::OptionType::Int: {
- auto sc = new wxSpinCtrl(this, -1, std::to_wstring((int)opt->GetInt()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, min, max, opt->GetInt());
+ auto sc = new wxSpinCtrl(this, -1, TO_WSTRING((int)opt->GetInt()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, min, max, opt->GetInt());
sc->Bind(wxEVT_SPINCTRL, IntUpdater(opt_name, parent));
Add(flex, name, sc);
return sc;
}
case agi::OptionType::Double: {
- auto scd = new wxSpinCtrlDouble(this, -1, std::to_wstring(opt->GetDouble()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, min, max, opt->GetDouble(), inc);
+ auto scd = new wxSpinCtrlDouble(this, -1, TO_WSTRING(opt->GetDouble()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, min, max, opt->GetDouble(), inc);
scd->Bind(wxEVT_SPINCTRL, DoubleUpdater(opt_name, parent));
Add(flex, name, scd);
return scd;
@@ -238,7 +245,7 @@
font_name->SetMinSize(wxSize(160, -1));
font_name->Bind(wxEVT_TEXT, StringUpdater(face_opt->GetName().c_str(), parent));
- auto font_size = new wxSpinCtrl(this, -1, std::to_wstring((int)size_opt->GetInt()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 3, 42, size_opt->GetInt());
+ auto font_size = new wxSpinCtrl(this, -1, TO_WSTRING((int)size_opt->GetInt()), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 3, 42, size_opt->GetInt());
font_size->Bind(wxEVT_SPINCTRL, IntUpdater(size_opt->GetName().c_str(), parent));
auto pick_btn = new wxButton(this, -1, _("Choose..."));

View file

@ -1,27 +0,0 @@
--- src/resolution_resampler.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/resolution_resampler.cpp 2014-08-05 07:58:45.000000000 +0900
@@ -32,6 +32,13 @@
#include <cmath>
#include <wx/intl.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
enum {
LEFT = 0,
RIGHT = 1,
@@ -281,8 +288,8 @@
for (auto& line : ass->Events)
resample_line(&state, line);
- ass->SetScriptInfo("PlayResX", std::to_string(settings.dest_x));
- ass->SetScriptInfo("PlayResY", std::to_string(settings.dest_y));
+ ass->SetScriptInfo("PlayResX", TO_STRING(settings.dest_x));
+ ass->SetScriptInfo("PlayResY", TO_STRING(settings.dest_y));
if (resample_colors)
ass->SetScriptInfo("YCbCr Matrix", MatrixToString(settings.dest_matrix));

View file

@ -1,34 +0,0 @@
--- src/subs_edit_box.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/subs_edit_box.cpp 2014-08-06 00:09:49.000000000 +0900
@@ -69,6 +69,13 @@
#include <wx/sizer.h>
#include <wx/spinctrl.h>
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
namespace std {
template <typename T>
struct hash<boost::flyweight<T>> {
@@ -354,7 +361,7 @@
if (type & AssFile::COMMIT_DIAG_META) {
layer->SetValue(line->Layer);
for (size_t i = 0; i < margin.size(); ++i)
- change_value(margin[i], std::to_wstring(line->Margin[i]));
+ change_value(margin[i], TO_WSTRING(line->Margin[i]));
comment_box->SetValue(line->Comment);
style_box->Select(style_box->FindString(to_wx(line->Style)));
active_style = line ? c->ass->GetStyle(line->Style) : nullptr;
@@ -623,7 +630,7 @@
if (OPT_GET("Subtitle/Character Counter/Ignore Punctuation")->GetBool())
ignore |= agi::IGNORE_PUNCTUATION;
size_t length = agi::MaxLineLength(text, ignore);
- char_count->SetValue(std::to_wstring(length));
+ char_count->SetValue(TO_WSTRING(length));
size_t limit = (size_t)OPT_GET("Subtitle/Character Limit")->GetInt();
if (limit && length > limit)
char_count->SetBackgroundColour(to_wx(OPT_GET("Colour/Subtitle/Syntax/Background/Error")->GetColor()));

View file

@ -1,27 +0,0 @@
--- src/subs_preview.cpp.orig
+++ src/subs_preview.cpp
@@ -48,6 +48,13 @@
#include <wx/dcclient.h>
#include <wx/msgdlg.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
SubtitlesPreview::SubtitlesPreview(wxWindow *parent, wxSize size, int winStyle, agi::Color col)
: wxWindow(parent, -1, wxDefaultPosition, size, winStyle)
, style(new AssStyle)
@@ -141,8 +148,8 @@
"No subtitles provider", wxOK | wxICON_ERROR | wxCENTER);
}
- sub_file->SetScriptInfo("PlayResX", std::to_string(w));
- sub_file->SetScriptInfo("PlayResY", std::to_string(h));
+ sub_file->SetScriptInfo("PlayResX", TO_STRING(w));
+ sub_file->SetScriptInfo("PlayResY", TO_STRING(h));
UpdateBitmap();
}

View file

@ -1,34 +0,0 @@
--- src/subtitle_format_ass.cpp.orig 2014-08-05 23:16:03.000000000 +0900
+++ src/subtitle_format_ass.cpp 2014-08-05 23:18:02.000000000 +0900
@@ -31,6 +31,13 @@
#include <libaegisub/ass/uuencode.h>
#include <libaegisub/fs.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
DEFINE_EXCEPTION(AssParseError, SubtitleFormatParseError);
void AssSubtitleFormat::ReadFile(AssFile *target, agi::fs::path const& filename, agi::vfr::Framerate const& fps, std::string const& encoding) const {
@@ -119,7 +126,7 @@
template<typename Number>
void WriteIfNotZero(const char *key, Number n) {
if (n != Number{})
- file.WriteLineToFile(key + std::to_string(n));
+ file.WriteLineToFile(key + TO_STRING(n));
}
void WriteExtradata(std::vector<ExtradataEntry> const& extradata) {
@@ -131,7 +138,7 @@
file.WriteLineToFile("[Aegisub Extradata]");
for (auto const& edi : extradata) {
std::string line = "Data: ";
- line += std::to_string(edi.id);
+ line += TO_STRING(edi.id);
line += ",";
line += inline_string_encode(edi.key);
line += ",";

View file

@ -1,25 +0,0 @@
--- src/subtitle_format_srt.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/subtitle_format_srt.cpp 2014-08-05 08:01:33.000000000 +0900
@@ -50,6 +50,13 @@
#include <boost/algorithm/string/trim.hpp>
#include <boost/regex.hpp>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
DEFINE_EXCEPTION(SRTParseError, SubtitleFormatParseError);
namespace {
@@ -435,7 +442,7 @@
// Write lines
int i=0;
for (auto const& current : copy.Events) {
- file.WriteLineToFile(std::to_string(++i));
+ file.WriteLineToFile(TO_STRING(++i));
file.WriteLineToFile(WriteSRTTime(current.Start) + " --> " + WriteSRTTime(current.End));
file.WriteLineToFile(ConvertTags(&current));
file.WriteLineToFile("");

View file

@ -1,25 +0,0 @@
--- src/timeedit_ctrl.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/timeedit_ctrl.cpp 2014-08-05 08:03:02.000000000 +0900
@@ -48,6 +48,13 @@
#define TimeEditWindowStyle
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
enum {
Time_Edit_Copy = 1320,
Time_Edit_Paste
@@ -113,7 +120,7 @@
void TimeEdit::UpdateText() {
if (byFrame)
- ChangeValue(std::to_wstring(c->project->Timecodes().FrameAtTime(time, isEnd ? agi::vfr::END : agi::vfr::START)));
+ ChangeValue(TO_WSTRING(c->project->Timecodes().FrameAtTime(time, isEnd ? agi::vfr::END : agi::vfr::START)));
else
ChangeValue(to_wx(time.GetAssFormatted()));
}

View file

@ -1,34 +0,0 @@
--- src/validators.cpp.orig 2014-07-28 23:29:16.000000000 +0900
+++ src/validators.cpp 2014-08-06 00:12:26.000000000 +0900
@@ -25,6 +25,13 @@
#include <wx/spinctrl.h>
#include <wx/textctrl.h>
+#ifdef _LIBCPP_VERSION
+#define TO_WSTRING(x) std::to_wstring(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_WSTRING(x) boost::lexical_cast<std::wstring>(x)
+#endif
+
namespace {
std::string new_value(wxTextCtrl *ctrl, int chr) {
long from, to;
@@ -55,7 +62,7 @@
}
bool IntValidator::TransferToWindow() {
- static_cast<wxTextCtrl *>(GetWindow())->SetValue(std::to_wstring(value));
+ static_cast<wxTextCtrl *>(GetWindow())->SetValue(TO_WSTRING(value));
return true;
}
@@ -132,7 +139,7 @@
}
bool DoubleValidator::TransferToWindow() {
- auto str = std::to_wstring(*value);
+ auto str = TO_WSTRING(*value);
if (decimal_sep != '.')
std::replace(str.begin(), str.end(), L'.', decimal_sep);
if (str.find(decimal_sep) != str.npos) {

View file

@ -1,34 +0,0 @@
--- src/video_out_gl.h.orig
+++ src/video_out_gl.h
@@ -23,6 +23,13 @@
#include <vector>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
struct VideoFrame;
/// @class VideoOutGL
@@ -92,7 +99,7 @@
class VideoOutRenderException : public VideoOutException {
public:
VideoOutRenderException(const char *func, int err)
- : VideoOutException(std::string(func) + " failed with error code " + std::to_string(err))
+ : VideoOutException(std::string(func) + " failed with error code " + TO_STRING(err))
{ }
const char * GetName() const override { return "videoout/opengl/render"; }
Exception * Copy() const override { return new VideoOutRenderException(*this); }
@@ -103,7 +110,7 @@
class VideoOutInitException : public VideoOutException {
public:
VideoOutInitException(const char *func, int err)
- : VideoOutException(std::string(func) + " failed with error code " + std::to_string(err))
+ : VideoOutException(std::string(func) + " failed with error code " + TO_STRING(err))
{ }
VideoOutInitException(const char *err) : VideoOutException(err) { }
const char * GetName() const override { return "videoout/opengl/init"; }

View file

@ -1,25 +0,0 @@
--- src/video_provider_ffmpegsource.cpp.orig
+++ src/video_provider_ffmpegsource.cpp
@@ -48,6 +48,13 @@
#include <wx/choicdlg.h>
#include <wx/msgdlg.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
namespace {
std::string colormatrix_description(int cs, int cr) {
// Assuming TV for unspecified
@@ -222,7 +229,7 @@
for (int CurFrameNum = 0; CurFrameNum < VideoInfo->NumFrames; CurFrameNum++) {
const FFMS_FrameInfo *CurFrameData = FFMS_GetFrameInfo(FrameData, CurFrameNum);
if (!CurFrameData)
- throw VideoOpenError("Couldn't get info about frame " + std::to_string(CurFrameNum));
+ throw VideoOpenError("Couldn't get info about frame " + TO_STRING(CurFrameNum));
// keyframe?
if (CurFrameData->KeyFrame)

View file

@ -1,11 +0,0 @@
--- src/visual_tool_rotatexy.cpp.orig
+++ src/visual_tool_rotatexy.cpp
@@ -25,6 +25,8 @@
#include <boost/format.hpp>
#include <cmath>
+#include <wx/colour.h>
+
VisualToolRotateXY::VisualToolRotateXY(VideoDisplay *parent, agi::Context *context)
: VisualTool<VisualDraggableFeature>(parent, context)
{

View file

@ -1,27 +0,0 @@
--- src/visual_tool_scale.cpp.orig
+++ src/visual_tool_scale.cpp
@@ -26,6 +26,13 @@
#include "utils.h"
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
VisualToolScale::VisualToolScale(VideoDisplay *parent, agi::Context *context)
: VisualTool<VisualDraggableFeature>(parent, context)
{
@@ -106,8 +113,8 @@
if (ctrl_down)
scale = scale.Round(25.f);
- SetSelectedOverride("\\fscx", std::to_string((int)scale.X()));
- SetSelectedOverride("\\fscy", std::to_string((int)scale.Y()));
+ SetSelectedOverride("\\fscx", TO_STRING((int)scale.X()));
+ SetSelectedOverride("\\fscy", TO_STRING((int)scale.Y()));
}
void VisualToolScale::DoRefresh() {

View file

@ -1,25 +0,0 @@
--- src/visual_tool_vector_clip.cpp.orig
+++ src/visual_tool_vector_clip.cpp
@@ -36,6 +36,13 @@
#include <boost/range/algorithm/set_algorithm.hpp>
#include <wx/toolbar.h>
+#ifdef _LIBCPP_VERSION
+#define TO_STRING(x) std::to_string(x)
+#else
+#include <boost/lexical_cast.hpp>
+#define TO_STRING(x) boost::lexical_cast<std::string>(x)
+#endif
+
/// Button IDs
enum {
BUTTON_DRAG = 1300,
@@ -208,7 +215,7 @@
void VisualToolVectorClip::Save() {
std::string value = "(";
if (spline.GetScale() != 1)
- value += std::to_string(spline.GetScale()) + ",";
+ value += TO_STRING(spline.GetScale()) + ",";
value += spline.EncodeToAss() + ")";
for (auto line : c->selectionController->GetSelectedSet()) {