Browse Source

* Fix endian issue.

git-svn-id: trunk@4567 -
daniel 19 years ago
parent
commit
970431d476
1 changed files with 8 additions and 1 deletions
  1. 8 1
      packages/base/paszlib/gzio.pas

+ 8 - 1
packages/base/paszlib/gzio.pas

@@ -362,12 +362,19 @@ var
   c : integer;
 begin
   { x := cardinal(get_byte(s));  - you can't do this with TP, no unsigned longint }
-  { the following assumes a little endian machine and TP }
+{$ifdef ENDIAN_LITTLE}
   x[0] := Byte(get_byte(s));
   x[1] := Byte(get_byte(s));
   x[2] := Byte(get_byte(s));
   c := get_byte(s);
   x[3] := Byte(c);
+{$else}
+  x[3] := Byte(get_byte(s));
+  x[2] := Byte(get_byte(s));
+  x[1] := Byte(get_byte(s));
+  c := get_byte(s);
+  x[0] := Byte(c);
+{$endif}
   if (c = Z_EOF) then
     s^.z_err := Z_DATA_ERROR;
   GetLong := cardinal(longint(x));