# SDL: Fixed build warning on iOS

**URL:** <https://discourse.libsdl.org/t/sdl-fixed-build-warning-on-ios/34091>\
**Category:** SDL Commits\
**Created:** [December 14, 2021, 8:10pm UTC](https://discourse.libsdl.org/t/sdl-fixed-build-warning-on-ios/34091 "2021-12-14T20:10: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:** [December 14, 2021, 8:10pm UTC](https://discourse.libsdl.org/t/sdl-fixed-build-warning-on-ios/34091/1 "2021-12-14T20:10:02Z")

</div>

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

```diff
From 086c74556d9ea01712c1286f1668bfb6ccbdc7b4 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 14 Dec 2021 12:08:36 -0800
Subject: [PATCH] Fixed build warning on iOS

---
 include/SDL_config_iphoneos.h | 1 +
 src/SDL_internal.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/SDL_config_iphoneos.h b/include/SDL_config_iphoneos.h
index 42b4a5d210e..7cd7b6f3b70 100644
--- a/include/SDL_config_iphoneos.h
+++ b/include/SDL_config_iphoneos.h
@@ -134,6 +134,7 @@
 #define HAVE_NANOSLEEP 1
 #define HAVE_SYSCONF 1
 #define HAVE_SYSCTLBYNAME 1
+#define HAVE_O_CLOEXEC 1
 
 /* enable iPhone version of Core Audio driver */
 #define SDL_AUDIO_DRIVER_COREAUDIO 1
diff --git a/src/SDL_internal.h b/src/SDL_internal.h
index c06a4773ae6..369128237d5 100644
--- a/src/SDL_internal.h
+++ b/src/SDL_internal.h
@@ -51,7 +51,7 @@
 
 #include "SDL_config.h"
 
-#ifndef HAVE_O_CLOEXEC
+#if !defined(O_CLOEXEC) && !defined(HAVE_O_CLOEXEC)
 #define O_CLOEXEC 0
 #endif
 

```
