]> git.sesse.net Git - casparcg/commitdiff
Fixed build errors under windows
authorHelge Norberg <helge.norberg@svt.se>
Fri, 20 Mar 2015 22:12:23 +0000 (23:12 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Fri, 20 Mar 2015 22:12:23 +0000 (23:12 +0100)
common/CMakeLists.txt
common/except.h
common/log.h
common/os/page_locked_allocator.h
common/os/windows/prec_timer.cpp
common/os/windows/stack_trace.cpp
common/os/windows/win32_exception.cpp
common/os/windows/win32_exception.h
modules/ffmpeg/producer/input/input.cpp
protocol/asio/io_service_manager.cpp
shell/main.cpp

index 5a8677f58e31f5acaec6d1268619764767dd6522..567ec2889d91e844a5eb4cf959625f9a10633dfe 100644 (file)
@@ -89,4 +89,6 @@ source_group(sources ./*)
 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/*)
 
index 3d2bb454bba72151b4867d62daa8711f3ffd9bcf..f28b6d27604c4d016cc423e0e0409a26c009ca13 100644 (file)
@@ -62,7 +62,7 @@ struct caspar_exception                       : virtual boost::exception, virtual std::exception
 {
        caspar_exception(){}
        explicit caspar_exception(const char* msg) : msg_(msg) {}
-       const char* what() const noexcept override
+       const char* what() const throw() override
        {
                return msg_;
        }
index 57495cad6e84c3ca3335805cdfe9cee78f5eb065..665591d2aa7889cb0cdf1da3ceb41b8c3e2f0e2f 100644 (file)
@@ -21,6 +21,8 @@
 
 #pragma once
 
+#include "os/stack_trace.h"
+
 #include <boost/log/trivial.hpp>
 #include <boost/log/sources/global_logger_storage.hpp>
 
@@ -90,12 +92,12 @@ BOOST_LOG_INLINE_GLOBAL_LOGGER_INIT(logger, caspar_logger)
        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(...){}
        
index 9a4d72a3b9193889ba0c48a285fe3a94e6e6bb97..aa892f16dadefee1621613ad41384b0f8a910a25 100644 (file)
@@ -21,6 +21,8 @@
 
 #pragma once
 
+#include <cstdlib>
+
 namespace caspar {
 
 namespace detail {
index 3aff808831e1063ea3245961adf950b80ae5dca1..8bfa8ac7fbe623ef7705d8f0247a16cd26aae9a4 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "../../prec_timer.h"
 
-#include "os/windows/windows.h"
+#include "windows.h"
 
 #include <Mmsystem.h>
 
@@ -34,13 +34,6 @@ prec_timer::prec_timer()
 {
 }
 
-// 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();
index ac25bd91be747fb05b3994990ae439d6bdbe2e7e..804e4425973e380680a1fb8d5d355465d7dcab96 100644 (file)
@@ -22,6 +22,7 @@
 #include "../../stdafx.h"
 
 #include "../stack_trace.h"
+#include "../../utf.h"
 
 #include "../../compiler/vs/stack_walker.h"
 
index 0d7684d4e6c5b7d2c67925f52917a93276b29c01..1c5c899549b7e116696d685491355b98a07415ee 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <boost/thread.hpp>
 
-#include "os/windows/windows.h"
+#include "windows.h"
 
 namespace caspar { namespace detail {
 
index 1e10694238c9f58c51ce8fd9be22c9a1b4f88fb8..ca1869fd705a1948abfe66c30e2d7d59ffa533a3 100644 (file)
@@ -38,11 +38,11 @@ public:
 
        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_;
@@ -58,7 +58,7 @@ class win32_access_violation : public win32_exception
 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);
index dd6c5cf4c4b613209bc63001c7d020652ac73a95..8dbcf8dfb9b5c9f79eb0a69562c7ddbc7483aae4 100644 (file)
@@ -29,7 +29,8 @@
 #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>
@@ -284,7 +285,7 @@ private:
 
        void run()
        {
-               win32_exception::install_handler();
+               ensure_gpf_handler_installed_for_thread(u8(print()).c_str());
 
                while(is_running_)
                {
index 00ef8f3f7f4d8acd40c7e03db597831d840ea614..44bfa3772a1c9f78290ff7763a89f37111387459 100644 (file)
@@ -28,7 +28,7 @@
 #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 {
 
@@ -48,7 +48,7 @@ struct io_service_manager::impl
 
        void run()
        {
-               win32_exception::ensure_handler_installed_for_thread("asio-thread");
+               ensure_gpf_handler_installed_for_thread("asio-thread");
 
                service_.run();
        }
index 6993caa85813941ead51cf9eca14a04b32d26107..394a01078616e975de727681a462a30cfd9022ae 100644 (file)
@@ -59,6 +59,7 @@
 #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>
@@ -340,7 +341,7 @@ int main(int argc, wchar_t* argv[])
        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
@@ -355,8 +356,7 @@ int main(int argc, wchar_t* argv[])
                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;