--- src/mongo/util/concurrency/thread_name.cpp 2023-06-16 20:55:56 +++ src/mongo/util/concurrency/thread_name.cpp 2026-03-21 08:23:56 @@ -37,6 +37,7 @@ #include #endif #if defined(__APPLE__) +#include #include #if !TARGET_OS_TV && !TARGET_OS_IOS && !TARGET_OS_WATCH #include @@ -98,7 +99,7 @@ // Naming should not be expensive compared to thread creation and connection set up, but if // testing shows otherwise we should make this depend on DEBUG again. setWindowsThreadName(GetCurrentThreadId(), threadName.c_str()); -#elif defined(__APPLE__) +#elif defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) // Maximum thread name length on OS X is MAXTHREADNAMESIZE (64 characters). This assumes // OS X 10.6 or later. std::string threadNameCopy = threadName;