View Issue Details

IDProjectCategoryView StatusLast Update
0026750LazarusLazUtilspublic2014-09-20 21:42
ReporterStephano Assigned ToMattias Gaertner  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformarmOSWinCE 
Product Version1.2.5 (SVN) 
Summary0026750: GetSystemThreadCount does not compile under WinCE
DescriptionGetSystemThreadCount does not compile under WinCE:
utf8process.pp(97,6) Error: Identifier not found "GetProcessAffinityMask"

GetProcessAffinityMask doesn't seem to be defined for WinCE. The attached patch sets the result of GetSystemThreadCount to the number of processors for WinCE.
TagsNo tags attached.
Fixed in Revision46269
LazTarget-
WidgetsetWinCE
Attached Files

Activities

Stephano

2014-09-20 16:43

developer  

WinCEGetSystemThreadCount.diff (774 bytes)   
Index: components/lazutils/utf8process.pp
===================================================================
--- components/lazutils/utf8process.pp	(revision 46266)
+++ components/lazutils/utf8process.pp	(working copy)
@@ -94,6 +94,7 @@
   Mask: DWORD;
   SystemInfo: SYSTEM_INFO;
 begin
+{$IFnDEF WinCE}
   if GetProcessAffinityMask(GetCurrentProcess, ProcessAffinityMask, SystemAffinityMask)
   then begin
     Result := 0;
@@ -107,6 +108,11 @@
     GetSystemInfo(SystemInfo);
     Result := SystemInfo.dwNumberOfProcessors;
   end;
+{$ELSE}
+  //can't get the affinity mask for WinCE so we just report the total number of processors
+  GetSystemInfo(SystemInfo);
+  Result := SystemInfo.dwNumberOfProcessors;
+{$ENDIF}
 end;
 {$ELSEIF defined(UNTESTEDsolaris)}
   begin

Stephano

2014-09-20 20:17

developer  

WinCEGetSystemThreadCount2.diff (904 bytes)   
Index: components/lazutils/utf8process.pp
===================================================================
--- components/lazutils/utf8process.pp	(revision 46268)
+++ components/lazutils/utf8process.pp	(working copy)
@@ -87,6 +87,7 @@
 function GetSystemThreadCount: integer;
 // returns a good default for the number of threads on this system
 {$IF defined(windows)}
+{$IFnDEF WinCE}
 //returns total number of processors available to system including logical hyperthreaded processors
 var
   i: Integer;
@@ -108,6 +109,15 @@
     Result := SystemInfo.dwNumberOfProcessors;
   end;
 end;
+{$ELSE}
+var
+  SystemInfo: SYSTEM_INFO;
+begin
+  //can't get the affinity mask for WinCE so we just report the total number of processors
+  GetSystemInfo(SystemInfo);
+  Result := SystemInfo.dwNumberOfProcessors;
+end;
+{$ENDIF}
 {$ELSEIF defined(UNTESTEDsolaris)}
   begin
     t = sysconf(_SC_NPROC_ONLN);

Stephano

2014-09-20 20:19

developer   ~0077469

Uploaded a slightly updated patch.

Issue History

Date Modified Username Field Change
2014-09-20 16:43 Stephano New Issue
2014-09-20 16:43 Stephano Status new => assigned
2014-09-20 16:43 Stephano Assigned To => Mattias Gaertner
2014-09-20 16:43 Stephano File Added: WinCEGetSystemThreadCount.diff
2014-09-20 20:17 Stephano File Added: WinCEGetSystemThreadCount2.diff
2014-09-20 20:19 Stephano Note Added: 0077469
2014-09-20 20:56 Mattias Gaertner Fixed in Revision => 46269
2014-09-20 20:56 Mattias Gaertner Status assigned => resolved
2014-09-20 20:56 Mattias Gaertner Resolution open => fixed
2014-09-20 21:42 Stephano Status resolved => closed