Removed Windows CE support from SDL 2.0.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 15 Sep 2012 10:59:39 -0400
changeset 6430 48d519500f7e
parent 6429 ff5e34883bf8
child 6431 1f9c0e93bd96
Removed Windows CE support from SDL 2.0. It's a long-dead platform, and we don't have any way to build for, test, or maintain it, so there's no sense in doing acrobatics to support it. If you need Windows CE support, use SDL 1.2. If you need Windows Phone support, send SDL 2.0 patches for the newer Windows Mobile platform.
README.WinCE
configure.in
include/SDL_assert.h
include/SDL_atomic.h
include/SDL_config.h.in
include/SDL_config_windows.h
include/SDL_cpuinfo.h
include/SDL_thread.h
src/SDL.c
src/audio/SDL_audio.c
src/audio/winmm/SDL_winmm.c
src/file/SDL_rwops.c
src/loadso/windows/SDL_sysloadso.c
src/main/windows/SDL_windows_main.c
src/power/windows/SDL_syspower.c
src/stdlib/SDL_getenv.c
src/thread/windows/SDL_sysmutex.c
src/thread/windows/SDL_syssem.c
src/thread/windows/SDL_systhread.c
src/thread/windows/win_ce_semaphore.c
src/thread/windows/win_ce_semaphore.h
src/timer/SDL_timer.c
src/timer/wince/SDL_systimer.c
src/timer/windows/SDL_systimer.c
src/video/SDL_stretch.c
src/video/windows/SDL_windowsclipboard.c
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowsframebuffer.c
src/video/windows/SDL_windowskeyboard.c
src/video/windows/SDL_windowsmodes.c
src/video/windows/SDL_windowsvideo.c
src/video/windows/SDL_windowsvideo.h
src/video/windows/SDL_windowswindow.c
src/video/windows/SDL_windowswindow.h
--- a/README.WinCE	Fri Sep 14 18:18:38 2012 -0400
+++ b/README.WinCE	Sat Sep 15 10:59:39 2012 -0400
@@ -1,55 +1,9 @@
 
-Project files for embedded Visual C++ 3.0, 4.0 and 
-Visual Studio 2005 can be found in VisualCE.zip
-
-SDL supports GAPI and WinDib output for Windows CE.
-
-GAPI driver supports:
-
-- all possible WinCE devices (Pocket PC, Smartphones, HPC)
-  with different orientations of video memory and resolutions.
-- 4, 8 and 16 bpp devices
-- special handling of 8bpp on 8bpp devices
-- VGA mode, you can even switch between VGA and GAPI in runtime
-  (between 240x320 and 480x640 for example). On VGA devices you can
-  use either GAPI or VGA.
-- Landscape mode and automatic rotation of buttons and stylus coordinates.
-  To enable landscape mode make width of video screen bigger than height.
-  For example: 
-    SDL_SetVideoMode(320,240,16,SDL_FULLSCREEN)
-- WM2005
-- SDL_ListModes
-
-NOTE:
-There are several SDL features not available in the WinCE port of SDL.
+Windows CE is no longer supported by SDL.
 
-- DirectX is not yet available
-- Semaphores are not available
-- Joystick support is not available
-- CD-ROM control is not available
-
-In addition, there are several features that run in "degraded" mode:
-
-Preprocessor Symbol		Effect
-===================		=================================
-
-SDL_systimer.c:
-USE_GETTICKCOUNT		Less accurate values for SDL time functions
-USE_SETTIMER			Use only a single marginally accurate timer
+We have left the CE support in SDL 1.2 for those that must have it, and we
+will accept patches that support more modern Windows Mobile platforms for
+SDL 2.0.
 
-SDL_syswm.c:
-DISABLE_ICON_SUPPORT		Can't set the runtime window icon
-
-SDL_sysmouse.c:
-USE_STATIC_CURSOR		Only the arrow cursor is available
+--ryan.
 
