diff --git a/CMakeLists.txt b/CMakeLists.txt index fc0a3e8..7447741 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,7 +156,7 @@ target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11) if(ENABLE_OPENEXR_SUPPORT) find_package(OpenEXR REQUIRED) - target_include_directories(${PROJECT_NAME} PRIVATE ${OPENEXR_INCLUDE_DIRS}/OpenEXR) + target_link_libraries(${PROJECT_NAME} PRIVATE OpenEXR::OpenEXR) endif() if ((${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16") AND (NOT MINGW)) @@ -299,6 +299,7 @@ if(MSVC) endif() if((MSVC_VERSION GREATER_EQUAL 1928) AND (CMAKE_SIZEOF_VOID_P EQUAL 8) + AND NOT ENABLE_OPENEXR_SUPPORT AND ((NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang")) OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0))) foreach(t IN LISTS TOOL_EXES ITEMS ${PROJECT_NAME}) target_compile_options(${t} PRIVATE "$<$>:/guard:ehcont>") diff --git a/DirectXTexEXR.cpp b/DirectXTexEXR.cpp index 17bd171..825cfe4 100644 --- a/DirectXTex/DirectXTexEXR.cpp +++ b/DirectXTex/DirectXTexEXR.cpp @@ -8,7 +8,7 @@ //-------------------------------------------------------------------------------------- //Uncomment if you add DirectXTexEXR to your copy of the DirectXTex library -//#include "DirectXTexP.h" +#include "DirectXTexP.h" #include "DirectXTexEXR.h" @@ -57,7 +57,7 @@ using namespace DirectX; using PackedVector::XMHALF4; // Comment out this first anonymous namespace if you add the include of DirectXTexP.h above -#ifdef WIN32 +#if 0 namespace { struct handle_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } }; @@ -161,7 +161,7 @@ namespace return result.QuadPart >= m_EOF; } - Imf::Int64 tellg() override + uint64_t tellg() override { const LARGE_INTEGER dist = {}; LARGE_INTEGER result; @@ -169,10 +169,10 @@ namespace { throw com_exception(HRESULT_FROM_WIN32(GetLastError())); } - return static_cast(result.QuadPart); + return static_cast(result.QuadPart); } - void seekg(Imf::Int64 pos) override + void seekg(uint64_t pos) override { LARGE_INTEGER dist; dist.QuadPart = static_cast(pos); @@ -213,7 +213,7 @@ namespace } } - Imf::Int64 tellp() override + uint64_t tellp() override { const LARGE_INTEGER dist = {}; LARGE_INTEGER result; @@ -221,10 +221,10 @@ namespace { throw com_exception(HRESULT_FROM_WIN32(GetLastError())); } - return static_cast(result.QuadPart); + return static_cast(result.QuadPart); } - void seekp(Imf::Int64 pos) override + void seekp(uint64_t pos) override { LARGE_INTEGER dist; dist.QuadPart = static_cast(pos);