DEADSOFTWARE

svrlist: fix local server ip decoding on big endian machines
[d2df-sdl.git] / src / engine / e_log.pas
index 7159c18445614beaff3ba4fc3f534df33d2cf474..dbe7b5dc2773f5881427c776d1d66f57e2835e7d 100644 (file)
@@ -60,7 +60,11 @@ var
 
 function DecodeIPV4 (ip: LongWord): string;
 begin
+{$IFDEF FPC_LITTLE_ENDIAN}
   Result := Format('%d.%d.%d.%d', [ip and $FF, (ip shr 8) and $FF, (ip shr 16) and $FF, (ip shr 24)]);
+{$ELSE}
+  Result := Format('%d.%d.%d.%d', [(ip shr 24), (ip shr 16) and $FF, (ip shr 8) and $FF, ip and $FF]);
+{$ENDIF}
 end;