Move SDL2 compatibility shims to a separate file
Fix compile