diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2017-01-24 14:00:34 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2017-01-24 14:00:34 +0000 |
commit | 633ff470359a67b0bbf49095f52c1f3b14fa8e73 (patch) | |
tree | 917f347c635ae3dc59b7cc7026eeeff6e53f1d3f /graphics/sekrit-twc-zimg/files | |
parent | 911a5e4d17b626a868b4c7766ad3dbf7da5dc1e8 (diff) | |
download | ports-633ff470359a67b0bbf49095f52c1f3b14fa8e73.tar.gz ports-633ff470359a67b0bbf49095f52c1f3b14fa8e73.zip |
Notes
Diffstat (limited to 'graphics/sekrit-twc-zimg/files')
-rw-r--r-- | graphics/sekrit-twc-zimg/files/extra-patch-src_zimg_api_zimg.cpp | 62 | ||||
-rw-r--r-- | graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp | 8 |
2 files changed, 66 insertions, 4 deletions
diff --git a/graphics/sekrit-twc-zimg/files/extra-patch-src_zimg_api_zimg.cpp b/graphics/sekrit-twc-zimg/files/extra-patch-src_zimg_api_zimg.cpp new file mode 100644 index 000000000000..6530da67207e --- /dev/null +++ b/graphics/sekrit-twc-zimg/files/extra-patch-src_zimg_api_zimg.cpp @@ -0,0 +1,62 @@ +FreeBSD 10.3 lacks __cxa_thread_atexit, so revert +https://github.com/sekrit-twc/zimg/commit/7e47d8d2a892 + +--- src/zimg/api/zimg.cpp.orig 2017-01-21 18:59:03 UTC ++++ src/zimg/api/zimg.cpp +@@ -1,6 +1,5 @@ + #include <cmath> + #include <memory> +-#include <string> + #include <tuple> + #include <type_traits> + #include <utility> +@@ -31,7 +30,7 @@ constexpr unsigned API_VERSION_2_2 = ZIM + #define STRIDE_ALIGNMENT_ASSERT(x) zassert_d(!(x) || (x) % zimg::ALIGNMENT == 0, "buffer stride not aligned") + + thread_local zimg_error_code_e g_last_error = ZIMG_ERROR_SUCCESS; +-thread_local std::string g_last_error_msg; ++thread_local char g_last_error_msg[1024]; + + constexpr unsigned VERSION_INFO[] = { 2, 4, 0 }; + +@@ -43,19 +42,10 @@ T *assert_dynamic_type(U *ptr) noexcept + return static_cast<T *>(ptr); + } + +-void clear_last_error_message() noexcept +-{ +- g_last_error_msg.clear(); +- g_last_error_msg.shrink_to_fit(); +-} +- + void record_exception_message(const zimg::error::Exception &e) noexcept + { +- try { +- g_last_error_msg = e.what(); +- } catch (const std::bad_alloc &) { +- clear_last_error_message(); +- } ++ strncpy(g_last_error_msg, e.what(), sizeof(g_last_error_msg) - 1); ++ g_last_error_msg[sizeof(g_last_error_msg) - 1] = '\0'; + } + + zimg_error_code_e handle_exception(std::exception_ptr eptr) noexcept +@@ -438,7 +428,7 @@ unsigned zimg_get_api_version(unsigned * + zimg_error_code_e zimg_get_last_error(char *err_msg, size_t n) + { + if (err_msg && n) { +- std::strncpy(err_msg, g_last_error_msg.c_str(), n); ++ strncpy(err_msg, g_last_error_msg, n); + err_msg[n - 1] = '\0'; + } + +@@ -447,8 +437,8 @@ zimg_error_code_e zimg_get_last_error(ch + + void zimg_clear_last_error(void) + { ++ g_last_error_msg[0] = '\0'; + g_last_error = ZIMG_ERROR_SUCCESS; +- clear_last_error_message(); + } + + unsigned zimg_select_buffer_mask(unsigned count) diff --git a/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp b/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp index 57010adfee5f..3aa1453305a7 100644 --- a/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp +++ b/graphics/sekrit-twc-zimg/files/patch-test_resize_resize__impl__test.cpp @@ -23,11 +23,11 @@ test/resize/resize_impl_test.cpp:37:3: error: no matching conversion for functio ^ 1 error generated. ---- test/resize/resize_impl_test.cpp.orig 2016-01-22 18:12:28 UTC +--- test/resize/resize_impl_test.cpp.orig 2017-01-21 18:59:03 UTC +++ test/resize/resize_impl_test.cpp -@@ -34,7 +34,7 @@ void test_case(const zimg::PixelFormat & - set_shift(shift). - set_subwidth(subwidth_factor * (horizontal ? src_w : src_h)).create(); +@@ -35,7 +35,7 @@ void test_case(const zimg::PixelFormat & + .set_subwidth(subwidth_factor * (horizontal ? src_w : src_h)) + .create(); - ASSERT_TRUE(filter); + ASSERT_TRUE(static_cast<bool>(filter)); |