Browse Source

Fix for getting iOS CPU core count.

Credit to Yuki001. Closed #2630.
Yao Wei Tjong 5 years ago
parent
commit
bcf29b8ee4
1 changed files with 4 additions and 4 deletions
  1. 4 4
      Source/Urho3D/Core/ProcessUtils.cpp

+ 4 - 4
Source/Urho3D/Core/ProcessUtils.cpp

@@ -433,14 +433,14 @@ unsigned GetNumPhysicalCPUs()
 #if defined(IOS)
 #if defined(IOS)
     host_basic_info_data_t data;
     host_basic_info_data_t data;
     GetCPUData(&data);
     GetCPUData(&data);
-#if defined(TARGET_OS_SIMULATOR)
+#if TARGET_OS_SIMULATOR
     // Hardcoded to dual-core on simulator mode even if the host has more
     // Hardcoded to dual-core on simulator mode even if the host has more
     return Min(2, data.physical_cpu);
     return Min(2, data.physical_cpu);
 #else
 #else
     return data.physical_cpu;
     return data.physical_cpu;
 #endif
 #endif
 #elif defined(TVOS)
 #elif defined(TVOS)
-#if defined(TARGET_OS_SIMULATOR)
+#if TARGET_OS_SIMULATOR
     return Min(2, SDL_TVOS_GetActiveProcessorCount());
     return Min(2, SDL_TVOS_GetActiveProcessorCount());
 #else
 #else
     return SDL_TVOS_GetActiveProcessorCount();
     return SDL_TVOS_GetActiveProcessorCount();
@@ -467,13 +467,13 @@ unsigned GetNumLogicalCPUs()
 #if defined(IOS)
 #if defined(IOS)
     host_basic_info_data_t data;
     host_basic_info_data_t data;
     GetCPUData(&data);
     GetCPUData(&data);
-#if defined(TARGET_OS_SIMULATOR)
+#if TARGET_OS_SIMULATOR
     return Min(2, data.logical_cpu);
     return Min(2, data.logical_cpu);
 #else
 #else
     return data.logical_cpu;
     return data.logical_cpu;
 #endif
 #endif
 #elif defined(TVOS)
 #elif defined(TVOS)
-#if defined(TARGET_OS_SIMULATOR)
+#if TARGET_OS_SIMULATOR
     return Min(2, SDL_TVOS_GetActiveProcessorCount());
     return Min(2, SDL_TVOS_GetActiveProcessorCount());
 #else
 #else
     return SDL_TVOS_GetActiveProcessorCount();
     return SDL_TVOS_GetActiveProcessorCount();