libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
196 stars 40 forks source link

32-bit compile on 64-bit Linux platform dies immediately #334

Closed haydentech closed 6 months ago

haydentech commented 6 months ago

I followed the compile directions in the README:

cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build

However the make dies immediately:

billh@ThinkCentre-M93p:~/git/sdl12-compat$ cmake --build build
[  1%] Building C object CMakeFiles/SDL.dir/src/SDL12_compat.c.o
/home/billh/git/sdl12-compat/src/SDL12_compat.c: In function ‘SetVideoModeImpl’:
/home/billh/git/sdl12-compat/src/SDL12_compat.c:6141:13: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
 6141 |             const SDL_bool recreate_window = (
      |             ^~~~~
cc1: some warnings being treated as errors
gmake[2]: *** [CMakeFiles/SDL.dir/build.make:76: CMakeFiles/SDL.dir/src/SDL12_compat.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:149: CMakeFiles/SDL.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

I am on Ubuntu 22.04 which uses gcc 11.4.0. The sdl12-compat code used was pulled from git this morning.

sezero commented 6 months ago

Should be fixed as of https://github.com/libsdl-org/sdl12-compat/commit/c4ffe41c95f5c40c2e2eaad452c9a1738b0da05f

haydentech commented 6 months ago

Thanks! I was able to successfully do a 32-bit and 64-bit compile after your change.