From b359efc68acc6d8af8f45bcc4b5aaaf2c99f3c33 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 13 Oct 2011 01:49:14 -0400 Subject: [PATCH] Don't bother with Win9x compatibility when building 64-bit binaries. Fixes Bugzilla #1310. Thanks to Ozkan Sezer for the patch! --- src/video/wincommon/SDL_lowvideo.h | 4 ++++ src/video/wincommon/SDL_sysevents.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/video/wincommon/SDL_lowvideo.h b/src/video/wincommon/SDL_lowvideo.h index 26800773d..c80fa60d3 100644 --- a/src/video/wincommon/SDL_lowvideo.h +++ b/src/video/wincommon/SDL_lowvideo.h @@ -140,9 +140,13 @@ extern void DX5_SoundFocus(HWND window); GDL_CreateWindow as well */ LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); +#ifdef _WIN64 +#define SDL_ToUnicode ToUnicode +#else /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */ typedef int (WINAPI *ToUnicodeFN)(UINT, UINT, const BYTE *, LPWSTR, int, UINT); extern ToUnicodeFN SDL_ToUnicode; +#endif #endif /* SDL_lowvideo_h */ diff --git a/src/video/wincommon/SDL_sysevents.c b/src/video/wincommon/SDL_sysevents.c index 7cc51f760..dfefef3e5 100644 --- a/src/video/wincommon/SDL_sysevents.c +++ b/src/video/wincommon/SDL_sysevents.c @@ -95,6 +95,7 @@ void (*WIN_WinPAINT)(_THIS, HDC hdc); extern void DIB_SwapGamma(_THIS); #ifndef NO_GETKEYBOARDSTATE +#ifndef _WIN64 /* Variables and support functions for SDL_ToUnicode() */ static int codepage; static int Is9xME(); @@ -102,6 +103,7 @@ static int GetCodePage(); static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, const BYTE *keystate, LPWSTR wchars, int wsize, UINT flags); ToUnicodeFN SDL_ToUnicode = ToUnicode9xME; +#endif #endif /* !NO_GETKEYBOARDSTATE */ @@ -650,9 +652,10 @@ this->hidden->hiresFix, &x, &y); return(0); #ifndef NO_GETKEYBOARDSTATE - case WM_INPUTLANGCHANGE: { + case WM_INPUTLANGCHANGE: +#ifndef _WIN64 codepage = GetCodePage(); - } +#endif return(TRUE); #endif @@ -760,6 +763,7 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst) #endif /* WM_MOUSELEAVE */ #ifndef NO_GETKEYBOARDSTATE +#ifndef _WIN64 /* Initialise variables for SDL_ToUnicode() */ codepage = GetCodePage(); @@ -767,6 +771,7 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst) const issue here... */ SDL_ToUnicode = Is9xME() ? ToUnicode9xME : (ToUnicodeFN) ToUnicode; #endif +#endif /* NO_GETKEYBOARDSTATE */ app_registered = 1; return(0); @@ -793,6 +798,7 @@ void SDL_UnregisterApp() } #ifndef NO_GETKEYBOARDSTATE +#ifndef _WIN64 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */ static int Is9xME() @@ -829,5 +835,5 @@ static int WINAPI ToUnicode9xME(UINT vkey, UINT scancode, const BYTE *keystate, } return 0; } - +#endif #endif /* !NO_GETKEYBOARDSTATE */