Commit 21100006ad41876db53060dc754423e369cc5a9c

Sam Lantinga 2022-07-30T16:22:24

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

diff --git a/src/video/wayland/SDL_waylandmessagebox.c b/src/video/wayland/SDL_waylandmessagebox.c
index e81f0e6..fe66c61 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);