diff --git a/src/Cafe/CafeSystem.cpp b/src/Cafe/CafeSystem.cpp index 879085b9..f016773c 100644 --- a/src/Cafe/CafeSystem.cpp +++ b/src/Cafe/CafeSystem.cpp @@ -539,7 +539,23 @@ namespace CafeSystem else platform = "Linux"; #elif BOOST_OS_MACOS - platform = "MacOS"; + char productVersion[256]{}; + size_t productVersionSize = sizeof(productVersion); + const int productVersionResult = sysctlbyname("kern.osproductversion", productVersion, &productVersionSize, nullptr, 0); + + char buildVersion[256]{}; + size_t buildVersionSize = sizeof(buildVersion); + const int buildVersionResult = sysctlbyname("kern.osversion", buildVersion, &buildVersionSize, nullptr, 0); + + if (productVersionResult == 0 && buildVersionResult == 0) + buffer = fmt::format("macOS {} ({})", productVersion, buildVersion); + else if (productVersionResult == 0) + buffer = fmt::format("macOS {}", productVersion); + else + buffer = "macOS"; + + platform = buffer.c_str(); + #elif BOOST_OS_BSD #if defined(__FreeBSD__) platform = "FreeBSD";