diff --git a/DirectXTex/DirectXTexConvert.cpp b/DirectXTex/DirectXTexConvert.cpp index 043cef1..01edcae 100644 --- a/DirectXTex/DirectXTexConvert.cpp +++ b/DirectXTex/DirectXTexConvert.cpp @@ -2886,7 +2886,7 @@ namespace }; #pragma prefast( suppress : 25004, "Signature must match bsearch_s" ); - int __cdecl _ConvertCompare(void *context, const void* ptr1, const void *ptr2) + int __cdecl ConvertCompare(void *context, const void* ptr1, const void *ptr2) DIRECTX_NOEXCEPT { UNREFERENCED_PARAMETER(context); const ConvertData *p1 = reinterpret_cast(ptr1); @@ -2912,7 +2912,7 @@ DWORD DirectX::_GetConvertFlags(DXGI_FORMAT format) ConvertData key = { format, 0 }; const ConvertData* in = (const ConvertData*)bsearch_s(&key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData), - _ConvertCompare, nullptr); + ConvertCompare, nullptr); return (in) ? in->flags : 0; } @@ -2945,10 +2945,10 @@ void DirectX::_ConvertScanline( // Determine conversion details about source and dest formats ConvertData key = { inFormat, 0 }; const ConvertData* in = (const ConvertData*)bsearch_s(&key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData), - _ConvertCompare, nullptr); + ConvertCompare, nullptr); key.format = outFormat; const ConvertData* out = (const ConvertData*)bsearch_s(&key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData), - _ConvertCompare, nullptr); + ConvertCompare, nullptr); if (!in || !out) { assert(false); diff --git a/DirectXTex/DirectXTexP.h b/DirectXTex/DirectXTexP.h index cb20422..49836f4 100644 --- a/DirectXTex/DirectXTexP.h +++ b/DirectXTex/DirectXTexP.h @@ -118,6 +118,11 @@ #define XBOX_DXGI_FORMAT_R4G4_UNORM DXGI_FORMAT(190) +#if !defined(DIRECTX_NOEXCEPT) && defined(_MSC_VER) && (_MSC_VER < 1900) +#define DIRECTX_NOEXCEPT +#else +#define DIRECTX_NOEXCEPT noexcept +#endif namespace DirectX { diff --git a/DirectXTex/DirectXTexUtil.cpp b/DirectXTex/DirectXTexUtil.cpp index 96a2386..93e425e 100644 --- a/DirectXTex/DirectXTexUtil.cpp +++ b/DirectXTex/DirectXTexUtil.cpp @@ -240,7 +240,7 @@ IWICImagingFactory* DirectX::GetWICFactory(bool& iswic2) static INIT_ONCE s_initOnce = INIT_ONCE_STATIC_INIT; InitOnceExecuteOnce(&s_initOnce, - [](PINIT_ONCE, PVOID, LPVOID *factory) -> BOOL + [](PINIT_ONCE, PVOID, LPVOID *factory) DIRECTX_NOEXCEPT -> BOOL { #if (_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE) HRESULT hr = CoCreateInstance(