diff options
Diffstat (limited to 'SwifTools/CrashReporter.cpp')
-rw-r--r-- | SwifTools/CrashReporter.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/SwifTools/CrashReporter.cpp b/SwifTools/CrashReporter.cpp index 4a07e40..f47ab33 100644 --- a/SwifTools/CrashReporter.cpp +++ b/SwifTools/CrashReporter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Remko Tronçon + * Copyright (c) 2012-2013 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ @@ -7,6 +7,7 @@ #include <SwifTools/CrashReporter.h> #include <Swiften/Base/Platform.h> +#include <Swiften/Base/Path.h> #if defined(HAVE_BREAKPAD) @@ -51,16 +52,18 @@ CrashReporter::CrashReporter(const boost::filesystem::path& path) { p = boost::make_shared<Private>(); #if defined(SWIFTEN_PLATFORM_WINDOWS) // FIXME: Need UTF8 conversion from string to wstring - std::string pathString = path.string(); - p->handler = boost::make_shared<google_breakpad::ExceptionHandler>( - std::wstring(pathString.begin(), pathString.end()), - (google_breakpad::ExceptionHandler::FilterCallback) 0, - handleDump, - (void*) 0, - google_breakpad::ExceptionHandler::HANDLER_ALL); + std::string pathString = pathToString(path); + p->handler = boost::shared_ptr<google_breakpad::ExceptionHandler>( + // Not using make_shared, because 'handleDump' seems to have problems with VC2010 + new google_breakpad::ExceptionHandler( + std::wstring(pathString.begin(), pathString.end()), + (google_breakpad::ExceptionHandler::FilterCallback) 0, + handleDump, + (void*) 0, + google_breakpad::ExceptionHandler::HANDLER_ALL)); // Turning it off for Mac, because it doesn't really help us //#elif defined(SWIFTEN_PLATFORM_MACOSX) -// p->handler = boost::make_shared<google_breakpad::ExceptionHandler>(path.string(), (google_breakpad::ExceptionHandler::FilterCallback) 0, handleDump, (void*) 0, true, (const char*) 0); +// p->handler = boost::make_shared<google_breakpad::ExceptionHandler>(pathToString(path), (google_breakpad::ExceptionHandler::FilterCallback) 0, handleDump, (void*) 0, true, (const char*) 0); #endif } @@ -71,6 +74,6 @@ CrashReporter::CrashReporter(const boost::filesystem::path& path) { // Dummy implementation namespace Swift { CrashReporter::CrashReporter(const boost::filesystem::path&) {} -}; +} #endif |