Fix strict compiler warning in BGE when linking directly to SDL

This commit is contained in:
Sergey Sharybin 2017-07-21 16:07:59 +02:00
parent 4d67034076
commit 11204fce4e
3 changed files with 10 additions and 1 deletions

View File

@ -139,6 +139,9 @@ if(WITH_SDL)
if(WITH_GHOST_SDL)
add_definitions(-DWITH_GHOST_SDL)
endif()
if(WITH_SDL_DYNLOAD)
add_definitions(-DWITH_SDL_DYNLOAD)
endif()
endif()
blender_add_lib(ge_logic "${SRC}" "${INC}" "${INC_SYS}")

View File

@ -38,7 +38,11 @@
#include "BLI_path_util.h"
#ifdef WITH_SDL
# define SDL_CHECK(x) ((x) != (void *)0)
# ifdef WITH_SDL_DYNLOAD
# define SDL_CHECK(x) ((x) != (void *)0)
# else
# define SDL_CHECK(x) true
# endif
#endif
SCA_Joystick::SCA_Joystick(short int index)

View File

@ -82,9 +82,11 @@ void SCA_Joystick::HandleEvents(void)
{
SDL_Event sdl_event;
#ifdef WITH_SDL_DYNLOAD
if (SDL_PollEvent == (void*)0) {
return;
}
#endif
int i;
for (i=0; i<m_joynum; i++) { /* could use JOYINDEX_MAX but no reason to */