From c06c50ca5df42e2dbfa703a24891c71c91e0c254 Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 28 Dec 2025 05:16:21 +0800 Subject: [PATCH] macOS: respect deployment target if set, use meaningful fallbacks otherwise Closes: https://github.com/nanodbc/nanodbc/issues/438 --- nanodbc/nanodbc.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git nanodbc/nanodbc.cpp nanodbc/nanodbc.cpp index 177bac9..b38c391 100644 --- nanodbc/nanodbc.cpp +++ nanodbc/nanodbc.cpp @@ -65,7 +65,18 @@ struct is_optional> : std::true_type #ifdef __APPLE__ // silence spurious OS X deprecation warnings -#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6 +#ifndef MAC_OS_X_VERSION_MIN_REQUIRED +#if defined(__ppc__) +#define MAC_OS_X_VERSION_MIN_REQUIRED 1040 +#elif defined(__ppc64__) +#define MAC_OS_X_VERSION_MIN_REQUIRED 1050 +#elif defined(__i386__) || defined(__x86_64__) +#define MAC_OS_X_VERSION_MIN_REQUIRED 1060 +#else +// arm64 supported since macOS 11 +#define MAC_OS_X_VERSION_MIN_REQUIRED 110000 +#endif +#endif #endif #ifdef _WIN32