<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">Carbon was deprecated in OS X 10.8 and stopped working in macOS 10.15 when
support for 32-bit x86 applications was removed.

For compatibility with new versions of OS X try to extract the system version
from the kern.osproductversion sysctl, if it exists.
If it does not, fall back to Carbon's Gestalt().

--- src/engine/version.cpp.orig	2021-05-29 05:30:02.000000000 +0200
+++ src/engine/version.cpp	2023-03-17 14:05:16.000000000 +0100
@@ -9,7 +9,12 @@
 #elif FZ_UNIX
 #include &lt;sys/utsname.h&gt;
 #else
+#include &lt;sys/sysctl.h&gt;
+#include &lt;AvailabilityMacros.h&gt;
+#if MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101500
 #include &lt;Carbon/Carbon.h&gt;
+#define CARBON_AVAILABLE
+#endif
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -145,13 +150,29 @@
 #elif FZ_MAC
 SystemVersion GetSystemVersion()
 {
-	SInt32 major{};
-	Gestalt(gestaltSystemVersionMajor, &amp;major);
+	unsigned int major = 0, minor = 0;
 
-	SInt32 minor{};
-    Gestalt(gestaltSystemVersionMinor, &amp;minor);
+	size_t vers_len = 32;
+	char vers[vers_len];
+	vers[0] = 0;
+
+	if (0 == sysctlbyname("kern.osproductversion", vers, &amp;vers_len, NULL, 0)) {
+		char *vp = vers;
+		major = atoi(vp);
+		while (vp &lt; (vers + vers_len) &amp;&amp; *vp++ != '.');
+		minor = atoi(vp);
+#ifdef CARBON_AVAILABLE
+	} else {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+		/* Carbon fallback */
+		Gestalt(gestaltSystemVersionMajor, (SInt32*)&amp;major);
+		Gestalt(gestaltSystemVersionMinor, (SInt32*)&amp;minor);
+#pragma clang diagnostic pop
+#endif
+	}
 
-    return {static_cast&lt;unsigned int&gt;(major), static_cast&lt;unsigned int&gt;(minor)};
+	return {major, minor};
 }
 
 #else
</pre></body></html>