diff --git a/src/archutils/Win32/DirectXHelpers.cpp b/src/archutils/Win32/DirectXHelpers.cpp index 04423e8476..add4a8ec33 100644 --- a/src/archutils/Win32/DirectXHelpers.cpp +++ b/src/archutils/Win32/DirectXHelpers.cpp @@ -1,6 +1,14 @@ #include "global.h" #include "DirectXHelpers.h" #include "RageUtil.h" +#include +#include +#include +#include // dsound.h needs this +#include +#include + +RString GetErrorString(HRESULT hr); RString hr_ssprintf( int hr, const char *fmt, ... ) { @@ -9,18 +17,10 @@ RString hr_ssprintf( int hr, const char *fmt, ... ) RString s = vssprintf( fmt, va ); va_end(va); - const char *szError = GetErrorString( hr ); - return s + ssprintf( " (%s)", szError ); + RString szError = GetErrorString(hr); + return s + ssprintf(" (%s)", szError.c_str()); } -// needed for defines -#define DIRECTINPUT_VERSION 0x0800 -#define DIRECTSOUND_VERSION 0x0700 -#include -#include -#include // dsound.h needs this -#include - #define DXERRMSG(hrcode, dummy) case hrcode: return #hrcode; RString GetErrorString(HRESULT hr) diff --git a/src/archutils/Win32/DirectXHelpers.h b/src/archutils/Win32/DirectXHelpers.h index d8c56232b4..c2fc67c94e 100644 --- a/src/archutils/Win32/DirectXHelpers.h +++ b/src/archutils/Win32/DirectXHelpers.h @@ -7,6 +7,10 @@ RString hr_ssprintf( int hr, const char *fmt, ... ); RString GetErrorString(HRESULT hr); +// These defined need to be exposed anywhere this is included. +#define DIRECTINPUT_VERSION 0x0800 +#define DIRECTSOUND_VERSION 0x0700 + #endif /*