libsdl-org/sdl12-compat

Compilation failed on SDL2 < 2.0.10

farox1 opened this issue · 1 comments

farox1 commented

Hello
I want to test this library and try to build on a Linux Box (Mint 19.3) that have SDL2 at version 2.0.8, but it fails with

sdl12-compat-main/src/SDL12_compat.c:2048:8: error: unknown type name ‘SDL_PixelFormatEnum’
static SDL_PixelFormatEnum
Searching the web i found that SDL_PixelFormatEnum has been introduced in SDL 2.0.10.

Following this repo https://github.com/Genymobile/scrcpy/pull/2781 have added the same here and compilation gone ok, but don't know if its ok.

I'll report here the few lines of code:

#if !SDL_VERSION_ATLEAST(2, 0, 10)
// SDL_PixelFormatEnum has been introduced in SDL 2.0.10. Use int for older SDL
// versions.
typedef int SDL_PixelFormatEnum;
#endif

I put in something similar to your recommendation, thanks!