sdl: fix compilation on 10.6

Closes #31112.