From f251a7ba336bc8c29c5e3ffe62e891f0e75f8b3d Mon Sep 17 00:00:00 2001 From: Edgar Simo Date: Mon, 25 Aug 2008 17:30:39 +0000 Subject: [PATCH] Fix for mingw compilation of haptic subsystem by Alam. --- configure.in | 1 + src/haptic/win32/SDL_syshaptic.c | 8 ++++---- src/joystick/win32/SDL_dxjoystick.c | 2 +- src/joystick/win32/SDL_dxjoystick_c.h | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 76e70e3b2..7514aee3c 100644 --- a/configure.in +++ b/configure.in @@ -2327,6 +2327,7 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau if test x$have_dinput = xyes; then AC_DEFINE(SDL_JOYSTICK_DINPUT) SOURCES="$SOURCES $srcdir/src/joystick/win32/SDL_dxjoystick.c" + EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldinput8 -ldxguid -ldxerr8 -lole32" else AC_DEFINE(SDL_JOYSTICK_WINMM) SOURCES="$SOURCES $srcdir/src/joystick/win32/SDL_mmjoystick.c" diff --git a/src/haptic/win32/SDL_syshaptic.c b/src/haptic/win32/SDL_syshaptic.c index 2b4a0e7c6..d7ab33da4 100644 --- a/src/haptic/win32/SDL_syshaptic.c +++ b/src/haptic/win32/SDL_syshaptic.c @@ -34,11 +34,11 @@ #define DIRECTINPUT_VERSION 0x0700 /* Need at least DirectX 7 for dwStartDelay */ #include -#include +#include #ifdef _MSC_VER # pragma comment (lib, "dinput8.lib") # pragma comment (lib, "dxguid.lib") -# pragma comment (lib, "dxerr.lib") +# pragma comment (lib, "dxerr8.lib") #endif /* _MSC_VER */ /* an ISO hack for VisualC++ */ @@ -118,8 +118,8 @@ static void DI_SetError(const char *str, HRESULT err) { SDL_SetError( "Haptic: %s - %s: %s", str, - DXGetErrorString(err), - DXGetErrorDescription(err)); + DXGetErrorString8A(err), + DXGetErrorDescription8A(err)); } diff --git a/src/joystick/win32/SDL_dxjoystick.c b/src/joystick/win32/SDL_dxjoystick.c index f40128a67..4a84db28b 100644 --- a/src/joystick/win32/SDL_dxjoystick.c +++ b/src/joystick/win32/SDL_dxjoystick.c @@ -85,7 +85,7 @@ static void SetDIerror(const char *function, HRESULT code) { SDL_SetError("%s() [%s]: %s", function, - DXGetErrorString(code), DXGetErrorDescription(code)); + DXGetErrorString8A(code), DXGetErrorDescription8A(code)); } diff --git a/src/joystick/win32/SDL_dxjoystick_c.h b/src/joystick/win32/SDL_dxjoystick_c.h index 4098e6f51..afd800128 100644 --- a/src/joystick/win32/SDL_dxjoystick_c.h +++ b/src/joystick/win32/SDL_dxjoystick_c.h @@ -42,9 +42,9 @@ /* Used for the c_dfDIJoystick2 symbol (no imports are used) */ # pragma comment (lib, "dinput.lib") #endif -#include +#include #ifdef _MSC_VER -# pragma comment (lib, "dxerr.lib") +# pragma comment (lib, "dxerr8.lib") #endif