summaryrefslogtreecommitdiff
path: root/thirdparty/directxtex/DirectXTex
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2012-12-07 15:33:21 +0000
committerJosé Fonseca <jfonseca@vmware.com>2012-12-07 15:39:39 +0000
commit692c0c1359bc49158b74960ca5d77cb0730418f0 (patch)
treea2b9986d3a2a2c5cee99b001265ff669f453179e /thirdparty/directxtex/DirectXTex
parent51410519915899055f0ac3678e77833fe9fbded9 (diff)
directxtex: Get it building on MinGW.
Diffstat (limited to 'thirdparty/directxtex/DirectXTex')
-rw-r--r--thirdparty/directxtex/DirectXTex/DirectXTexConvert.cpp17
-rw-r--r--thirdparty/directxtex/DirectXTex/DirectXTexMipmaps.cpp4
-rw-r--r--thirdparty/directxtex/DirectXTex/scoped.h2
3 files changed, 13 insertions, 10 deletions
diff --git a/thirdparty/directxtex/DirectXTex/DirectXTexConvert.cpp b/thirdparty/directxtex/DirectXTex/DirectXTexConvert.cpp
index f19c269f..7c607346 100644
--- a/thirdparty/directxtex/DirectXTex/DirectXTexConvert.cpp
+++ b/thirdparty/directxtex/DirectXTex/DirectXTexConvert.cpp
@@ -1806,10 +1806,9 @@ static const ConvertData g_ConvertTable[] = {
#endif
};
-#pragma prefast( suppress : 25004, "Signature must match bsearch_s" );
-static int __cdecl _ConvertCompare( void *context, const void* ptr1, const void *ptr2 )
+#pragma prefast( suppress : 25004, "Signature must match bsearch" );
+static int __cdecl _ConvertCompare( const void* ptr1, const void *ptr2 )
{
- UNREFERENCED_PARAMETER(context);
const ConvertData *p1 = reinterpret_cast<const ConvertData*>(ptr1);
const ConvertData *p2 = reinterpret_cast<const ConvertData*>(ptr2);
if ( p1->format == p2->format ) return 0;
@@ -1830,8 +1829,8 @@ DWORD _GetConvertFlags( DXGI_FORMAT format )
#endif
ConvertData key = { format, 0 };
- const ConvertData* in = (const ConvertData*) bsearch_s( &key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
- _ConvertCompare, 0 );
+ const ConvertData* in = (const ConvertData*) bsearch( &key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
+ _ConvertCompare );
return (in) ? in->flags : 0;
}
@@ -1857,11 +1856,11 @@ void _ConvertScanline( XMVECTOR* pBuffer, size_t count, DXGI_FORMAT outFormat, D
// 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, 0 );
+ const ConvertData* in = (const ConvertData*) bsearch( &key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
+ _ConvertCompare );
key.format = outFormat;
- const ConvertData* out = (const ConvertData*) bsearch_s( &key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
- _ConvertCompare, 0 );
+ const ConvertData* out = (const ConvertData*) bsearch( &key, g_ConvertTable, _countof(g_ConvertTable), sizeof(ConvertData),
+ _ConvertCompare );
if ( !in || !out )
{
assert(false);
diff --git a/thirdparty/directxtex/DirectXTex/DirectXTexMipmaps.cpp b/thirdparty/directxtex/DirectXTex/DirectXTexMipmaps.cpp
index 666c9216..1e7e27cd 100644
--- a/thirdparty/directxtex/DirectXTex/DirectXTexMipmaps.cpp
+++ b/thirdparty/directxtex/DirectXTex/DirectXTexMipmaps.cpp
@@ -109,6 +109,8 @@ bool _CalculateMipLevels3D( _In_ size_t width, _In_ size_t height, _In_ size_t d
return true;
}
+#ifndef __MINGW32__
+
static HRESULT _EnsureWicBitmapPixelFormat( _In_ IWICImagingFactory* pWIC, _In_ IWICBitmap* src, _In_ DWORD filter,
_In_ const WICPixelFormatGUID& desiredPixelFormat,
_Deref_out_ IWICBitmap** dest )
@@ -1160,4 +1162,6 @@ HRESULT GenerateMipMaps3D( const Image* srcImages, size_t nimages, const TexMeta
}
}
+#endif /* !__MINGW32__ */
+
}; // namespace
diff --git a/thirdparty/directxtex/DirectXTex/scoped.h b/thirdparty/directxtex/DirectXTex/scoped.h
index 358290d7..81816069 100644
--- a/thirdparty/directxtex/DirectXTex/scoped.h
+++ b/thirdparty/directxtex/DirectXTex/scoped.h
@@ -33,7 +33,7 @@ typedef std::unique_ptr<DirectX::XMVECTOR, aligned_deleter> ScopedAlignedArrayXM
//---------------------------------------------------------------------------------
struct handle_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } };
-typedef public std::unique_ptr<void, handle_closer> ScopedHandle;
+typedef std::unique_ptr<void, handle_closer> ScopedHandle;
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }