Don't bother with Win9x compatibility when building 64-bit binaries. SDL-1.2
authorRyan C. Gordon <icculus@icculus.org>
Thu, 13 Oct 2011 01:49:14 -0400
branchSDL-1.2
changeset 5983 1361a12b2e58
parent 5976 081c94f2c04a
child 5984 057c0a599fee
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
src/video/wincommon/SDL_sysevents.c
--- a/src/video/wincommon/SDL_lowvideo.h	Tue Oct 11 22:04:51 2011 -0400
+++ b/src/video/wincommon/SDL_lowvideo.h	Thu Oct 13 01:49:14 2011 -0400
@@ -140,9 +140,13 @@
    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 */
--- a/src/video/wincommon/SDL_sysevents.c	Tue Oct 11 22:04:51 2011 -0400
+++ b/src/video/wincommon/SDL_sysevents.c	Thu Oct 13 01:49:14 2011 -0400
@@ -95,6 +95,7 @@
 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 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 @@
 		return(0);
 
 #ifndef NO_GETKEYBOARDSTATE
-		case WM_INPUTLANGCHANGE: {
+		case WM_INPUTLANGCHANGE:
+#ifndef _WIN64
 			codepage = GetCodePage();
-		}
+#endif
 		return(TRUE);
 #endif
 
@@ -760,6 +763,7 @@
 #endif /* WM_MOUSELEAVE */
 
 #ifndef NO_GETKEYBOARDSTATE
+#ifndef _WIN64
 	/* Initialise variables for SDL_ToUnicode() */
 	codepage = GetCodePage();
 
@@ -767,6 +771,7 @@
 	   const issue here... */
 	SDL_ToUnicode = Is9xME() ? ToUnicode9xME : (ToUnicodeFN) ToUnicode;
 #endif
+#endif /* NO_GETKEYBOARDSTATE */
 
 	app_registered = 1;
 	return(0);
@@ -793,6 +798,7 @@
 }
 
 #ifndef NO_GETKEYBOARDSTATE
+#ifndef _WIN64
 /* JFP: Implementation of ToUnicode() that works on 9x/ME/2K/XP */
 
 static int Is9xME()
@@ -829,5 +835,5 @@
 	}
 	return 0;
 }
-
+#endif
 #endif /* !NO_GETKEYBOARDSTATE */