-SDL_sysevents.c:
-NO_GETKEYBOARDSTATE		Can't get modifier state on keyboard focus
-
-SDL_dibevents.c:
-NO_GETKEYBOARDSTATE		Very limited keycode translation
-
-SDL_dibvideo.c:
-NO_GETDIBITS			Can't distinguish between 15 bpp and 16 bpp
-NO_CHANGEDISPLAYSETTINGS	No fullscreen support
-NO_GAMMA_SUPPORT		Gamma correction not available
--- a/configure.in	Fri Sep 14 18:18:38 2012 -0400
+++ b/configure.in	Sat Sep 15 10:59:39 2012 -0400
@@ -1908,6 +1908,8 @@
     ],[
     ],[
     have_wince=yes
+       AC_MSG_ERROR([
+*** Sorry, Windows CE is no longer supported.
     ])
     AC_MSG_RESULT($have_wince)
 
@@ -2239,82 +2241,6 @@
             have_timers=yes
         fi
         ;;
-    *-wince* | *-mingw32ce)
-        ARCH=win32
-        CheckDummyVideo
-        CheckDiskAudio
-        CheckDummyAudio
-        CheckWINDOWS
-        if test x$enable_video = xyes; then
-            AC_DEFINE(SDL_VIDEO_DRIVER_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/video/windows/*.c"
-            have_video=yes
-            AC_ARG_ENABLE(render-d3d,
-AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[default=yes]]]),
-                                , enable_render_d3d=yes)
-            enable_render_d3d=no
-            if test x$enable_render_d3d = xyes -a x$have_d3d = xyes; then
-                AC_DEFINE(SDL_VIDEO_RENDER_D3D, 1, [ ])
-            fi
-        fi
-        # Set up files for the audio library
-        if test x$enable_audio = xyes; then
-            AC_DEFINE(SDL_AUDIO_DRIVER_WINMM, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/audio/winmm/*.c"
-            if test x$have_dsound = xyes; then
-                AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/directsound/*.c"
-            fi
-            if test x$have_xaudio2 = xyes; then
-                AC_DEFINE(SDL_AUDIO_DRIVER_XAUDIO2, 1, [ ])
-                SOURCES="$SOURCES $srcdir/src/audio/xaudio2/*.c"
-            fi
-            have_audio=yes
-        fi
-        # Set up dummy files for the joystick for now
-        if test x$enable_joystick = xyes; then
-            AC_DEFINE(SDL_JOYSTICK_DUMMY, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
-            have_joystick=yes
-        fi
-        # Set up files for the thread library
-        if test x$enable_threads = xyes; then
-            AC_DEFINE(SDL_THREAD_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_sysmutex.c"
-            SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_syssem.c"
-            SOURCES="$SOURCES $srcdir/src/thread/windows/SDL_systhread.c"
-            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
-            have_threads=yes
-        fi
-        # Set up files for the timer library
-        if test x$enable_timers = xyes; then
-            AC_DEFINE(SDL_TIMER_WINCE, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/timer/wince/*.c"
-            have_timers=yes
-        fi
-        # Set up files for the shared object loading library
-        if test x$enable_loadso = xyes; then
-            AC_DEFINE(SDL_LOADSO_WINDOWS, 1, [ ])
-            SOURCES="$SOURCES $srcdir/src/loadso/windows/*.c"
-            have_loadso=yes
-        fi
-        # Set up the system libraries we need
-        EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lcoredll -lcommctrl -lmmtimer"
-
-	# mingw32ce library
-	case "$host" in
-    	    *-mingw32ce)
-    		EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lmingwex"
-    		;;
-    	    *)
-        	;;
-	esac
-
-        # The Windows platform requires special setup
-        SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
-        EXTRA_CFLAGS="$EXTRA_CFLAGS -Dmain=SDL_main -D_WIN32_WCE=0x420"
-        EXTRA_LDFLAGS="-lSDL2main $EXTRA_LDFLAGS"
-        ;;
     *-*-cygwin* | *-*-mingw32*)
         ARCH=win32
         if test "$build" != "$host"; then # cross-compiling
--- a/include/SDL_assert.h	Fri Sep 14 18:18:38 2012 -0400
+++ b/include/SDL_assert.h	Sat Sep 15 10:59:39 2012 -0400
@@ -49,9 +49,9 @@
 assert can have unique static variables associated with it.
 */
 
-#if defined(_MSC_VER) && !defined(_WIN32_WCE)
+#if defined(_MSC_VER)
 /* Don't include intrin.h here because it contains C++ code */
-extern void __cdecl __debugbreak(void);
+    extern void __cdecl __debugbreak(void);
     #define SDL_TriggerBreakpoint() __debugbreak()
 #elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)))
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
--- a/include/SDL_atomic.h	Fri Sep 14 18:18:38 2012 -0400
+++ b/include/SDL_atomic.h	Sat Sep 15 10:59:39 2012 -0400
@@ -65,7 +65,7 @@
 
 /* Need to do this here because intrin.h has C++ code in it */
 /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
-#if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(_WIN32_WCE)
+#if defined(_MSC_VER) && (_MSC_VER >= 1500)
 #include <intrin.h>
 #define HAVE_MSC_ATOMICS 1
 #endif
--- a/include/SDL_config.h.in	Fri Sep 14 18:18:38 2012 -0400
+++ b/include/SDL_config.h.in	Sat Sep 15 10:59:39 2012 -0400
@@ -242,7 +242,6 @@
 #undef SDL_TIMER_NDS
 #undef SDL_TIMER_UNIX
 #undef SDL_TIMER_WINDOWS
-#undef SDL_TIMER_WINCE
 
 /* Enable various video drivers */
 #undef SDL_VIDEO_DRIVER_BWINDOW
--- a/include/SDL_config_windows.h	Fri Sep 14 18:18:38 2012 -0400
+++ b/include/SDL_config_windows.h	Sat Sep 15 10:59:39 2012 -0400
@@ -85,9 +85,7 @@
 #define HAVE_STRING_H 1
 #define HAVE_CTYPE_H 1
 #define HAVE_MATH_H 1
-#ifndef _WIN32_WCE
 #define HAVE_SIGNAL_H 1
-#endif
 
 /* C library functions */
 #define HAVE_MALLOC 1
@@ -143,22 +141,15 @@
 #endif
 
 /* Enable various audio drivers */
-#ifndef _WIN32_WCE
 #define SDL_AUDIO_DRIVER_DSOUND	1
 #define SDL_AUDIO_DRIVER_XAUDIO2	1
-#endif
 #define SDL_AUDIO_DRIVER_WINMM	1
 #define SDL_AUDIO_DRIVER_DISK	1
 #define SDL_AUDIO_DRIVER_DUMMY	1
 
 /* Enable various input drivers */
-#ifdef _WIN32_WCE
-#define SDL_JOYSTICK_DISABLED	1
-#define SDL_HAPTIC_DUMMY	1
-#else
 #define SDL_JOYSTICK_DINPUT	1
 #define SDL_HAPTIC_DINPUT	1
-#endif
 
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_WINDOWS	1
@@ -167,24 +158,17 @@
 #define SDL_THREAD_WINDOWS	1
 
 /* Enable various timer systems */
-#ifdef _WIN32_WCE
-#define SDL_TIMER_WINCE	1
-#else
 #define SDL_TIMER_WINDOWS	1
-#endif
 
 /* Enable various video drivers */
 #define SDL_VIDEO_DRIVER_DUMMY	1
 #define SDL_VIDEO_DRIVER_WINDOWS	1
 
-#ifndef _WIN32_WCE
 #ifndef SDL_VIDEO_RENDER_D3D
 #define SDL_VIDEO_RENDER_D3D	1
 #endif
-#endif
 
 /* Enable OpenGL support */
-#ifndef _WIN32_WCE
 #ifndef SDL_VIDEO_OPENGL
 #define SDL_VIDEO_OPENGL	1
 #endif
@@ -194,7 +178,6 @@
 #ifndef SDL_VIDEO_RENDER_OGL
 #define SDL_VIDEO_RENDER_OGL	1
 #endif
-#endif
 
 /* Enable system power support */
 #define SDL_POWER_WINDOWS 1
--- a/include/SDL_cpuinfo.h	Fri Sep 14 18:18:38 2012 -0400
+++ b/include/SDL_cpuinfo.h	Sat Sep 15 10:59:39 2012 -0400
@@ -32,7 +32,7 @@
 
 /* Need to do this here because intrin.h has C++ code in it */
 /* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
-#if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(_WIN32_WCE)
+#if defined(_MSC_VER) && (_MSC_VER >= 1500)
 #include <intrin.h>
 #ifndef _WIN64
 #define __MMX__
--- a/include/SDL_thread.h	Fri Sep 14 18:18:38 2012 -0400
+++ b/include/SDL_thread.h	Sat Sep 15 10:59:39 2012 -0400
@@ -86,9 +86,7 @@
  *  library!
  */
 #define SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#ifndef _WIN32_WCE
 #include <process.h>            /* This has _beginthread() and _endthread() defined! */
-#endif
 
 typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned,
                                                         unsigned (__stdcall *
@@ -106,21 +104,11 @@
                  pfnSDL_CurrentBeginThread pfnBeginThread,
                  pfnSDL_CurrentEndThread pfnEndThread);
 
-#if defined(_WIN32_WCE)
-
-/**
- *  Create a thread.
- */
-#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, NULL, NULL)
-
-#else
-
 /**
  *  Create a thread.
  */
 #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, _beginthreadex, _endthreadex)
 
-#endif
 #else
 
 /**
--- a/src/SDL.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/SDL.c	Sat Sep 15 10:59:39 2012 -0400
@@ -288,11 +288,7 @@
 #elif __SOLARIS__
     return "Solaris";
 #elif __WIN32__
-#ifdef _WIN32_WCE
-    return "Windows CE";
-#else
     return "Windows";
-#endif
 #elif __IPHONEOS__
     return "iPhone OS";
 #else
--- a/src/audio/SDL_audio.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/audio/SDL_audio.c	Sat Sep 15 10:59:39 2012 -0400
@@ -1028,7 +1028,7 @@
         char name[64];
         SDL_snprintf(name, sizeof (name), "SDLAudioDev%d", (int) (id + 1));
 /* !!! FIXME: this is nasty. */
-#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
+#if defined(__WIN32__) && !defined(HAVE_LIBC)
 #undef SDL_CreateThread
         device->thread = SDL_CreateThread(SDL_RunAudio, name, device, NULL, NULL);
 #else
--- a/src/audio/winmm/SDL_winmm.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/audio/winmm/SDL_winmm.c	Sat Sep 15 10:59:39 2012 -0400
@@ -31,9 +31,6 @@
 #include "SDL_audio.h"
 #include "../SDL_audio_c.h"
 #include "SDL_winmm.h"
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-#include "win_ce_semaphore.h"
-#endif
 
 #define DETECT_DEV_IMPL(typ, capstyp) \
 static void DetectWave##typ##Devs(SDL_AddAudioDevice addfn) { \
@@ -75,11 +72,7 @@
         return;
 
     /* Signal that we have a new buffer of data */
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-    ReleaseSemaphoreCE(this->hidden->audio_sem, 1, NULL);
-#else
     ReleaseSemaphore(this->hidden->audio_sem, 1, NULL);
-#endif
 }
 
 
