Skip to content

Commit

Permalink
D3D9: fix compilation with MinGW
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Apr 23, 2018
1 parent 588c180 commit 7eaa819
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 1 addition & 2 deletions OgreMain/include/WIN32/OgreMinGWSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ THE SOFTWARE.
# define __in
#endif
#define UINT8 uint8_t
#define WINAPI_INLINE inline
#ifndef __uuidof(Object)
#ifndef __uuidof
# define __uuidof(Object) IID_##Object
#endif

Expand Down
4 changes: 1 addition & 3 deletions OgreMain/src/WIN32/OgreMinGWSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ extern "C" {

// MSVC uses security cookies to prevent some buffer overflow attacks.
// provide dummy implementations.
intptr_t __security_cookie;

void _fastcall __security_check_cookie(intptr_t i)
void __security_check_cookie(intptr_t i)
{
}
}
1 change: 0 additions & 1 deletion RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ THE SOFTWARE.
extern "C" {
#include "WIN32/OgreMinGWSupport.h"
void _chkstk();
void _fastcall __security_check_cookie(intptr_t i);
}
#endif

Expand Down
9 changes: 8 additions & 1 deletion RenderSystems/Direct3D9/src/OgreDxErr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ A "contributor" is any person that distributes its contribution under this licen

// This version only supports UNICODE.

#include "OgrePrerequisites.h"

#if !defined(NOMINMAX)
#define NOMINMAX
#endif
#include <windows.h>

#ifndef __MINGW32__
#pragma warning( disable : 4005 ) // warning C4005: 'xxx': macro redefinition

#include <stdio.h>
Expand Down Expand Up @@ -4025,11 +4028,12 @@ HRESULT WINAPI DXTraceW( _In_z_ const WCHAR* strFile, _In_ DWORD dwLine, _In_ HR

return hr;
}

#endif
namespace Ogre
{
String DXGetErrorDescription(HRESULT hr)
{
#ifndef __MINGW32__
WCHAR wideBuf[1024];
wideBuf[0] = 0;
DXGetErrorDescriptionW(hr, wideBuf, ARRAYSIZE(wideBuf));
Expand All @@ -4040,5 +4044,8 @@ namespace Ogre
narrowBuf[0] = 0;

return String(narrowBuf);
#else
return "";
#endif
}
}

0 comments on commit 7eaa819

Please sign in to comment.