Apply WIN32_LEAN_AND_MEAN redefine fix to SDL_syswm.h too.

This is related to 7a261af2d612, which fixes bug 2508.
The YUV offset is 16 / 255, not 16 / 256
add a comment to SDL_InitSubSystem explaining its refcounting behavior
Maybe fixes bug #2291 (red tinted screen on some Samsung Android devices)

Then again, maybe not!
Split the XInput and DirectInput code so Windows RT can use the existing XInput support.

--HG--
rename : src/audio/directsound/directx.h => src/core/windows/SDL_directx.h
rename : src/haptic/windows/SDL_syshaptic.c => src/haptic/windows/SDL_windowshaptic.c
rename : src/haptic/windows/SDL_syshaptic_c.h => src/haptic/windows/SDL_windowshaptic_c.h
rename : src/joystick/windows/SDL_dxjoystick.c => src/joystick/windows/SDL_dinputjoystick.c
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_dinputjoystick_c.h
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_windowsjoystick_c.h
Made the latest XInput + Haptic changes compile and run on WinRT

Notes:
- Support for the 'Guide' button does not seem to be possible, as
  XInputGetStateEx is not available on WinRT.
- Haptic support appears to be working on WinRT now!
- SDL/WinRT does not allow calls to LoadLibrary or LoadLibraryEx.  The calls
  to those were removed by this change, but only when compiling for WinRT.
  Non-WinRT Windows will continue to detect and load XInput via LoadLibrary and
  GetProcAddress calls.
Fixed haptic refcount bug (thanks David Ludwig!)
Fix option for forced run of disabled tests in test harness
Fixed mingw64 build and warnings
Call dbus_shutdown to make valgrind happy.
Fixed bug 2629 - Mac: crash when calling SDL_DestroyWindow with an active OpenGL context

Alex Szpakowski

Since this commit https://hg.libsdl.org/SDL/rev/1519c462cee6 , calling SDL_DestroyWindow will crash the program if the window has an active OpenGL context.

This is because the Cocoa_DestroyWindow code sets the window's driverdata to NULL and then calls [context setWindow:NULL], which tries to access the window's driverdata, resulting in a null pointer dereference.

I have attached a patch which fixes the issue by moving the line which sets the driverdata to NULL to after the lines which call functions that use the driverdata pointer.
2620 solaris port missing atomics if not using gcc
Fixed compiler warning on Mac OS X
Fixed compiler warning
Fixed bug 2626 - iOS: fix test and template Xcode projects and build scripts to link with CoreMotion

Alex Szpakowski

Now that SDL on iOS requires CoreMotion to be linked, some of the Xcode projects included with the SDL source (such as the iOS tests and the iOS app template) as well as the premake and automake scripts need to be updated.

I've attached a patch which does so. It also fixes the SDL Xcode project to build for 64-bit ARM as well as armv7 by default (or whatever the default ARM targets are for the Xcode version used), which is what the iOS app template expects.
Fixed compiler warnings on iOS
Fixed indentation for pnacl configuration
SDL_SYS_IsXInputGamepad_DeviceIndex() is only available if SDL_JOYSTICK_XINPUT is true.
Fixed bug 2631 - Mac: minor code cleanup

Alex Szpakowski

Some minor changes to the Mac-specific backend code:

- Fixed up some code style issues (mostly brace style inconsistencies).

- Fixed a compiler warning in SDL_cocoaevents.m.

- Removed some useless code now that the 10.7 SDK is required to build SDL.

- Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
Removed useless assert