Skip to content

Commit 143420c

Browse files
committed
fixes for non windows platforms
1 parent acdd036 commit 143420c

File tree

10 files changed

+67
-25
lines changed

10 files changed

+67
-25
lines changed

Packages/Delphi11/Spring.Base.dproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<MainSource>Spring.Base.dpk</MainSource>
55
<Base>True</Base>
66
<Config Condition="'$(Config)'==''">Debug</Config>
7-
<TargetedPlatforms>3</TargetedPlatforms>
7+
<TargetedPlatforms>131</TargetedPlatforms>
88
<AppType>Package</AppType>
99
<FrameworkType>None</FrameworkType>
1010
<ProjectVersion>19.3</ProjectVersion>
@@ -201,6 +201,7 @@
201201
<Excluded_Packages/>
202202
</Delphi.Personality>
203203
<Platforms>
204+
<Platform value="Linux64">True</Platform>
204205
<Platform value="Win32">True</Platform>
205206
<Platform value="Win64">True</Platform>
206207
</Platforms>

Packages/Delphi11/Spring.Core.dproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<MainSource>Spring.Core.dpk</MainSource>
55
<Base>True</Base>
66
<Config Condition="'$(Config)'==''">Debug</Config>
7-
<TargetedPlatforms>3</TargetedPlatforms>
7+
<TargetedPlatforms>131</TargetedPlatforms>
88
<AppType>Package</AppType>
99
<FrameworkType>None</FrameworkType>
1010
<ProjectVersion>19.3</ProjectVersion>
@@ -170,6 +170,7 @@
170170
<Excluded_Packages/>
171171
</Delphi.Personality>
172172
<Platforms>
173+
<Platform value="Linux64">True</Platform>
173174
<Platform value="Win32">True</Platform>
174175
<Platform value="Win64">True</Platform>
175176
</Platforms>

Packages/Delphi11/Spring.Data.dproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
<Excluded_Packages/>
136136
</Delphi.Personality>
137137
<Platforms>
138+
<Platform value="Linux64">False</Platform>
138139
<Platform value="Win32">True</Platform>
139140
<Platform value="Win64">True</Platform>
140141
</Platforms>

Packages/Delphi11/Spring.Extensions.dproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
<Excluded_Packages/>
151151
</Delphi.Personality>
152152
<Platforms>
153+
<Platform value="Linux64">False</Platform>
153154
<Platform value="Win32">True</Platform>
154155
<Platform value="Win64">True</Platform>
155156
</Platforms>

Packages/Delphi11/Spring.Persistence.dproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
<Excluded_Packages/>
175175
</Delphi.Personality>
176176
<Platforms>
177+
<Platform value="Linux64">False</Platform>
177178
<Platform value="Win32">True</Platform>
178179
<Platform value="Win64">True</Platform>
179180
</Platforms>

Source/Base/Collections/Spring.Collections.Base.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,7 +3278,7 @@ function TIteratorBlock<T>.MoveNextConcat: Boolean;
32783278
{$IFDEF MSWINDOWS}
32793279
IEnumerableInternal(Predicate).GetEnumerator(IEnumerator(Enumerator));
32803280
{$ELSE}
3281-
Enumerator := IEnumerable(Predicate).GetEnumerator;
3281+
Enumerator := IEnumerable<T>(Predicate).GetEnumerator;
32823282
{$ENDIF}
32833283
Predicate := nil;
32843284
until False;

Source/Base/Spring.Hash.pas

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
interface
3030

31+
{$O+,W-,Q-,R-}
32+
3133
function MurmurHash3(const key; len: Cardinal; seed: Integer = 0): Integer;
3234

3335
function MurmurHash3_Int32(const key: Integer): Integer; //inline;
@@ -60,10 +62,10 @@ function xxHash32(const key; len: Cardinal; seed: Integer = 0): Integer;
6062
if len >= 16 then
6163
begin
6264
limit := pEnd - 16;
63-
v1 := Seed + Prime1 + Prime2;
64-
v2 := Seed + Prime2;
65-
v3 := Seed;
66-
v4 := Seed - Prime1;
65+
v1 := Cardinal(seed) + Prime1 + Prime2;
66+
v2 := Cardinal(seed) + Prime2;
67+
v3 := Cardinal(seed);
68+
v4 := Cardinal(seed) - Prime1;
6769

6870
repeat
6971
v1 := Prime1 * RotateLeft(v1 + Prime2 * PCardinal(data)[0], 13);
@@ -79,13 +81,13 @@ function xxHash32(const key; len: Cardinal; seed: Integer = 0): Integer;
7981
RotateLeft(v4, 18);
8082
end
8183
else
82-
Result := Seed + Prime5;
84+
Result := Cardinal(seed) + Prime5;
8385

8486
Inc(Result, len);
8587

8688
while data <= pEnd - 4 do
8789
begin
88-
Result := Result + PCardinal(data)^ * Prime3;
90+
Result := Cardinal(Result) + PCardinal(data)^ * Prime3;
8991
Result := RotateLeft(Result, 17) * Prime4;
9092
Inc(data, 4);
9193
end;
@@ -98,9 +100,9 @@ function xxHash32(const key; len: Cardinal; seed: Integer = 0): Integer;
98100
end;
99101

