diff src/video/windib/SDL_dibevents.c @ 1152:51a8702d8ecd

Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at activekitten.com.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 29 Sep 2005 09:43:00 +0000
parents a78acdd4967e
children 86d0d01290ea
line wrap: on
line diff
--- a/src/video/windib/SDL_dibevents.c	Wed Sep 28 11:36:20 2005 +0000
+++ b/src/video/windib/SDL_dibevents.c	Thu Sep 29 09:43:00 2005 +0000
@@ -360,12 +360,25 @@
 
 int DIB_CreateWindow(_THIS)
 {
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+	wchar_t *SDL_windowid_t;
+#endif
+
 #ifndef CS_BYTEALIGNCLIENT
 #define CS_BYTEALIGNCLIENT	0
 #endif
 	SDL_RegisterApp("SDL_app", CS_BYTEALIGNCLIENT, 0);
 	if ( SDL_windowid ) {
+
+// wince 2.1 does not have strtol
+#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
+		SDL_windowid_t = malloc((strlen(SDL_windowid) + 1) * sizeof(wchar_t));
+		MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, SDL_windowid, -1, SDL_windowid_t, strlen(SDL_windowid) + 1);
+		SDL_Window = (HWND)wcstol(SDL_windowid_t, NULL, 0);
+		free(SDL_windowid_t);
+#else
 		SDL_Window = (HWND)strtol(SDL_windowid, NULL, 0);
+#endif
 		if ( SDL_Window == NULL ) {
 			SDL_SetError("Couldn't get user specified window");
 			return(-1);