source_group(sources\\gl gl/*)
source_group(sources\\diagnostics diagnostics/*)
source_group(sources\\compiler\\vs compiler/vs/*)
+source_group(sources\\os\\windows os/windows/*)
+source_group(sources\\os os/*)
{
caspar_exception(){}
explicit caspar_exception(const char* msg) : msg_(msg) {}
- const char* what() const noexcept override
+ const char* what() const throw() override
{
return msg_;
}
#pragma once
+#include "os/stack_trace.h"
+
#include <boost/log/trivial.hpp>
#include <boost/log/sources/global_logger_storage.hpp>
BOOST_LOG_SEV(::caspar::log::logger::get(), ::boost::log::trivial::lvl)
#define CASPAR_LOG_CALL_STACK() try{\
- CASPAR_LOG(info) << L"callstack:\n" << caspar::log::internal::get_call_stack();\
+ CASPAR_LOG(info) << L"callstack:\n" << caspar::get_call_stack();\
}\
catch(...){}
#define CASPAR_LOG_CURRENT_EXCEPTION() try{\
- CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at:\n" << caspar::log::internal::get_call_stack();\
+ CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at:\n" << caspar::get_call_stack();\
}\
catch(...){}
#pragma once
+#include <cstdlib>
+
namespace caspar {
namespace detail {
#include "../../prec_timer.h"
-#include "os/windows/windows.h"
+#include "windows.h"
#include <Mmsystem.h>
{
}
-// Author: Ryan M. Geiss
-// http://www.geisswerks.com/ryan/FAQS/timing.html
-void prec_timer::tick(double interval)
-{
- tick_millis(static_cast<int64_t>(interval * 1000.0));
-}
-
void prec_timer::tick_millis(int64_t ticks_to_wait)
{
auto t = ::timeGetTime();
#include "../../stdafx.h"
#include "../stack_trace.h"
+#include "../../utf.h"
#include "../../compiler/vs/stack_walker.h"
#include <boost/thread.hpp>
-#include "os/windows/windows.h"
+#include "windows.h"
namespace caspar { namespace detail {
address location() const { return location_; }
unsigned int error_code() const { return errorCode_; }
- virtual const char* what() const noexcept override { return message_; }
+ virtual const char* what() const throw() override { return message_; }
+ static void Handler(unsigned int errorCode, EXCEPTION_POINTERS* pInfo);
protected:
win32_exception(const EXCEPTION_RECORD& info);
- static void Handler(unsigned int errorCode, EXCEPTION_POINTERS* pInfo);
private:
const char* message_;
public:
bool is_write() const { return isWrite_; }
address bad_address() const { return badAddress_;}
- virtual const char* what() const noexcept override;
+ virtual const char* what() const throw() override;
protected:
win32_access_violation(const EXCEPTION_RECORD& info);
#include <common/diagnostics/graph.h>
#include <common/executor.h>
#include <common/lock.h>
-#include <common/except.h>
+//#include <common/except.h>
+#include <common/os/general_protection_fault.h>
#include <common/log.h>
#include <core/video_format.h>
void run()
{
- win32_exception::install_handler();
+ ensure_gpf_handler_installed_for_thread(u8(print()).c_str());
while(is_running_)
{
#include <boost/asio/io_service.hpp>
#include <boost/thread/thread.hpp>
-#include <common/except.h>
+#include <common/os/general_protection_fault.h>
namespace caspar { namespace protocol { namespace asio {
void run()
{
- win32_exception::ensure_handler_installed_for_thread("asio-thread");
+ ensure_gpf_handler_installed_for_thread("asio-thread");
service_.run();
}
#include <common/log.h>
#include <common/gl/gl_check.h>
#include <common/os/system_info.h>
+#include <common/os/general_protection_fault.h>
#include <boost/property_tree/detail/file_parser_error.hpp>
#include <boost/property_tree/xml_parser.hpp>
SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
// Install structured exception handler.
- win32_exception::install_handler();
+ ensure_gpf_handler_installed_for_thread("main thread");
// Increase time precision. This will increase accuracy of function like Sleep(1) from 10 ms to 1 ms.
struct inc_prec
tbb_thread_installer(){observe(true);}
void on_scheduler_entry(bool is_worker)
{
- //detail::SetThreadName(GetCurrentThreadId(), "tbb-worker-thread");
- win32_exception::install_handler();
+ ensure_gpf_handler_installed_for_thread("tbb-worker-thread");
}
} tbb_thread_installer;