From 3952c64ffcd7e073f62476b733dc9145e2f5bc8a Mon Sep 17 00:00:00 2001 From: Kp Date: Wed, 28 Jan 2015 03:42:53 +0000 Subject: [PATCH] Fix PHYSFSX_check_* for RAIIdmem --- common/include/physfsx.h | 4 ++-- common/include/u_mem.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/common/include/physfsx.h b/common/include/physfsx.h index b89705844..f7d224066 100644 --- a/common/include/physfsx.h +++ b/common/include/physfsx.h @@ -110,7 +110,7 @@ static inline PHYSFS_sint64 PHYSFSX_check_read(PHYSFS_file *file, const std::uni template static inline PHYSFS_sint64 PHYSFSX_check_read(PHYSFS_file *file, const RAIIdmem &v, PHYSFS_uint32 S, PHYSFS_uint32 C) { - return PHYSFSX_check_read(file, static_cast(v), S, C); + return PHYSFSX_check_read(file, static_cast::pointer>(v), S, C); } template @@ -156,7 +156,7 @@ static inline PHYSFS_sint64 PHYSFSX_check_write(PHYSFS_file *file, const std::un template static inline PHYSFS_sint64 PHYSFSX_check_write(PHYSFS_file *file, const RAIIdmem &v, PHYSFS_uint32 S, PHYSFS_uint32 C) { - return PHYSFSX_check_write(file, static_cast(v), S, C); + return PHYSFSX_check_write(file, static_cast::pointer>(v), S, C); } template diff --git a/common/include/u_mem.h b/common/include/u_mem.h index 305624560..8c25b1b02 100644 --- a/common/include/u_mem.h +++ b/common/include/u_mem.h @@ -97,10 +97,12 @@ public: template ::type> class RAIIdmem : public std::unique_ptr> { + typedef std::unique_ptr> base_ptr; static_assert(tt::is_pod::value, "RAIIdmem cannot manage non-POD"); public: - DXX_INHERIT_CONSTRUCTORS(RAIIdmem, std::unique_ptr>); - operator T*() const + typedef typename base_ptr::pointer pointer; + DXX_INHERIT_CONSTRUCTORS(RAIIdmem, base_ptr); + operator pointer() const #ifdef DXX_HAVE_CXX11_REF_QUALIFIER & #endif