From 545942981faddbb34bad97ed57257539a90391d6 Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Fri, 30 Apr 2021 10:47:30 +0200 Subject: [PATCH] Fix reinterpret_cast usage with clang. In FreeBSD with clang, NULL is redefined to nullptr since freebsd/freebsd-src@c8ed04c static_cast should be used in this case. This fixes build with clang on FreeBSD and should not cause any issues with other compilers. --- src/calibre/utils/cpp_binding.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/cpp_binding.h b/src/calibre/utils/cpp_binding.h index 359d0e4759..5de1dd81d0 100644 --- a/src/calibre/utils/cpp_binding.h +++ b/src/calibre/utils/cpp_binding.h @@ -14,7 +14,7 @@ #define arraysz(x) (sizeof(x)/sizeof(x[0])) -template(NULL)> +template(NULL)> class generic_raii { private: generic_raii( const generic_raii & ) noexcept; @@ -45,7 +45,7 @@ typedef generic_raii wchar_raii; static inline void python_object_destructor(void *p) { PyObject *x = reinterpret_cast(p); Py_XDECREF(x); } typedef generic_raii pyobject_raii; -template(NULL)> +template(NULL)> class generic_raii_array { private: generic_raii_array( const generic_raii_array & ) noexcept;