--- src/sqliteInt.h.orig	2025-02-06 07:59:07.000000000 -0600
+++ src/sqliteInt.h	2025-02-08 18:10:41.000000000 -0600
@@ -233,7 +233,8 @@
 #ifndef __has_extension
 # define __has_extension(x) 0     /* compatibility with non-clang compilers */
 #endif
-#if GCC_VERSION>=4007000 || __has_extension(c_atomic)
+/* for Xcode 4 (clang < 3.3) the existence of 'atomic' is detected by configure, but it is not fully functional, so key on clang_major > 4 */
+#if (!defined(__clang__) && ((GCC_VERSION>=4007000) || __has_extension(c_atomic))) || (defined(__clang_major__) && (__clang_major__ > 4) && __has_extension(c_atomic))
 # define SQLITE_ATOMIC_INTRINSICS 1
 # define AtomicLoad(PTR)       __atomic_load_n((PTR),__ATOMIC_RELAXED)
 # define AtomicStore(PTR,VAL)  __atomic_store_n((PTR),(VAL),__ATOMIC_RELAXED)