Explorar o código

* endian define

peter %!s(int64=24) %!d(string=hai) anos
pai
achega
25e006b364
Modificáronse 2 ficheiros con 19 adicións e 5 borrados
  1. 12 1
      compiler/options.pas
  2. 7 4
      compiler/ppu.pas

+ 12 - 1
compiler/options.pas

@@ -1437,6 +1437,14 @@ begin
       end;
   end;
 
+  { endian define }
+  case target_info.endian of
+    endian_little :
+      def_symbol('ENDIAN_LITTLE');
+    endian_big :
+      def_symbol('ENDIAN_BIG');
+  end;
+
 { write logo if set }
   if option.DoWriteLogo then
    option.WriteLogo;
@@ -1553,7 +1561,10 @@ finalization
 end.
 {
   $Log$
-  Revision 1.41  2001-05-12 12:11:31  peter
+  Revision 1.42  2001-05-18 22:28:59  peter
+    * endian define
+
+  Revision 1.41  2001/05/12 12:11:31  peter
     * simplify_ppu is now the default, a recompile of the compiler now
       only compiles pp.pas
 

+ 7 - 4
compiler/ppu.pas

@@ -389,7 +389,7 @@ begin
   blockread(f,header,sizeof(tppuheader),i);
   { The header is always stored in little endian order }
   { therefore swap if on a big endian machine          }
-{$IFDEF SOURCE_BIG_ENDIAN}
+{$IFDEF ENDIAN_BIG}
   header.compiler := SwapWord(header.compiler);
   header.cpu := SwapWord(header.cpu);
   header.target := SwapWord(header.target);
@@ -401,7 +401,7 @@ begin
   { the PPU DATA is stored in native order }
   if (header.flags and uf_big_endian) = uf_big_endian then
    Begin
-{$IFDEF SOURCE_LITTLE_ENDIAN}
+{$IFDEF ENDIAN_LITTLE}
      change_endian := TRUE;
 {$ELSE}
      change_endian := FALSE;
@@ -409,7 +409,7 @@ begin
    End
   else if (header.flags and uf_little_endian) = uf_little_endian then
    Begin
-{$IFDEF SOURCE_BIG_ENDIAN}
+{$IFDEF ENDIAN_BIG}
      change_endian := TRUE;
 {$ELSE}
      change_endian := FALSE;
@@ -956,7 +956,10 @@ end;
 end.
 {
   $Log$
-  Revision 1.8  2001-05-06 14:49:17  peter
+  Revision 1.9  2001-05-18 22:28:59  peter
+    * endian define
+
+  Revision 1.8  2001/05/06 14:49:17  peter
     * ppu object to class rewrite
     * move ppu read and write stuff to fppu