Browse Source

* Patch from Rika to enable assembler version of MD5 on i386-darwin. Fixes issue #40470

Michaël Van Canneyt 1 year ago
parent
commit
aa841d584d
2 changed files with 4 additions and 9 deletions
  1. 1 3
      packages/hash/fpmake.pp
  2. 3 6
      packages/hash/src/md5.pp

+ 1 - 3
packages/hash/fpmake.pp

@@ -32,7 +32,7 @@ begin
 
     P.Version:='3.3.1';
     T:=P.Targets.AddUnit('src/md5.pp');
-    T.Dependencies.AddInclude('src/md5i386.inc', [i386], AllOSes-[darwin]);
+    T.Dependencies.AddInclude('src/md5i386.inc', [i386], AllOSes);
     T:=P.Targets.AddUnit('src/sha1.pp');
     T.Dependencies.AddInclude('src/sha1i386.inc', [i386], AllOSes);
     T:=P.Targets.AddUnit('src/crc.pas');
@@ -43,8 +43,6 @@ begin
     
     T.OSes:=[Linux];
     T:=P.Targets.AddExampleunit('examples/mdtest.pas');
-    T:=P.Targets.AddExampleunit('examples/crctest.pas');
-    T:=P.Targets.AddExampleunit('examples/sha1test.pp');
     T:=P.Targets.AddExampleunit('examples/hmd5.pp');
     T:=P.Targets.AddExampleunit('examples/hsha1.pp');
     T:=P.Targets.AddExampleunit('examples/md5performancetest.pas');

+ 3 - 6
packages/hash/src/md5.pp

@@ -42,12 +42,9 @@ These notices must be retained in any copies of any part of this
 documentation and/or software.
 }
 
-// Define to use original MD5 code on i386 processors.
-// Undefine to use original implementation.
-{ the assembler implementation does not work on Darwin }
-{$ifdef darwin}
-{$DEFINE MD5PASCAL}
-{$endif darwin}
+// Normally, if an optimized version is available for OS/CPU, that will be used
+// Define to use generic implementation
+{ $DEFINE MD5PASCAL}
 
 {$IFNDEF FPC_DOTTEDUNITS}
 unit md5;