# SDL: wayland: Minor fix for old compilers

**URL:** <https://discourse.libsdl.org/t/sdl-wayland-minor-fix-for-old-compilers/35168>\
**Category:** SDL Commits\
**Created:** [March 28, 2022, 7:34pm UTC](https://discourse.libsdl.org/t/sdl-wayland-minor-fix-for-old-compilers/35168 "2022-03-28T19:34: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:** [March 28, 2022, 7:34pm UTC](https://discourse.libsdl.org/t/sdl-wayland-minor-fix-for-old-compilers/35168/1 "2022-03-28T19:34:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/d875416ac4f873d748f0790f43153b4e1890d121>

```diff
From d875416ac4f873d748f0790f43153b4e1890d121 Mon Sep 17 00:00:00 2001
From: Ethan Lee <[EMAIL REDACTED]>
Date: Mon, 28 Mar 2022 15:32:30 -0400
Subject: [PATCH] wayland: Minor fix for old compilers

---
 src/video/wayland/SDL_waylandvideo.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c
index a0f27fc8a90..8c4735a43d8 100644
--- a/src/video/wayland/SDL_waylandvideo.c
+++ b/src/video/wayland/SDL_waylandvideo.c
@@ -423,6 +423,7 @@ AddEmulatedModes(SDL_VideoDisplay *dpy, SDL_bool rot_90)
         { 640, 350 }
     };
 
+ int i;
     const struct EmulatedMode *mode_list = NULL;
     int mode_list_size;
     const int native_width = (float)dpy->display_modes->w;
@@ -442,7 +443,7 @@ AddEmulatedModes(SDL_VideoDisplay *dpy, SDL_bool rot_90)
         return; /* Some weird aspect we don't support */
     }
 
- for (int i = 0; i < mode_list_size; ++i) {
+ for (i = 0; i < mode_list_size; ++i) {
         /* Only add modes that are smaller than the native mode */
         if ((mode_list[i].w < native_width && mode_list[i].h < native_height) ||
             (mode_list[i].w < native_width && mode_list[i].h == native_height)) {

```