@@ -95,11 +88,7 @@
         return;
 
     /* Signal that we are done playing a buffer */
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-    ReleaseSemaphoreCE(this->hidden->audio_sem, 1, NULL);
-#else
     ReleaseSemaphore(this->hidden->audio_sem, 1, NULL);
-#endif
 }
 
 static void
@@ -123,11 +112,7 @@
 WINMM_WaitDevice(_THIS)
 {
     /* Wait for an audio chunk to finish */
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-    WaitForSemaphoreCE(this->hidden->audio_sem, INFINITE);
-#else
     WaitForSingleObject(this->hidden->audio_sem, INFINITE);
-#endif
 }
 
 static Uint8 *
@@ -173,11 +158,7 @@
         int i;
 
         if (this->hidden->audio_sem) {
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-            CloseSynchHandle(this->hidden->audio_sem);
-#else
             CloseHandle(this->hidden->audio_sem);
-#endif
             this->hidden->audio_sem = 0;
         }
 
@@ -349,11 +330,7 @@
 
     /* Create the audio buffer semaphore */
     this->hidden->audio_sem =
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-        CreateSemaphoreCE(NULL, NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
-#else
         CreateSemaphore(NULL, NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
-#endif
     if (this->hidden->audio_sem == NULL) {
         WINMM_CloseDevice(this);
         SDL_SetError("Couldn't create semaphore");
--- a/src/file/SDL_rwops.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/file/SDL_rwops.c	Sat Sep 15 10:59:39 2012 -0400
@@ -43,9 +43,6 @@
 #ifdef __WIN32__
 
 /* Functions to read/write Win32 API file pointers */
-/* Will not use it on WinCE because stdio is buffered, it means
-   faster, and all stdio functions anyway are embedded in coredll.dll - 
-   the main wince dll*/
 
 #include "../core/windows/SDL_windows.h"
 
@@ -58,9 +55,7 @@
 static int SDLCALL
 windows_file_open(SDL_RWops * context, const char *filename, const char *mode)
 {
-#ifndef _WIN32_WCE
     UINT old_error_mode;
-#endif
     HANDLE h;
     DWORD r_right, w_right;
     DWORD must_exist, truncate;
@@ -98,16 +93,6 @@
         SDL_OutOfMemory();
         return -1;
     }
-#ifdef _WIN32_WCE
-    {
-        LPTSTR tstr = WIN_UTF8ToString(filename);
-        h = CreateFile(tstr, (w_right | r_right),
-                       (w_right) ? 0 : FILE_SHARE_READ, NULL,
-                       (must_exist | truncate | a_mode),
-                       FILE_ATTRIBUTE_NORMAL, NULL);
-        SDL_free(tstr);
-    }
-#else
     /* Do not open a dialog box if failure */
     old_error_mode =
         SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS);
@@ -123,7 +108,6 @@
 
     /* restore old behavior */
     SetErrorMode(old_error_mode);
-#endif /* _WIN32_WCE */
 
     if (h == INVALID_HANDLE_VALUE) {
         SDL_free(context->hidden.windowsio.buffer.data);
--- a/src/loadso/windows/SDL_sysloadso.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/loadso/windows/SDL_sysloadso.c	Sat Sep 15 10:59:39 2012 -0400
@@ -49,14 +49,7 @@
 void *
 SDL_LoadFunction(void *handle, const char *name)
 {
-#ifdef _WIN32_WCE
-    LPTSTR tstr = WIN_UTF8ToString(name);
-    void *symbol = (void *) GetProcAddress((HMODULE) handle, tstr);
-    SDL_free(tstr);
-#else
     void *symbol = (void *) GetProcAddress((HMODULE) handle, name);
-#endif
-
     if (symbol == NULL) {
         char errbuf[512];
         SDL_strlcpy(errbuf, "Failed loading ", SDL_arraysize(errbuf));
--- a/src/main/windows/SDL_windows_main.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/main/windows/SDL_windows_main.c	Sat Sep 15 10:59:39 2012 -0400
@@ -18,16 +18,9 @@
 #include "SDL_main.h"
 
 #ifdef main
-# ifndef _WIN32_WCE_EMULATION
 #  undef main
-# endif /* _WIN32_WCE_EMULATION */
 #endif /* main */
 
-#if defined(_WIN32_WCE) && _WIN32_WCE < 300
-/* seems to be undefined in Win CE although in online help */
-#define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t'))
-#endif /* _WIN32_WCE < 300 */
-
 static void
 UnEscapeQuotes(char *arg)
 {
@@ -130,7 +123,7 @@
     return FALSE;
 }
 
-#if defined(_MSC_VER) && !defined(_WIN32_WCE)
+#if defined(_MSC_VER)
 /* The VC++ compiler needs main defined */
 #define console_main main
 #endif
@@ -158,28 +151,9 @@
     char **argv;
     int argc;
     char *cmdline;
-#ifdef _WIN32_WCE
-    wchar_t *bufp;
-    int nLen;
-#else
     char *bufp;
     size_t nLen;
-#endif
 
-#ifdef _WIN32_WCE
-    nLen = wcslen(szCmdLine) + 128 + 1;
-    bufp = SDL_stack_alloc(wchar_t, nLen * 2);
-    wcscpy(bufp, TEXT("\""));
-    GetModuleFileName(NULL, bufp + 1, 128 - 3);
-    wcscpy(bufp + wcslen(bufp), TEXT("\" "));
-    wcsncpy(bufp + wcslen(bufp), szCmdLine, nLen - wcslen(bufp));
-    nLen = wcslen(bufp) + 1;
-    cmdline = SDL_stack_alloc(char, nLen);
-    if (cmdline == NULL) {
-        return OutOfMemory();
-    }
-    WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL);
-#else
     /* Grab the command line */
     bufp = GetCommandLine();
     nLen = SDL_strlen(bufp) + 1;
@@ -188,7 +162,6 @@
         return OutOfMemory();
     }
     SDL_strlcpy(cmdline, bufp, nLen);
-#endif
 
     /* Parse it into argv and argc */
     argc = ParseCommandLine(cmdline, NULL);
--- a/src/power/windows/SDL_syspower.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/power/windows/SDL_syspower.c	Sat Sep 15 10:59:39 2012 -0400
@@ -30,19 +30,11 @@
 SDL_bool
 SDL_GetPowerInfo_Windows(SDL_PowerState * state, int *seconds, int *percent)
 {
-#ifdef _WIN32_WCE
-    SYSTEM_POWER_STATUS_EX status;
-#else
     SYSTEM_POWER_STATUS status;
-#endif
     SDL_bool need_details = SDL_FALSE;
 
-    /* This API should exist back to Win95 and Windows CE. */
-#ifdef _WIN32_WCE
-    if (!GetSystemPowerStatusEx(&status, FALSE))
-#else
+    /* This API should exist back to Win95. */
     if (!GetSystemPowerStatus(&status))
-#endif
     {
         /* !!! FIXME: push GetLastError() into SDL_GetError() */
         *state = SDL_POWERSTATE_UNKNOWN;
--- a/src/stdlib/SDL_getenv.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/stdlib/SDL_getenv.c	Sat Sep 15 10:59:39 2012 -0400
@@ -24,7 +24,7 @@
 
 #ifndef HAVE_GETENV
 
-#if defined(__WIN32__) && !defined(_WIN32_WCE)
+#if defined(__WIN32__)
 
 #include "../core/windows/SDL_windows.h"
 
--- a/src/thread/windows/SDL_sysmutex.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/thread/windows/SDL_sysmutex.c	Sat Sep 15 10:59:39 2012 -0400
@@ -44,12 +44,8 @@
     mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
     if (mutex) {
         /* Initialize */
-#ifdef _WIN32_WCE
-        InitializeCriticalSection(&mutex->cs);
-#else
         /* On SMP systems, a non-zero spin count generally helps performance */
         InitializeCriticalSectionAndSpinCount(&mutex->cs, 2000);
-#endif
     } else {
         SDL_OutOfMemory();
     }
--- a/src/thread/windows/SDL_syssem.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/thread/windows/SDL_syssem.c	Sat Sep 15 10:59:39 2012 -0400
@@ -27,18 +27,10 @@
 #include "../../core/windows/SDL_windows.h"
 
 #include "SDL_thread.h"
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-#include "win_ce_semaphore.h"
-#endif
-
 
 struct SDL_semaphore
 {
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-    SYNCHHANDLE id;
-#else
     HANDLE id;
-#endif
     LONG count;
 };
 
@@ -53,11 +45,7 @@
     sem = (SDL_sem *) SDL_malloc(sizeof(*sem));
     if (sem) {
         /* Create the semaphore, with max value 32K */
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-        sem->id = CreateSemaphoreCE(NULL, initial_value, 32 * 1024, NULL);
-#else
         sem->id = CreateSemaphore(NULL, initial_value, 32 * 1024, NULL);
-#endif
         sem->count = initial_value;
         if (!sem->id) {
             SDL_SetError("Couldn't create semaphore");
@@ -76,11 +64,7 @@
 {
     if (sem) {
         if (sem->id) {
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-            CloseSynchHandle(sem->id);
-#else
             CloseHandle(sem->id);
-#endif
             sem->id = 0;
         }
         SDL_free(sem);
@@ -103,11 +87,7 @@
     } else {
         dwMilliseconds = (DWORD) timeout;
     }
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-    switch (WaitForSemaphoreCE(sem->id, dwMilliseconds)) {
-#else
     switch (WaitForSingleObject(sem->id, dwMilliseconds)) {
-#endif
     case WAIT_OBJECT_0:
         InterlockedDecrement(&sem->count);
         retval = 0;
@@ -159,11 +139,7 @@
      * is waiting for this semaphore.
      */
     InterlockedIncrement(&sem->count);
-#if defined(_WIN32_WCE) && (_WIN32_WCE < 300)
-    if (ReleaseSemaphoreCE(sem->id, 1, NULL) == FALSE) {
-#else
     if (ReleaseSemaphore(sem->id, 1, NULL) == FALSE) {
-#endif
         InterlockedDecrement(&sem->count);      /* restore */
         SDL_SetError("ReleaseSemaphore() failed");
         return -1;
--- a/src/thread/windows/SDL_systhread.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/thread/windows/SDL_systhread.c	Sat Sep 15 10:59:39 2012 -0400
@@ -30,10 +30,8 @@
 #include "SDL_systhread_c.h"
 
 #ifndef SDL_PASSED_BEGINTHREAD_ENDTHREAD
-#ifndef _WIN32_WCE
 /* We'll use the C library from this DLL */
 #include <process.h>
-#endif
 
 /* Cygwin gcc-3 ... MingW64 (even with a i386 host) does this like MSVC. */
 #if (defined(__MINGW32__) && (__GNUC__ < 4))
@@ -112,13 +110,8 @@
 int
 SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
 {
-#ifdef _WIN32_WCE
-    pfnSDL_CurrentBeginThread pfnBeginThread = NULL;
-    pfnSDL_CurrentEndThread pfnEndThread = NULL;
-#else
     pfnSDL_CurrentBeginThread pfnBeginThread = _beginthreadex;
     pfnSDL_CurrentEndThread pfnEndThread = _endthreadex;
-#endif
 #endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */
     pThreadStartParms pThreadParms =
         (pThreadStartParms) SDL_malloc(sizeof(tThreadStartParms));
--- a/src/thread/windows/win_ce_semaphore.c	Fri Sep 14 18:18:38 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,233 +0,0 @@
-/* win_ce_semaphore.c
-
-   Copyright (c) 1998, Johnson M. Hart
-   (with corrections 2001 by Rainer Loritz)
-   Permission is granted for any and all use providing that this
-   copyright is properly acknowledged.
-   There are no assurances of suitability for any use whatsoever.
-
-   WINDOWS CE: There is a collection of Windows CE functions to simulate
-   semaphores using only a mutex and an event. As Windows CE events cannot
-   be named, these simulated semaphores cannot be named either.
-
-   Implementation notes:
-   1. All required internal data structures are allocated on the process's heap.
-   2. Where appropriate, a new error code is returned (see the header
-      file), or, if the error is a Win32 error, that code is unchanged.
-   3. Notice the new handle type "SYNCHHANDLE" that has handles, counters,
-      and other information. This structure will grow as new objects are added
-      to this set; some members are specific to only one or two of the objects.
-   4. Mutexes are used for critical sections. These could be replaced with
-      CRITICAL_SECTION objects but then this would give up the time out
-      capability.
-   5. The implementation shows several interesting aspects of synchronization, some
-      of which are specific to Win32 and some of which are general. These are pointed
-      out in the comments as appropriate.
-   6. The wait function emulates WaitForSingleObject only. An emulation of
-      WaitForMultipleObjects is much harder to implement outside the kernel,
-      and it is not clear how to handle a mixture of WCE semaphores and normal
-      events and mutexes.
-*/
-#include "SDL_config.h"
-
-#if SDL_THREAD_WINDOWS
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "win_ce_semaphore.h"
-
-static SYNCHHANDLE CleanUp(SYNCHHANDLE hSynch, DWORD Flags);
-
-SYNCHHANDLE
-CreateSemaphoreCE(LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,  /* pointer to security attributes */
-                  LONG lInitialCount,   /* initial count */
-                  LONG lMaximumCount,   /* maximum count */
-                  LPCTSTR lpName)
-/* Semaphore for use with Windows CE that does not support them directly.
-   Requires a counter, a mutex to protect the counter, and an
-   autoreset event.
-
-   Here are the rules that must always hold between the autoreset event
-   and the mutex (any violation of these rules by the CE semaphore functions
-   will, in all likelihood, result in a defect):
-    1. No thread can set, pulse, or reset the event,
-       nor can it access any part of the SYNCHHANDLE structure,
-       without first gaining ownership of the mutex.
-       BUT, a thread can wait on the event without owning the mutex
-       (this is clearly necessary or else the event could never be set).
-    2. The event is in a signaled state if and only if the current semaphore
-       count ("CurCount") is greater than zero.
-    3. The semaphore count is always >= 0 and <= the maximum count */
-{
-    SYNCHHANDLE hSynch = NULL, result = NULL;
-
-    __try {
-        if (lInitialCount > lMaximumCount || lMaximumCount < 0
-            || lInitialCount < 0) {
-            /* Bad parameters */
-            SetLastError(SYNCH_ERROR);
-            __leave;
-        }
-
-        hSynch =
-            HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SYNCH_HANDLE_SIZE);
-        if (hSynch == NULL)
-            __leave;
-
-        hSynch->MaxCount = lMaximumCount;
-        hSynch->CurCount = lInitialCount;
-        hSynch->lpName = lpName;
-
-        hSynch->hMutex = CreateMutex(lpSemaphoreAttributes, FALSE, NULL);
-
-        WaitForSingleObject(hSynch->hMutex, INFINITE);
-        /*  Create the event. It is initially signaled if and only if the
-           initial count is > 0 */
-        hSynch->hEvent = CreateEvent(lpSemaphoreAttributes, FALSE,
-                                     lInitialCount > 0, NULL);
-        ReleaseMutex(hSynch->hMutex);
-        hSynch->hSemph = NULL;
-    }
-    __finally {
-        /* Return with the handle, or, if there was any error, return
-           a null after closing any open handles and freeing any allocated memory. */
-        result =
-            CleanUp(hSynch, 6 /* An event and a mutex, but no semaphore. */ );
-    }
-
-    return result;
-}
-
-BOOL
-ReleaseSemaphoreCE(SYNCHHANDLE hSemCE, LONG cReleaseCount,
-                   LPLONG lpPreviousCount)
-/* Windows CE equivalent to ReleaseSemaphore. */
-{
-    BOOL Result = TRUE;
-
-    /* Gain access to the object to assure that the release count
-       would not cause the total count to exceed the maximum. */
-
-    __try {
-        WaitForSingleObject(hSemCE->hMutex, INFINITE);
-        /* reply only if asked to */
-        if (lpPreviousCount != NULL)
-            *lpPreviousCount = hSemCE->CurCount;
-        if (hSemCE->CurCount + cReleaseCount > hSemCE->MaxCount
-            || cReleaseCount <= 0) {
-            SetLastError(SYNCH_ERROR);
-            Result = FALSE;
-            __leave;
-        }
-        hSemCE->CurCount += cReleaseCount;
-
-        /*  Set the autoreset event, releasing exactly one waiting thread, now or
-           in the future.  */
-
-        SetEvent(hSemCE->hEvent);
-    }
-    __finally {
-        ReleaseMutex(hSemCE->hMutex);
-    }
-
-    return Result;
-}
-
-DWORD
-WaitForSemaphoreCE(SYNCHHANDLE hSemCE, DWORD dwMilliseconds)
-   /* Windows CE semaphore equivalent of WaitForSingleObject. */
-{
-    DWORD WaitResult;
-
-    WaitResult = WaitForSingleObject(hSemCE->hMutex, dwMilliseconds);
-    if (WaitResult != WAIT_OBJECT_0 && WaitResult != WAIT_ABANDONED_0)
-        return WaitResult;
-    while (hSemCE->CurCount <= 0) {
-
-        /* The count is 0, and the thread must wait on the event (which, by
-           the rules, is currently reset) for semaphore resources to become
-           available. First, of course, the mutex must be released so that another
-           thread will be capable of setting the event. */
-
-        ReleaseMutex(hSemCE->hMutex);
-
-        /*  Wait for the event to be signaled, indicating a semaphore state change.
-           The event is autoreset and signaled with a SetEvent (not PulseEvent)
-           so exactly one waiting thread (whether or not there is currently
-           a waiting thread) is released as a result of the SetEvent. */
-
-        WaitResult = WaitForSingleObject(hSemCE->hEvent, dwMilliseconds);
-        if (WaitResult != WAIT_OBJECT_0)
-            return WaitResult;
-
-        /*  This is where the properties of setting of an autoreset event is critical
-           to assure that, even if the semaphore state changes between the
-           preceding Wait and the next, and even if NO threads are waiting
-           on the event at the time of the SetEvent, at least one thread
-           will be released. 
-           Pulsing a manual reset event would appear to work, but it would have
-           a defect which could appear if the semaphore state changed between
-           the two waits. */
-
-        WaitResult = WaitForSingleObject(hSemCE->hMutex, dwMilliseconds);
-        if (WaitResult != WAIT_OBJECT_0 && WaitResult != WAIT_ABANDONED_0)
-            return WaitResult;
-
-    }
-    /* The count is not zero and this thread owns the mutex.  */
-
-    hSemCE->CurCount--;
-    /* The event is now unsignaled, BUT, the semaphore count may not be
-       zero, in which case the event should be signaled again
-       before releasing the mutex. */
-
-    if (hSemCE->CurCount > 0)
-        SetEvent(hSemCE->hEvent);
-    ReleaseMutex(hSemCE->hMutex);
-    return WaitResult;
-}
-
-BOOL
-CloseSynchHandle(SYNCHHANDLE hSynch)
-/* Close a synchronization handle. 
-   Improvement: Test for a valid handle before dereferencing the handle. */
-{
-    BOOL Result = TRUE;
-    if (hSynch->hEvent != NULL)
-        Result = Result && CloseHandle(hSynch->hEvent);
-    if (hSynch->hMutex != NULL)
-        Result = Result && CloseHandle(hSynch->hMutex);
-    if (hSynch->hSemph != NULL)
-        Result = Result && CloseHandle(hSynch->hSemph);
-    HeapFree(GetProcessHeap(), 0, hSynch);
-    return (Result);
-}
-
-static SYNCHHANDLE
-CleanUp(SYNCHHANDLE hSynch, DWORD Flags)
-{                               /* Prepare to return from a create of a synchronization handle.
-                                   If there was any failure, free any allocated resources.
-                                   "Flags" indicates which Win32 objects are required in the 
-                                   synchronization handle. */
-
-    BOOL ok = TRUE;
-
-    if (hSynch == NULL)
-        return NULL;
-    if ((Flags & 4) == 1 && (hSynch->hEvent == NULL))
-        ok = FALSE;
-    if ((Flags & 2) == 1 && (hSynch->hMutex == NULL))
-        ok = FALSE;
-    if ((Flags & 1) == 1 && (hSynch->hEvent == NULL))
-        ok = FALSE;
-    if (!ok) {
-        CloseSynchHandle(hSynch);
-        return NULL;
-    }
-    /* Everything worked */
-    return hSynch;
-}
-
-#endif /* SDL_THREAD_WINDOWS */
-
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/thread/windows/win_ce_semaphore.h	Fri Sep 14 18:18:38 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/* win_ce_semaphore.h - header file to go with win_ce_semaphore.c */
-
-typedef struct _SYNCH_HANDLE_STRUCTURE
-{
-    HANDLE hEvent;
-    HANDLE hMutex;
-    HANDLE hSemph;
-    LONG MaxCount;
-    volatile LONG CurCount;
-    LPCTSTR lpName;
-} SYNCH_HANDLE_STRUCTURE, *SYNCHHANDLE;
-
-#define SYNCH_HANDLE_SIZE sizeof (SYNCH_HANDLE_STRUCTURE)
-
-        /* Error codes - all must have bit 29 set */
-#define SYNCH_ERROR 0X20000000  /* EXERCISE - REFINE THE ERROR NUMBERS */
-
-extern SYNCHHANDLE CreateSemaphoreCE(LPSECURITY_ATTRIBUTES, LONG, LONG,
-                                     LPCTSTR);
-
-extern BOOL ReleaseSemaphoreCE(SYNCHHANDLE, LONG, LPLONG);
-extern DWORD WaitForSemaphoreCE(SYNCHHANDLE, DWORD);
-
-extern BOOL CloseSynchHandle(SYNCHHANDLE);
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/timer/SDL_timer.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/timer/SDL_timer.c	Sat Sep 15 10:59:39 2012 -0400
@@ -223,7 +223,7 @@
 
         data->active = SDL_TRUE;
         /* !!! FIXME: this is nasty. */
-#if (defined(__WIN32__) && !defined(_WIN32_WCE)) && !defined(HAVE_LIBC)
+#if defined(__WIN32__) && !defined(HAVE_LIBC)
 #undef SDL_CreateThread
         data->thread = SDL_CreateThread(SDL_TimerThread, name, data, NULL, NULL);
 #else
--- a/src/timer/wince/SDL_systimer.c	Fri Sep 14 18:18:38 2012 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,110 +0,0 @@
-/*
-  Simple DirectMedia Layer
-  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-*/
-#include "SDL_config.h"
-
-#ifdef SDL_TIMER_WINCE
-
-#include "../../core/windows/SDL_windows.h"
-
-#include "SDL_timer.h"
-
-static Uint64 start_date;
-static Uint64 start_ticks;
-
-static Uint64
-wce_ticks(void)
-{
-    return ((Uint64) GetTickCount());
-}
-
-static Uint64
-wce_date(void)
-{
-    union
-    {
-        FILETIME ftime;
-        Uint64 itime;
-    } ftime;
-    SYSTEMTIME stime;
-
-    GetSystemTime(&stime);
-    SystemTimeToFileTime(&stime, &ftime.ftime);
-    ftime.itime /= 10000;       // Convert 100ns intervals to 1ms intervals
-    // Remove ms portion, which can't be relied on
-    ftime.itime -= (ftime.itime % 1000);
-    return (ftime.itime);
-}
-
-static Sint32
-wce_rel_ticks(void)
-{
-    return ((Sint32) (wce_ticks() - start_ticks));
-}
-
-static Sint32
-wce_rel_date(void)
-{
-    return ((Sint32) (wce_date() - start_date));
-}
-
-/* Recard start-time of application for reference */
-void
-SDL_StartTicks(void)
-{
-    start_date = wce_date();
-    start_ticks = wce_ticks();
-}
-
-/* Return time in ms relative to when SDL was started */
-Uint32
-SDL_GetTicks()
-{
-    Sint32 offset = wce_rel_date() - wce_rel_ticks();
-    if ((offset < -1000) || (offset > 1000)) {
-//    fprintf(stderr,"Time desync(%+d), resyncing\n",offset/1000);
-        start_ticks -= offset;
-    }
-
-    return ((Uint32) wce_rel_ticks());
-}
-
-Uint64
-SDL_GetPerformanceCounter(void)
-{
-    return SDL_GetTicks();
-}
-
-Uint64
-SDL_GetPerformanceFrequency(void)
-{
-    return 1000;
-}
-
-/* Give up approx. givem milliseconds to the OS. */
-void
-SDL_Delay(Uint32 ms)
-{
-    Sleep(ms);
-}
-
-#endif /* SDL_TIMER_WINCE */
-
-/* vi: set ts=4 sw=4 expandtab: */
--- a/src/timer/windows/SDL_systimer.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/timer/windows/SDL_systimer.c	Sat Sep 15 10:59:39 2012 -0400
@@ -27,10 +27,6 @@
 
 #include "SDL_timer.h"
 
-#ifdef _WIN32_WCE
-#error This is WinCE. Please use src/timer/wince/SDL_systimer.c instead.
-#endif
-
 #define TIME_WRAP_VALUE	(~(DWORD)0)
 
 /* The first (low-resolution) ticks value of the application */
--- a/src/video/SDL_stretch.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/SDL_stretch.c	Sat Sep 15 10:59:39 2012 -0400
@@ -33,7 +33,7 @@
    into the general blitting mechanism.
 */
 
-#if ((defined(_MFC_VER) && defined(_M_IX86)/* && !defined(_WIN32_WCE) still needed? */) || \
+#if ((defined(_MFC_VER) && defined(_M_IX86)) || \
      defined(__WATCOMC__) || \
      (defined(__GNUC__) && defined(__i386__))) && SDL_ASSEMBLY_ROUTINES
 /* There's a bug with gcc 4.4.1 and -O2 where srcp doesn't get the correct
--- a/src/video/windows/SDL_windowsclipboard.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowsclipboard.c	Sat Sep 15 10:59:39 2012 -0400
@@ -92,11 +92,7 @@
                 WIN_SetError("Couldn't set clipboard data");
                 result = -1;
             }
-#ifdef _WIN32_WCE
-            data->clipboard_count = 0;
-#else
             data->clipboard_count = GetClipboardSequenceNumber();
-#endif
         }
         SDL_free(tstr);
 
@@ -150,13 +146,7 @@
 void
 WIN_CheckClipboardUpdate(struct SDL_VideoData * data)
 {
-    DWORD count;
-
-#ifdef _WIN32_WCE
-    count = 0;
-#else
-    count = GetClipboardSequenceNumber();
-#endif
+    const DWORD count = GetClipboardSequenceNumber();
     if (count != data->clipboard_count) {
         if (data->clipboard_count) {
             SDL_SendClipboardUpdate();
--- a/src/video/windows/SDL_windowsevents.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowsevents.c	Sat Sep 15 10:59:39 2012 -0400
@@ -164,12 +164,10 @@
                 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_SHOWN, 0, 0);
                 SDL_SendWindowEvent(data->window,
                                     SDL_WINDOWEVENT_RESTORED, 0, 0);
-#ifndef _WIN32_WCE              /* WinCE misses IsZoomed() */
                 if (IsZoomed(hwnd)) {
                     SDL_SendWindowEvent(data->window,
                                         SDL_WINDOWEVENT_MAXIMIZED, 0, 0);
                 }
-#endif
                 if (SDL_GetKeyboardFocus() != data->window) {
                     SDL_SetKeyboardFocus(data->window);
                 }
@@ -211,20 +209,6 @@
 	case WM_MOUSEMOVE:
 		if(SDL_GetMouse()->relative_mode)
 			break;
-#ifdef _WIN32_WCE
-        /* transform coords for VGA, WVGA... */
-        {
-            SDL_VideoData *videodata = data->videodata;
-            if(videodata->CoordTransform) {
-                POINT pt;
-                pt.x = LOWORD(lParam);
-                pt.y = HIWORD(lParam);
-                videodata->CoordTransform(data->window, &pt);
-                SDL_SendMouseMotion(data->window, 0, pt.x, pt.y);
-                break;
-            }
-        }
-#endif
         SDL_SendMouseMotion(data->window, 0, LOWORD(lParam), HIWORD(lParam));
         break;
 
@@ -463,16 +447,12 @@
 
 
             style = GetWindowLong(hwnd, GWL_STYLE);
-#ifdef _WIN32_WCE
-            menu = FALSE;
-#else
             /* DJM - according to the docs for GetMenu(), the
                return value is undefined if hwnd is a child window.
                Aparently it's too difficult for MS to check
                inside their function, so I have to do it here.
              */
             menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
-#endif
             AdjustWindowRectEx(&size, style, menu, 0);
             w = size.right - size.left;
             h = size.bottom - size.top;
--- a/src/video/windows/SDL_windowsframebuffer.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowsframebuffer.c	Sat Sep 15 10:59:39 2012 -0400
@@ -24,18 +24,12 @@
 
 #include "SDL_windowsvideo.h"
 
-#ifndef _WIN32_WCE
-#define HAVE_GETDIBITS
-#endif
-
 int WIN_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
 {
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     size_t size;
     LPBITMAPINFO info;
-#ifdef HAVE_GETDIBITS
     HBITMAP hbm;
-#endif
 
     /* Free the old framebuffer surface */
     if (data->mdc) {
@@ -49,7 +43,6 @@
     size = sizeof(BITMAPINFOHEADER) + 256 * sizeof (RGBQUAD);
     info = (LPBITMAPINFO)SDL_stack_alloc(Uint8, size);
 
-#ifdef HAVE_GETDIBITS
     SDL_memset(info, 0, size);
     info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
 
@@ -69,7 +62,6 @@
         *format = SDL_MasksToPixelFormatEnum(bpp, masks[0], masks[1], masks[2], 0);
     }
     if (*format == SDL_PIXELFORMAT_UNKNOWN)
-#endif
     {
         /* We'll use RGB format for now */
         *format = SDL_PIXELFORMAT_RGB888;
--- a/src/video/windows/SDL_windowskeyboard.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowskeyboard.c	Sat Sep 15 10:59:39 2012 -0400
@@ -22,10 +22,6 @@
 
 #if SDL_VIDEO_DRIVER_WINDOWS
 
-#ifdef _WIN32_WCE
-#define SDL_DISABLE_WINDOWS_IME
-#endif
-
 #include "SDL_windowsvideo.h"
 
 #include "../../events/SDL_keyboard_c.h"
--- a/src/video/windows/SDL_windowsmodes.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowsmodes.c	Sat Sep 15 10:59:39 2012 -0400
@@ -34,9 +34,7 @@
 {
     SDL_DisplayModeData *data;
     DEVMODE devmode;
-#ifndef _WIN32_WCE
     HDC hdc;
-#endif
 
     devmode.dmSize = sizeof(devmode);
     devmode.dmDriverExtra = 0;
@@ -59,17 +57,7 @@
     mode->h = devmode.dmPelsHeight;
     mode->refresh_rate = devmode.dmDisplayFrequency;
     mode->driverdata = data;
-#ifdef _WIN32_WCE
-    /* In WinCE EnumDisplaySettings(ENUM_CURRENT_SETTINGS) doesn't take the user defined orientation
-       into account but GetSystemMetrics does. */
-    if (index == ENUM_CURRENT_SETTINGS) {
-        mode->w = GetSystemMetrics(SM_CXSCREEN);
-        mode->h = GetSystemMetrics(SM_CYSCREEN);
-    }
-#endif
 
-/* WinCE has no GetDIBits, therefore we can't use it to get the display format */
-#ifndef _WIN32_WCE
     if (index == ENUM_CURRENT_SETTINGS
         && (hdc = CreateDC(deviceName, NULL, NULL, NULL)) != NULL) {
         char bmi_data[sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD)];
@@ -105,9 +93,7 @@
         } else if (bmi->bmiHeader.biBitCount == 4) {
             mode->format = SDL_PIXELFORMAT_INDEX4LSB;
         }
-    } else
-#endif /* _WIN32_WCE */
-    {
+    } else {
         /* FIXME: Can we tell what this will be? */
         if ((devmode.dmFields & DM_BITSPERPEL) == DM_BITSPERPEL) {
             switch (devmode.dmBitsPerPel) {
@@ -233,18 +219,11 @@
 {
     SDL_DisplayModeData *data = (SDL_DisplayModeData *) display->current_mode.driverdata;
 
-#ifdef _WIN32_WCE
-    // WINCE: DEVMODE.dmPosition not found, or may be mingw32ce bug
-    rect->x = 0;
-    rect->y = 0;
-    rect->w = _this->windows->w;
-    rect->h = _this->windows->h;
-#else
     rect->x = (int)data->DeviceMode.dmPosition.x;
     rect->y = (int)data->DeviceMode.dmPosition.y;
     rect->w = data->DeviceMode.dmPelsWidth;
     rect->h = data->DeviceMode.dmPelsHeight;
-#endif
+
     return 0;
 }
 
@@ -278,14 +257,6 @@
     SDL_DisplayModeData *data = (SDL_DisplayModeData *) mode->driverdata;
     LONG status;
 
-#ifdef _WIN32_WCE
-    /* TODO: implement correctly.
-       On my Asus MyPAL, if I execute the code below
-       I get DISP_CHANGE_BADFLAGS and the Titlebar of the fullscreen window stays
-       visible ... (SDL_RaiseWindow() would fix that one) */
-    return 0;
-#endif
-
     status =
         ChangeDisplaySettingsEx(displaydata->DeviceName, &data->DeviceMode,
                                 NULL, CDS_FULLSCREEN, NULL);
--- a/src/video/windows/SDL_windowsvideo.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowsvideo.c	Sat Sep 15 10:59:39 2012 -0400
@@ -51,11 +51,6 @@
     SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
 
     SDL_UnregisterApp();
-#ifdef _WIN32_WCE
-    if(data->hAygShell) {
-       SDL_UnloadObject(data->hAygShell);
-    }
-#endif
 	if (data->userDLL) {
 		SDL_UnloadObject(data->userDLL);
 	}
@@ -88,15 +83,6 @@
     }
     device->driverdata = data;
 
-#ifdef _WIN32_WCE
-    data->hAygShell = SDL_LoadObject("\\windows\\aygshell.dll");
-    if(0 == data->hAygShell)
-        data->hAygShell = SDL_LoadObject("aygshell.dll");
-    data->SHFullScreen = (0 != data->hAygShell ?
-        (PFNSHFullScreen) SDL_LoadFunction(data->hAygShell, "SHFullScreen") : 0);
-    data->CoordTransform = NULL;
-#endif
-
 	data->userDLL = SDL_LoadObject("USER32.DLL");
 	if (data->userDLL) {
 		data->CloseTouchInputHandle = (BOOL (WINAPI *)( HTOUCHINPUT )) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle");
--- a/src/video/windows/SDL_windowsvideo.h	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowsvideo.h	Sat Sep 15 10:59:39 2012 -0400
@@ -27,7 +27,7 @@
 
 #include "../../core/windows/SDL_windows.h"
 
-#if defined(_MSC_VER) && !defined(_WIN32_WCE)
+#if defined(_MSC_VER)
 #include <msctf.h>
 #else
 #include "SDL_msctf.h"
@@ -115,12 +115,6 @@
 {
     int render;
 
-#ifdef _WIN32_WCE
-    void* hAygShell;
-    PFNSHFullScreen SHFullScreen;
-    PFCoordTransform CoordTransform;
-#endif
-
     const SDL_Scancode *key_layout;
 	DWORD clipboard_count;
 
--- a/src/video/windows/SDL_windowswindow.c	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowswindow.c	Sat Sep 15 10:59:39 2012 -0400
@@ -324,10 +324,7 @@
         }
         SDL_FreeSurface(surface);
 
-/* TODO: create the icon in WinCE (CreateIconFromResource isn't available) */
-#ifndef _WIN32_WCE
         hicon = CreateIconFromResource(icon_bmp, icon_len, TRUE, 0x00030000);
-#endif
     }
     SDL_RWclose(dst);
     SDL_stack_free(icon_bmp);
@@ -361,11 +358,7 @@
     rect.top = 0;
     rect.right = window->w;
     rect.bottom = window->h;
-#ifdef _WIN32_WCE
-    menu = FALSE;
-#else
     menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
-#endif
     AdjustWindowRectEx(&rect, style, menu, 0);
     w = (rect.right - rect.left);
     h = (rect.bottom - rect.top);
@@ -387,56 +380,18 @@
     WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE);
 }
 
-#ifdef _WIN32_WCE
-void WINCE_ShowWindow(_THIS, SDL_Window* window, int visible)
-{
-    SDL_WindowData* windowdata = (SDL_WindowData*) window->driverdata;
-    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-
-    if(visible) {
-        if(window->flags & SDL_WINDOW_FULLSCREEN) {
-            if(videodata->SHFullScreen)
-                videodata->SHFullScreen(windowdata->hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
-
-            ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_HIDE);
-        }
-
-        ShowWindow(windowdata->hwnd, SW_SHOW);
-        SetForegroundWindow(windowdata->hwnd);
-    } else {
-        ShowWindow(windowdata->hwnd, SW_HIDE);
-
-        if(window->flags & SDL_WINDOW_FULLSCREEN) {
-            if(videodata->SHFullScreen)
-                videodata->SHFullScreen(windowdata->hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
-
-            ShowWindow(FindWindow(TEXT("HHTaskBar"), NULL), SW_SHOW);
-
-        }
-    }
-}
-#endif /* _WIN32_WCE */
-
 void
 WIN_ShowWindow(_THIS, SDL_Window * window)
 {
-#ifdef _WIN32_WCE
-    WINCE_ShowWindow(_this, window, 1);
-#else
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
     ShowWindow(hwnd, SW_SHOW);
-#endif
 }
 
 void
 WIN_HideWindow(_THIS, SDL_Window * window)
 {
-#ifdef _WIN32_WCE
-    WINCE_ShowWindow(_this, window, 0);
-#else
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
     ShowWindow(hwnd, SW_HIDE);
-#endif
 }
 
 void
@@ -457,14 +412,6 @@
 WIN_MaximizeWindow(_THIS, SDL_Window * window)
 {
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-
-#ifdef _WIN32_WCE
-    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) {
-        SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-        videodata->SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON);
-    }
-#endif
-
     ShowWindow(hwnd, SW_MAXIMIZE);
 }
 
@@ -472,15 +419,7 @@
 WIN_MinimizeWindow(_THIS, SDL_Window * window)
 {
     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
-
     ShowWindow(hwnd, SW_MINIMIZE);
-
-#ifdef _WIN32_WCE
-    if((window->flags & SDL_WINDOW_FULLSCREEN) && videodata->SHFullScreen) {
-        SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
-        videodata->SHFullScreen(hwnd, SHFS_SHOWTASKBAR | SHFS_SHOWSTARTICON | SHFS_SHOWSIPBUTTON);
-    }
-#endif
 }
 
 void
@@ -543,11 +482,7 @@
         rect.top = 0;
         rect.right = window->windowed.w;
         rect.bottom = window->windowed.h;
-#ifdef _WIN32_WCE
-        menu = FALSE;
-#else
         menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
-#endif
         AdjustWindowRectEx(&rect, style, menu, 0);
         w = (rect.right - rect.left);
         h = (rect.bottom - rect.top);
@@ -561,10 +496,6 @@
 int
 WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
 {
-#ifdef _WIN32_WCE
-    SDL_Unsupported();
-    return -1;
-#else
     SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
     SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
     HDC hdc;
@@ -579,16 +510,11 @@
         DeleteDC(hdc);
     }
     return succeeded ? 0 : -1;
-#endif
 }
 
 int
 WIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp)
 {
-#ifdef _WIN32_WCE
-    SDL_Unsupported();
-    return -1;
-#else
     SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
     SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
     HDC hdc;
@@ -603,7 +529,6 @@
         DeleteDC(hdc);
     }
     return succeeded ? 0 : -1;
-#endif
 }
 
 void
@@ -629,9 +554,6 @@
     SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
 
     if (data) {
-#ifdef _WIN32_WCE
-        WINCE_ShowWindow(_this, window, 0);
-#endif
         ReleaseDC(data->hwnd, data->hdc);
         if (data->created) {
             DestroyWindow(data->hwnd);
@@ -675,7 +597,6 @@
 {
     HINSTANCE hInstance = GetModuleHandle(NULL);
     WNDCLASS wce;
-    HWND hWndParent = NULL;
 
     /* Make sure window isn't created twice. */
     if (SDL_HelperWindow != NULL) {
@@ -695,17 +616,12 @@
         return -1;
     }
 
-#ifndef _WIN32_WCE
-    /* WinCE doesn't have HWND_MESSAGE */
-    hWndParent = HWND_MESSAGE;
-#endif
-
     /* Create the window. */
     SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
                                       SDL_HelperWindowName,
                                       WS_OVERLAPPED, CW_USEDEFAULT,
                                       CW_USEDEFAULT, CW_USEDEFAULT,
-                                      CW_USEDEFAULT, hWndParent, NULL,
+                                      CW_USEDEFAULT, HWND_MESSAGE, NULL,
                                       hInstance, NULL);
     if (SDL_HelperWindow == NULL) {
         UnregisterClass(SDL_HelperWindowClassName, hInstance);
--- a/src/video/windows/SDL_windowswindow.h	Fri Sep 14 18:18:38 2012 -0400
+++ b/src/video/windows/SDL_windowswindow.h	Sat Sep 15 10:59:39 2012 -0400
@@ -23,15 +23,6 @@
 #ifndef _SDL_windowswindow_h
 #define _SDL_windowswindow_h
 
-#ifdef _WIN32_WCE
-#define SHFS_SHOWTASKBAR        0x0001
-#define SHFS_HIDETASKBAR        0x0002
-#define SHFS_SHOWSIPBUTTON      0x0004
-#define SHFS_HIDESIPBUTTON      0x0008
-#define SHFS_SHOWSTARTICON      0x0010
-#define SHFS_HIDESTARTICON      0x0020
-#endif
-
 typedef struct
 {
     SDL_Window *window;