From 21100006ad41876db53060dc754423e369cc5a9c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 30 Jul 2022 16:22:24 -0700 Subject: [PATCH] Don't conflict with usage of stdout as a stdio macro Patch inspired by http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/devel/SDL2/patches/patch-src_video_wayland_SDL__waylandmessagebox.c?rev=1.1&content-type=text/plain --- src/video/wayland/SDL_waylandmessagebox.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/video/wayland/SDL_waylandmessagebox.c b/src/video/wayland/SDL_waylandmessagebox.c index e81f0e64c..fe66c61fd 100644 --- a/src/video/wayland/SDL_waylandmessagebox.c +++ b/src/video/wayland/SDL_waylandmessagebox.c @@ -118,7 +118,7 @@ Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) size_t output_len = 1; char* output = NULL; char* tmp = NULL; - FILE* stdout = NULL; + FILE* outputfp = 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 @@ -146,14 +146,14 @@ Wayland_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid) } output[0] = '\0'; - stdout = fdopen(fd_pipe[0], "r"); - if (!stdout) { + outputfp = fdopen(fd_pipe[0], "r"); + if (!outputfp) { 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, outputfp); + fclose(outputfp); if ((tmp == NULL) || (*tmp == '\0') || (*tmp == '\n')) { SDL_free(output);