diff options
Diffstat (limited to 'devel/SDL2/patches')
-rw-r--r-- | devel/SDL2/patches/patch-src_audio_netbsd_SDL_netbsdaudio.c | 25 | ||||
-rw-r--r-- | devel/SDL2/patches/patch-src_video_wayland_SDL__waylandmessagebox.c | 34 |
2 files changed, 34 insertions, 25 deletions
diff --git a/devel/SDL2/patches/patch-src_audio_netbsd_SDL_netbsdaudio.c b/devel/SDL2/patches/patch-src_audio_netbsd_SDL_netbsdaudio.c deleted file mode 100644 index 058c3031f22..00000000000 --- a/devel/SDL2/patches/patch-src_audio_netbsd_SDL_netbsdaudio.c +++ /dev/null @@ -1,25 +0,0 @@ -$NetBSD: patch-src_audio_netbsd_SDL_netbsdaudio.c,v 1.1 2021/03/09 20:41:08 mrg Exp $ - -check the return value of ioctl() on audio device and report error -if it doesn't work. stops eg mpv from hanging when it thinks that -it opened the audio device. - ---- src/audio/netbsd/SDL_netbsdaudio.c.orig 2020-12-21 11:44:36.000000000 -0600 -+++ src/audio/netbsd/SDL_netbsdaudio.c 2021-03-09 14:27:27.994211006 -0600 -@@ -291,9 +291,14 @@ - info.lowat = 3; - prinfo->sample_rate = this->spec.freq; - prinfo->channels = this->spec.channels; -- (void) ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info); - -- (void) ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info); -+ if (ioctl(this->hidden->audio_fd, AUDIO_SETINFO, &info) < 0) { -+ return SDL_SetError("Couldn't AUDIO_SETINFO %s: %s", devname, strerror(errno)); -+ } -+ -+ if (ioctl(this->hidden->audio_fd, AUDIO_GETINFO, &info) < 0) { -+ return SDL_SetError("Couldn't AUDIO_GETINFO %s: %s", devname, strerror(errno)); -+ } - this->spec.freq = prinfo->sample_rate; - this->spec.channels = prinfo->channels; - diff --git a/devel/SDL2/patches/patch-src_video_wayland_SDL__waylandmessagebox.c b/devel/SDL2/patches/patch-src_video_wayland_SDL__waylandmessagebox.c new file mode 100644 index 00000000000..a200fa6d257 --- /dev/null +++ b/devel/SDL2/patches/patch-src_video_wayland_SDL__waylandmessagebox.c @@ -0,0 +1,34 @@ +$NetBSD: patch-src_video_wayland_SDL__waylandmessagebox.c,v 1.1 2021/08/11 20:12:25 nia Exp $ + +Avoid conflict if stdout is a macro. + +--- src/video/wayland/SDL_waylandmessagebox.c.orig 2021-07-27 14:52:29.000000000 +0000 ++++ src/video/wayland/SDL_waylandmessagebox.c +@@ -116,7 +116,7 @@ Wayland_ShowMessageBox(const SDL_Message + size_t output_len = 1; + char* output = NULL; + char* tmp = NULL; +- FILE* stdout = NULL; ++ FILE* stdout_ = NULL; + + close(fd_pipe[1]); /* no writing to pipe */ + /* At this point, if no button ID is needed, we can just bail as soon as the +@@ -144,14 +144,14 @@ Wayland_ShowMessageBox(const SDL_Message + } + output[0] = '\0'; + +- stdout = fdopen(fd_pipe[0], "r"); +- if (!stdout) { ++ stdout_ = fdopen(fd_pipe[0], "r"); ++ if (!stdout_) { + SDL_free(output); + close(fd_pipe[0]); + return SDL_SetError("Couldn't open pipe for reading: %s", strerror(errno)); + } +- tmp = fgets(output, output_len + 1, stdout); +- fclose(stdout); ++ tmp = fgets(output, output_len + 1, stdout_); ++ fclose(stdout_); + + if ((tmp == NULL) || (*tmp == '\0') || (*tmp == '\n')) { + SDL_free(output); |