From 707d9fb676fcba90574033bf313e6d0eb217cb20 Mon Sep 17 00:00:00 2001 From: Tibor Nagy <xnagytibor@gmail.com> Date: Sun, 22 Apr 2018 17:57:18 +0200 Subject: [PATCH] Enable SDL timers --- recipes/sdl/02_timers.patch | 57 +++++++++++++++++++++++++++++++++++++ recipes/sdl/recipe.sh | 4 +-- 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 recipes/sdl/02_timers.patch diff --git a/recipes/sdl/02_timers.patch b/recipes/sdl/02_timers.patch new file mode 100644 index 000000000..1cd209127 --- /dev/null +++ b/recipes/sdl/02_timers.patch @@ -0,0 +1,57 @@ +diff -rupN source/src/timer/unix/SDL_systimer.c source-redox/src/timer/unix/SDL_systimer.c +--- source/src/timer/unix/SDL_systimer.c 2012-01-19 07:30:06.000000000 +0100 ++++ source-redox/src/timer/unix/SDL_systimer.c 2018-04-22 17:42:17.455342646 +0200 +@@ -150,14 +150,14 @@ static void HandleAlarm(int sig) + + int SDL_SYS_TimerInit(void) + { +- struct sigaction action; ++ //struct sigaction action; + +- /* Set the alarm handler (Linux specific) */ +- SDL_memset(&action, 0, sizeof(action)); +- action.sa_handler = HandleAlarm; +- action.sa_flags = SA_RESTART; +- sigemptyset(&action.sa_mask); +- sigaction(SIGALRM, &action, NULL); ++ ///* Set the alarm handler (Linux specific) */ ++ //SDL_memset(&action, 0, sizeof(action)); ++ //action.sa_handler = HandleAlarm; ++ //action.sa_flags = SA_RESTART; ++ //sigemptyset(&action.sa_mask); ++ //sigaction(SIGALRM, &action, NULL); + return(0); + } + +@@ -168,22 +168,22 @@ void SDL_SYS_TimerQuit(void) + + int SDL_SYS_StartTimer(void) + { +- struct itimerval timer; ++ //struct itimerval timer; + +- timer.it_value.tv_sec = (SDL_alarm_interval/1000); +- timer.it_value.tv_usec = (SDL_alarm_interval%1000)*1000; +- timer.it_interval.tv_sec = (SDL_alarm_interval/1000); +- timer.it_interval.tv_usec = (SDL_alarm_interval%1000)*1000; +- setitimer(ITIMER_REAL, &timer, NULL); ++ //timer.it_value.tv_sec = (SDL_alarm_interval/1000); ++ //timer.it_value.tv_usec = (SDL_alarm_interval%1000)*1000; ++ //timer.it_interval.tv_sec = (SDL_alarm_interval/1000); ++ //timer.it_interval.tv_usec = (SDL_alarm_interval%1000)*1000; ++ //setitimer(ITIMER_REAL, &timer, NULL); + return(0); + } + + void SDL_SYS_StopTimer(void) + { +- struct itimerval timer; ++ //struct itimerval timer; + +- SDL_memset(&timer, 0, (sizeof timer)); +- setitimer(ITIMER_REAL, &timer, NULL); ++ //SDL_memset(&timer, 0, (sizeof timer)); ++ //setitimer(ITIMER_REAL, &timer, NULL); + } + + #else /* USE_ITIMER */ diff --git a/recipes/sdl/recipe.sh b/recipes/sdl/recipe.sh index 045d4dfba..6e7695c3e 100644 --- a/recipes/sdl/recipe.sh +++ b/recipes/sdl/recipe.sh @@ -13,8 +13,8 @@ function recipe_update { function recipe_build { ./autogen.sh - ./configure --prefix=/ --host=${HOST} --disable-shared --disable-pulseaudio --disable-video-x11 --disable-cdrom --disable-loadso --disable-threads --disable-timers --enable-audio --enable-dummyaudio --enable-video-orbital - make + ./configure --prefix=/ --host=${HOST} --disable-shared --disable-pulseaudio --disable-video-x11 --disable-cdrom --disable-loadso --disable-threads --enable-audio --enable-dummyaudio --enable-video-orbital + make skip=1 } -- GitLab