This gets bgfx to compile with mingw32 headers found in GCC 4.9.3 and 5.2.1 releases. If it works for everyone, please send upstream (nw)

This commit is contained in:
Cowering 2015-10-04 09:57:27 -05:00
parent 2da1bb0f8d
commit 31a0bb57af

View File

@ -10,30 +10,74 @@
#define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
#define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
#if defined(__MINGW32__) || !defined(DXGI_ERROR_INVALID_CALL)
//#if defined(__MINGW32__) || !defined(DXGI_ERROR_INVALID_CALL)
#ifndef DXGI_STATUS_OCCLUDED
# define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)
#endif
#ifndef DXGI_STATUS_CLIPPED
# define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)
#endif
#ifndef DXGI_STATUS_NO_DIRECTION
# define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)
#endif
#ifndef DXGI_STATUS_NO_DESKTOP_ACCESS
# define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)
#endif
#ifndef DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE
# define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)
#endif
#ifndef DXGI_STATUS_MODE_CHANGED
# define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)
#endif
#ifndef DXGI_STATUS_MODE_CHANGE_IN_PROGRESS
# define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)
#endif
#ifndef DXGI_ERROR_INVALID_CALL
# define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)
#endif
#ifndef DXGI_ERROR_NOT_FOUND
# define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)
#endif
#ifndef DXGI_ERROR_MORE_DATA
# define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)
#endif
#ifndef DXGI_ERROR_UNSUPPORTED
# define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)
#endif
#ifndef DXGI_ERROR_DEVICE_REMOVED
# define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)
#endif
#ifndef DXGI_ERROR_DEVICE_HUNG
# define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)
#endif
#ifndef DXGI_ERROR_DEVICE_RESET
# define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)
#endif
#ifndef DXGI_ERROR_WAS_STILL_DRAWING
# define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)
#endif
#ifndef DXGI_ERROR_FRAME_STATISTICS_DISJOINT
# define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)
#endif
#ifndef DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE
# define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)
#endif
#ifndef DXGI_ERROR_DRIVER_INTERNAL_ERROR
# define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)
#endif
#ifndef DXGI_ERROR_NONEXCLUSIVE
# define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)
#endif
#ifndef DXGI_ERROR_NOT_CURRENTLY_AVAILABLE
# define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)
#endif
#ifndef DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED
# define DXGI_ERROR_REMOTE_CLIENT_DISCONNECTED MAKE_DXGI_HRESULT(35)
#endif
#ifndef DXGI_ERROR_REMOTE_OUTOFMEMORY
# define DXGI_ERROR_REMOTE_OUTOFMEMORY MAKE_DXGI_HRESULT(36)
#endif // defined(__MINGW32__) || (_WIN32_WINNT < 0x0601)
#endif
//#endif // defined(__MINGW32__) || (_WIN32_WINNT < 0x0601)
#define DXGI_CPU_ACCESS_NONE ( 0 )
#define DXGI_CPU_ACCESS_DYNAMIC ( 1 )