mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-22 21:04:18 +08:00
Add timers to sdl, update libiconv patch
This commit is contained in:
parent
6f761473be
commit
bcfaace90c
@ -1,30 +1,36 @@
|
||||
diff -rupNw source-original/srclib/getprogname.c source/srclib/getprogname.c
|
||||
--- source-original/srclib/getprogname.c 2017-01-02 00:02:21.000000000 +0100
|
||||
+++ source/srclib/getprogname.c 2018-10-03 19:32:07.382785859 +0200
|
||||
@@ -144,7 +144,7 @@ getprogname (void)
|
||||
diff -ruw source/srclib/getprogname.c source-new/srclib/getprogname.c
|
||||
--- source/srclib/getprogname.c 2017-01-01 16:02:21.000000000 -0700
|
||||
+++ source-new/srclib/getprogname.c 2018-12-29 08:08:09.138286508 -0700
|
||||
@@ -43,6 +43,14 @@
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
+#if defined(__redox__)
|
||||
+# include <string.h>
|
||||
+# include <unistd.h>
|
||||
+# include <stdio.h>
|
||||
+# include <fcntl.h>
|
||||
+# include <limits.h>
|
||||
+#endif
|
||||
+
|
||||
#include "dirname.h"
|
||||
|
||||
#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
|
||||
@@ -143,6 +151,17 @@
|
||||
free (buf.ps_pathptr);
|
||||
}
|
||||
return p;
|
||||
+# elif defined(__redox__)
|
||||
+ char filename[PATH_MAX];
|
||||
+ int fd = open ("sys:exe", O_RDONLY);
|
||||
+ if (fd > 0) {
|
||||
+ int len = read(fd, filename, PATH_MAX-1);
|
||||
+ if (len > 0) {
|
||||
+ filename[len] = '\0';
|
||||
+ return strdup(filename);
|
||||
+ }
|
||||
+ }
|
||||
+ return NULL;
|
||||
# else
|
||||
-# error "getprogname module not ported to this OS"
|
||||
+ return "?";
|
||||
# error "getprogname module not ported to this OS"
|
||||
# endif
|
||||
}
|
||||
|
||||
diff -rupNw source-original/srclib/signal.in.h source/srclib/signal.in.h
|
||||
--- source-original/srclib/signal.in.h 2017-01-02 00:02:22.000000000 +0100
|
||||
+++ source/srclib/signal.in.h 2018-10-03 19:46:53.323659264 +0200
|
||||
@@ -186,12 +186,12 @@ _GL_WARN_ON_USE (raise, "raise can crash
|
||||
|
||||
/* Maximum signal number + 1. */
|
||||
# ifndef NSIG
|
||||
-# define NSIG 32
|
||||
+# define NSIG 64
|
||||
# endif
|
||||
|
||||
/* This code supports only 32 signals. */
|
||||
# if !GNULIB_defined_verify_NSIG_constraint
|
||||
-typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
|
||||
+typedef int verify_NSIG_constraint[NSIG <= 64 ? 1 : -1];
|
||||
# define GNULIB_defined_verify_NSIG_constraint 1
|
||||
# endif
|
||||
|
||||
|
||||
@ -1,57 +0,0 @@
|
||||
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 */
|
||||
@ -25,10 +25,8 @@ function recipe_build {
|
||||
--disable-video-x11 \
|
||||
--disable-loadso \
|
||||
--disable-threads \
|
||||
--enable-audio \
|
||||
--enable-dummyaudio \
|
||||
--enable-video-orbital \
|
||||
--enable-cdrom
|
||||
--enable-clock_gettime \
|
||||
--enable-video-orbital
|
||||
make -j"$(nproc)"
|
||||
skip=1
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user