From 21bfeb8f33d950df1f931c88dc4d512b63babab6 Mon Sep 17 00:00:00 2001 From: Helge Norberg Date: Thu, 26 Mar 2015 15:25:25 +0100 Subject: [PATCH] Fixed build errors under windows --- common/endian.h | 6 +++--- modules/ffmpeg/producer/util/util.h | 10 ++++++++++ modules/image/producer/image_scroll_producer.cpp | 2 +- modules/image/util/image_algorithms.h | 6 +++--- shell/CMakeLists.txt | 12 ++++++++++-- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/common/endian.h b/common/endian.h index 272dad8e9..e29a4be05 100644 --- a/common/endian.h +++ b/common/endian.h @@ -38,18 +38,18 @@ typename std::enable_if::type swap_byte_or return value; } -/*template +template typename std::enable_if::type swap_byte_order( const T& value) { #ifdef _MSC_VER auto swapped = _byteswap_ushort(reinterpret_cast(value)); #elif __GNUC__ - auto swapped = __builtin_bswap32(value); + auto swapped = __builtin_bswap16(value); #endif return reinterpret_cast(swapped); -}*/ +} template typename std::enable_if::type swap_byte_order( diff --git a/modules/ffmpeg/producer/util/util.h b/modules/ffmpeg/producer/util/util.h index d3c6880b8..4df2d9638 100644 --- a/modules/ffmpeg/producer/util/util.h +++ b/modules/ffmpeg/producer/util/util.h @@ -30,7 +30,17 @@ #include +#if defined(_MSC_VER) +#pragma warning (push) +#pragma warning (disable : 4244) +#endif +extern "C" +{ #include +} +#if defined(_MSC_VER) +#pragma warning (pop) +#endif struct AVFrame; struct AVFormatContext; diff --git a/modules/image/producer/image_scroll_producer.cpp b/modules/image/producer/image_scroll_producer.cpp index 3140f2c11..4313ad0a6 100644 --- a/modules/image/producer/image_scroll_producer.cpp +++ b/modules/image/producer/image_scroll_producer.cpp @@ -156,7 +156,7 @@ struct image_scroll_producer : public core::frame_producer_base blurred_copy.reset(new uint8_t[count]); image_view blurred_view(blurred_copy.get(), width_, height_); - core::tweener blur_tweener(L"easeInQuad"); + caspar::tweener blur_tweener(L"easeInQuad"); blur(original_view, blurred_view, angle, motion_blur_px, blur_tweener); bytes = blurred_copy.get(); bitmap.reset(); diff --git a/modules/image/util/image_algorithms.h b/modules/image/util/image_algorithms.h index cbd3aa707..f8c23f3d6 100644 --- a/modules/image/util/image_algorithms.h +++ b/modules/image/util/image_algorithms.h @@ -62,7 +62,7 @@ public: }; template -std::vector get_tweened_values(const core::tweener& tweener, size_t num_values, T from, T to) +std::vector get_tweened_values(const caspar::tweener& tweener, size_t num_values, T from, T to) { std::vector result; result.reserve(num_values); @@ -104,7 +104,7 @@ void blur( const SrcView& src, DstView& dst, const std::vector>& motion_trail_coordinates, - const core::tweener& tweener) + const caspar::tweener& tweener) { auto blur_px = motion_trail_coordinates.size(); auto tweened_weights_y = get_tweened_values(tweener, blur_px + 2, 255, 0); @@ -167,7 +167,7 @@ void blur( DstView& dst, double angle_radians, int blur_px, - const core::tweener& tweener) + const caspar::tweener& tweener) { auto motion_trail = get_line_points(blur_px, angle_radians); diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index 2315d84d8..f39048b68 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -1,18 +1,26 @@ cmake_minimum_required (VERSION 2.6) project (shell) +if (MSVC) + set(OS_SPECIFIC_SOURCES + resource.h + shell.rc + ) +elseif (CMAKE_COMPILER_IS_GNUCXX) + set(OS_SPECIFIC_SOURCES + ) +endif () set(SOURCES main.cpp server.cpp stdafx.cpp ) set(HEADERS - resource.h server.h stdafx.h ) -add_executable(casparcg ${SOURCES} ${HEADERS}) +add_executable(casparcg ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES}) add_precompiled_header(casparcg stdafx.h FORCEINCLUDE) include_directories(..) -- 2.39.5