100102
Result := Result xor (Result shr 15);
101-
Result := Result * Prime2;
103+
Result := Cardinal(Result) * Prime2;
102104
Result := Result xor (Result shr 13);
103-
Result := Result * Prime3;
105+
Result := Cardinal(Result) * Prime3;
104106
Result := Result xor (Result shr 16);
105107
end;
106108
{$ELSEIF defined(CPUX86)}
@@ -339,15 +341,19 @@ function MurmurHash3_Int32(const key: Integer): Integer;
339341
f1 = $85EBCA6B;
340342
f2 = $C2B2AE35;
341343
{$IF not defined(ASSEMBLER)}
344+
var
345+
res: Cardinal;
342346
begin
343-
Result := RotateLeft(key * c1, r1);
344-
Result := RotateLeft(Result * c2, r2);
347+
res := Cardinal(key);
348+
res := RotateLeft(res * c1, r1);
349+
res := RotateLeft(res * c2, r2);
345350

346-
Result := (Result * m + n) xor 4;
351+
res := (res * m + n) xor 4;
347352

348-
Result := (Result xor (Result shr 16)) * f1;
349-
Result := (Result xor (Result shr 13)) * f2;
350-
Result := Result xor (Result shr 16);
353+
res := (res xor (res shr 16)) * f1;
354+
res := (res xor (res shr 13)) * f2;
355+
res := res xor (res shr 16);
356+
Result := res;
351357
end;
352358
{$ELSEIF defined(CPUX86)}
353359
asm
@@ -420,9 +426,9 @@ function MurmurHash3(const key; len: Cardinal; seed: Integer = 0): Integer;
420426
k := RotateLeft(k, r1);
421427
k := k * c2;
422428

423-
Result := Result xor k;
429+
Result := Cardinal(Result) xor k;
424430
Result := RotateLeft(Result, r2);
425-
Result := Result * m + n;
431+
Result := Cardinal(Result) * m + n;
426432

427433
Inc(data);
428434
end;
@@ -447,16 +453,16 @@ function MurmurHash3(const key; len: Cardinal; seed: Integer = 0): Integer;
447453
k := k * c1;
448454
k := RotateLeft(k, r1);
449455
k := k * c2;
450-
Result := Result xor k;
456+
Result := Cardinal(Result) xor k;
451457
end;
452458
end;
453459

454-
Result := Result xor len;
460+
Result := Cardinal(Result) xor len;
455461

456462
Result := Result xor (Result shr 16);
457-
Result := Result * f1;
463+
Result := Cardinal(Result) * f1;
458464
Result := Result xor (Result shr 13);
459-
Result := Result * f2;
465+
Result := Cardinal(Result) * f2;
460466
Result := Result xor (Result shr 16);
461467
end;
462468
{$ELSEIF defined(CPUX86)}

Source/Base/Spring.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4791,7 +4791,7 @@ constructor ManagedAttribute.Create(const initializer: TFieldInitializer);
47914791
{$IFDEF USE_VMTAUTOTABLE}
47924792
InitTables := TObjectList<TInitTable>.Create;
47934793
{$ELSE}
4794-
InitTables := TObjectDictionary<TClass,TInitTable>.Create([doOwnsValues]);
4794+
InitTables := TObjectDictionary<TClass,TInitTable>.Create([Generics.Collections.doOwnsValues]);
47954795
{$ENDIF}
47964796
end;
47974797

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Import Condition="Exists('$(BDS)\bin\CodeGear.Deployment.targets')" Project="$(BDS)\bin\CodeGear.Deployment.targets"/>
3+
<ProjectExtensions>
4+
<ProjectFileVersion>12</ProjectFileVersion>
5+
</ProjectExtensions>
6+
<PropertyGroup/>
7+
<ItemGroup Condition="'$(Platform)'=='Win64'"/>
8+
<ItemGroup Condition="'$(Platform)'=='Win32'"/>
9+
<ItemGroup Condition="'$(Platform)'=='Linux64'">
10+
<DeployFile Include="Bin\Delphi11\Linux64\Debug\Spring.Tests" Condition="'$(Config)'=='Debug'">
11+
<RemoteDir>Spring.Tests.Delphi11\</RemoteDir>
12+
<RemoteName>Spring_Tests_Delphi11</RemoteName>
13+
<DeployClass>ProjectOutput</DeployClass>
14+
<Operation>1</Operation>
15+
<LocalCommand/>
16+
<RemoteCommand/>
17+
<Overwrite>True</Overwrite>
18+
<Required>True</Required>
19+
</DeployFile>
20+
<DeployFile Include="Bin\Delphi11\Linux64\Debug\TestInsightSettings.ini" Condition="'$(Config)'=='Debug'">
21+
<RemoteDir>Spring.Tests.Delphi11\</RemoteDir>
22+
<RemoteName>TestInsightSettings.ini</RemoteName>
23+
<DeployClass>File</DeployClass>
24+
<Operation>0</Operation>
25+
<LocalCommand/>
26+
<RemoteCommand/>
27+
<Overwrite>True</Overwrite>
28+
</DeployFile>
29+
</ItemGroup>
30+
</Project>

Tests/Spring.Tests.Delphi11.dproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Debug</Config>
99
<Platform Condition="'$(Platform)'==''">Win32</Platform>
10-
<TargetedPlatforms>3</TargetedPlatforms>
10+
<TargetedPlatforms>131</TargetedPlatforms>
1111
<AppType>Console</AppType>
1212
</PropertyGroup>
1313
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
@@ -190,6 +190,7 @@
190190
<Excluded_Packages/>
191191
</Delphi.Personality>
192192
<Platforms>
193+
<Platform value="Linux64">True</Platform>
193194
<Platform value="Win32">True</Platform>
194195
<Platform value="Win64">True</Platform>
195196
</Platforms>

0 commit comments

Comments
 (0)