From d5f08b8f4b576e191960dc8ec1fb99402bba22d3 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Sun, 29 Dec 2024 20:14:23 +0100
Subject: [PATCH] stdinc: use __has_include to detect <stdbool.h>
Newer emscripten SDK does an unconditional #include <stdbool.h>,
which clashes with our custom bool.h typedef
---
include/SDL3/SDL_stdinc.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h
index 4a9c525a8b311..b828e1db2eb8e 100644
--- a/include/SDL3/SDL_stdinc.h
+++ b/include/SDL3/SDL_stdinc.h
@@ -45,6 +45,11 @@
#endif
#ifndef __cplusplus
+#if defined(__has_include) && !defined(SDL_INCLUDE_STDBOOL_H)
+#if __has_include(<stdbool.h>)
+#define SDL_INCLUDE_STDBOOL_H
+#endif
+#endif
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \
(defined(_MSC_VER) && (_MSC_VER >= 1910 /* Visual Studio 2017 */)) || \
defined(SDL_INCLUDE_STDBOOL_H)