Daniel Lehman : msvcp140: Implement _Thrd_hardware_concurrency.

Alexandre Julliard julliard at winehq.org
Mon Aug 8 11:09:28 CDT 2016


Module: wine
Branch: master
Commit: 04bb658f0a054b3f3d2fa2e5125166d99e4d10c3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=04bb658f0a054b3f3d2fa2e5125166d99e4d10c3

Author: Daniel Lehman <dlehman at esri.com>
Date:   Thu May 26 21:36:07 2016 -0700

msvcp140: Implement _Thrd_hardware_concurrency.

Signed-off-by: Daniel Lehman <dlehman at esri.com>
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcp140/msvcp140.spec |  2 +-
 dlls/msvcp90/misc.c         | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec
index 922aa9e..05d62be 100644
--- a/dlls/msvcp140/msvcp140.spec
+++ b/dlls/msvcp140/msvcp140.spec
@@ -3725,7 +3725,7 @@
 @ cdecl _Thrd_detach(ptr) msvcp110._Thrd_detach
 @ cdecl _Thrd_equal(ptr ptr) _Thrd_equal
 @ stub _Thrd_exit
-@ stub _Thrd_hardware_concurrency
+@ cdecl _Thrd_hardware_concurrency() _Thrd_hardware_concurrency
 @ stub _Thrd_id
 @ cdecl _Thrd_join(ptr long) _Thrd_join
 @ cdecl _Thrd_sleep(ptr) _Thrd_sleep
diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c
index 2037e69..52bc608 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -942,6 +942,22 @@ DEFINE_RTTI_DATA0(_Pad, 0, ".?AV_Pad at std@@")
 /* ??_7_Pad at std@@6B@ */
 extern const vtable_ptr MSVCP__Pad_vtable;
 
+unsigned int __cdecl _Thrd_hardware_concurrency(void)
+{
+    static unsigned int val = -1;
+
+    TRACE("()\n");
+
+    if(val == -1) {
+        SYSTEM_INFO si;
+
+        GetSystemInfo(&si);
+        val = si.dwNumberOfProcessors;
+    }
+
+    return val;
+}
+
 /* ??0_Pad at std@@QAE at XZ */
 /* ??0_Pad at std@@QEAA at XZ */
 DEFINE_THISCALL_WRAPPER(_Pad_ctor, 4)




More information about the wine-cvs mailing list