Message ID | 20180107211500.9892-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | 32f85056b3eae97ddd149d9312b48449f22cff51 |
Headers | show |
On 1/7/2018 6:15 PM, James Almer wrote: > check_func_headers() defines a main() function, which clashes with a > redefinition done by said SDL header. Check for SDL_PollEvent using > SDL_events.h only instead, where the redefinition doesn't happen. > > Fixes a regression since d03c39b46b21c893d6549a532289b7fb9935b3fc. > > Tested-by: RiCON > Signed-off-by: James Almer <jamrial@gmail.com> > --- > configure | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/configure b/configure > index ab05b9c7f3..1aea18d300 100755 > --- a/configure > +++ b/configure > @@ -6008,15 +6008,13 @@ fi > > if enabled sdl2; then > SDL2_CONFIG="${cross_prefix}sdl2-config" > - if test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent; then > - check_func_headers SDL.h SDL_Init $sdl2_extralibs $sdl2_cflags || > - disable sdl2 > - elif "${SDL2_CONFIG}" --version > /dev/null 2>&1; then > + test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent > + if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then > sdl2_cflags=$("${SDL2_CONFIG}" --cflags) > sdl2_extralibs=$("${SDL2_CONFIG}" --libs) > check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && > check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && > - check_func_headers SDL.h SDL_Init $sdl2_extralibs $sdl2_cflags && > + check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags && > enable sdl2 > fi > if test $target_os = "mingw32"; then Will push this soon.
diff --git a/configure b/configure index ab05b9c7f3..1aea18d300 100755 --- a/configure +++ b/configure @@ -6008,15 +6008,13 @@ fi if enabled sdl2; then SDL2_CONFIG="${cross_prefix}sdl2-config" - if test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent; then - check_func_headers SDL.h SDL_Init $sdl2_extralibs $sdl2_cflags || - disable sdl2 - elif "${SDL2_CONFIG}" --version > /dev/null 2>&1; then + test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent + if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then sdl2_cflags=$("${SDL2_CONFIG}" --cflags) sdl2_extralibs=$("${SDL2_CONFIG}" --libs) check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && - check_func_headers SDL.h SDL_Init $sdl2_extralibs $sdl2_cflags && + check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags && enable sdl2 fi if test $target_os = "mingw32"; then