From ef665c5982fa1a0dfcf730add27d492bbd130223 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 15 Aug 2018 10:22:29 +0100 Subject: [PATCH] Updated SystemStats::getDeviceDescription() to return the device code on iOS --- modules/juce_core/native/juce_mac_SystemStats.mm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/juce_core/native/juce_mac_SystemStats.mm b/modules/juce_core/native/juce_mac_SystemStats.mm index 5bcae75b24..35ba865bc2 100644 --- a/modules/juce_core/native/juce_mac_SystemStats.mm +++ b/modules/juce_core/native/juce_mac_SystemStats.mm @@ -140,17 +140,20 @@ String SystemStats::getOperatingSystemName() String SystemStats::getDeviceDescription() { #if JUCE_IOS - return nsStringToJuce ([[UIDevice currentDevice] model]); + const char* name = "hw.machine"; #else + const char* name = "hw.model"; + #endif + size_t size; - if (sysctlbyname ("hw.model", nullptr, &size, nullptr, 0) >= 0) + if (sysctlbyname (name, nullptr, &size, nullptr, 0) >= 0) { HeapBlock model (size); - if (sysctlbyname ("hw.model", model, &size, nullptr, 0) >= 0) + if (sysctlbyname (name, model, &size, nullptr, 0) >= 0) return model.get(); } + return {}; - #endif } String SystemStats::getDeviceManufacturer()