# SDL: Don't conflict with usage of stdout as a stdio macro

**URL:** <https://discourse.libsdl.org/t/sdl-dont-conflict-with-usage-of-stdout-as-a-stdio-macro/37966>\
**Category:** SDL Commits\
**Created:** [July 30, 2022, 11:24pm UTC](https://discourse.libsdl.org/t/sdl-dont-conflict-with-usage-of-stdout-as-a-stdio-macro/37966 "2022-07-30T23:24:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [July 30, 2022, 11:24pm UTC](https://discourse.libsdl.org/t/sdl-dont-conflict-with-usage-of-stdout-as-a-stdio-macro/37966/1 "2022-07-30T23:24:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/21100006ad41876db53060dc754423e369cc5a9c>
>
> Patch inspired by http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/pkgsrc/devel/SD…L2/patches/patch-src\_video\_wayland\_SDL\_\_waylandmessagebox.c?rev=1.1&content-type=text/plain

```diff
From 21100006ad41876db53060dc754423e369cc5a9c Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
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 e81f0e64cab..fe66c61fdb1 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);

```
