summaryrefslogtreecommitdiff
path: root/src/os/windows
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-12-10 16:54:41 +0000
committermichi_cc <michi_cc@openttd.org>2011-12-10 16:54:41 +0000
commita0f3649c1abe7b831f083366e2fd91206bf23091 (patch)
tree5a352c430013c682e93d1a1b85960182cd18fbac /src/os/windows
parent0ca25fb3af8fbf00607df120149b27aa7a763edb (diff)
downloadopenttd-a0f3649c1abe7b831f083366e2fd91206bf23091.tar.xz
(svn r23481) -Add: Function to get the CPU core count.
Diffstat (limited to 'src/os/windows')
-rw-r--r--src/os/windows/win32.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index 39203cbca..6c7a3ec68 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -753,3 +753,11 @@ const char *GetCurrentLocale(const char *)
static char retbuf[6] = {lang[0], lang[1], '_', country[0], country[1], 0};
return retbuf;
}
+
+uint GetCPUCoreCount()
+{
+ SYSTEM_INFO info;
+
+ GetSystemInfo(&info);
+ return info.dwNumberOfProcessors;
+}