Skip to content
Permalink
Browse files

Don't bother with Win9x compatibility when building 64-bit binaries.

Fixes Bugzilla #1310.

Thanks to Ozkan Sezer for the patch!
  • Loading branch information
icculus committed Oct 13, 2011
1 parent 0002c69 commit b359efc68acc6d8af8f45bcc4b5aaaf2c99f3c33
Showing with 13 additions and 3 deletions.
  1. +4 −0 src/video/wincommon/SDL_lowvideo.h
  2. +9 −3 src/video/wincommon/SDL_sysevents.c
@@ -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 */
@@ -95,13 +95,15 @@ 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();
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,13 +763,15 @@ int SDL_RegisterApp(char *name, Uint32 style, void *hInst)
#endif /* WM_MOUSELEAVE */

#ifndef NO_GETKEYBOARDSTATE
#ifndef _WIN64
/* Initialise variables for SDL_ToUnicode() */
codepage = GetCodePage();

/* Cygwin headers don't match windows.h, so we have to cast around a
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 */

0 comments on commit b359efc

Please sign in to comment.