Browse Source

- disabled i386 assembler implementations of md5/sha1 on Darwin, they fail
there

git-svn-id: trunk@28421 -

Jonas Maebe 11 years ago
parent
commit
6a3907dfd6
2 changed files with 13 additions and 7 deletions
  1. 7 4
      packages/hash/src/md5.pp
  2. 6 3
      packages/hash/src/sha1.pp

+ 7 - 4
packages/hash/src/md5.pp

@@ -17,7 +17,10 @@
 
 // Define to use original MD5 code on i386 processors.
 // Undefine to use original implementation.
-{not $DEFINE MD5SLOW}
+{ the assembler implementation does not work on Darwin }
+{$ifdef darwin}
+{$DEFINE MD5PASCAL}
+{$endif darwin}
 
 unit md5;
 
@@ -302,10 +305,10 @@ begin
 end;
 
 
-{$IF (NOT(DEFINED(MD5SLOW))) and (DEFINED(CPUI386)) }
+{$IF (NOT(DEFINED(MD5PASCAL))) and (DEFINED(CPUI386)) }
 {$i md5i386.inc}
 {$ENDIF}
-{$IF (NOT(DEFINED(MD5SLOW))) and (DEFINED(CPUX86_64)) }
+{$IF (NOT(DEFINED(MD5PASCAL))) and (DEFINED(CPUX86_64)) }
 {$OPTIMIZATION USERBP} //PEEPHOLE
 procedure MD5Transform(var Context: TMDContext; Buffer: Pointer);
 type
@@ -404,7 +407,7 @@ begin
 end;
 {$OPTIMIZATION DEFAULT}
 {$ENDIF}
-{$IF DEFINED(MD5SLOW) or (NOT ((DEFINED(CPUX86_64)) or (DEFINED(CPUI386))))}
+{$IF DEFINED(MD5PASCAL) or (NOT ((DEFINED(CPUX86_64)) or (DEFINED(CPUI386))))}
 // Original version
 procedure MD5Transform(var Context: TMDContext; Buffer: Pointer);
 

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

@@ -15,7 +15,10 @@
 
 // Normally, if an optimized version is available for OS/CPU, that will be used
 // Define to use existing unoptimized implementation
-{not $DEFINE SHA1SLOW}
+{ the assembler implementation does not work on darwin }
+{$ifdef darwin}
+{$DEFINE SHA1PASCAL}
+{$endif darwin}
 
 unit sha1;
 {$mode objfpc}{$h+}
@@ -81,9 +84,9 @@ const
   K60 = $8F1BBCDC;
   K80 = $CA62C1D6;
 
-{$IF (NOT(DEFINED(SHA1SLOW))) and (DEFINED(CPU386)) }
+{$IF (NOT(DEFINED(SHA1PASCAL))) and (DEFINED(CPU386)) }
 // Use assembler version if we have a suitable CPU as well
-// Define SHA1SLOW to force use of original reference code
+// Define SHA1PASCAL to force use of original reference code
 {$i sha1i386.inc}
 {$ELSE}
 // Use original version if asked for, or when we have no optimized assembler version