From 12deed91f84c927115f0ddc41dee31153f18034b Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 8 Aug 2023 22:03:06 -0700
Subject: [PATCH] Added information on how to enable thread-safety analysis
---
include/SDL3/SDL_mutex.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/include/SDL3/SDL_mutex.h b/include/SDL3/SDL_mutex.h
index 63b2c595744d..19c6b5557c56 100644
--- a/include/SDL3/SDL_mutex.h
+++ b/include/SDL3/SDL_mutex.h
@@ -34,6 +34,10 @@
/******************************************************************************/
/* Enable thread safety attributes only with clang.
* The attributes can be safely erased when compiling with other compilers.
+ *
+ * To enable analysis, set these environment variables before running cmake:
+ * export CC=clang
+ * export CFLAGS="-DSDL_THREAD_SAFETY_ANALYSIS -Wthread-safety"
*/
#if defined(SDL_THREAD_SAFETY_ANALYSIS) && \
defined(__clang__) && (!defined(SWIG))