Fixed const correctness issue with C++, and fixed building SDL_memcpy4 with 32-bit gcc.
Fixed XIM crash when locale is set to something not supported by X11.
Fixed more const issues with C++
Merge remote-tracking branch 'upstream/master' into SDL2-for-PSP