./trunk/gcc14/vcs_diff_rtl.patch 2025-10-23-03:00
> uname -a Linux cfarm14 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux
diff --git a/rtl/inc/generic.inc b/rtl/inc/generic.inc
index 55874ceb97..024678b0ba 100644
--- a/rtl/inc/generic.inc
+++ b/rtl/inc/generic.inc
@@ -2514,6 +2514,34 @@ procedure fpc_cpuinit;
end;
{$endif}
+{$ifdef DEBUG}
+const
+ swapendian_byte_count : int64 = 0;
+
+ procedure dummy_swapendian_byte_was_used;
+ begin
+ inc(swapendian_byte_count);
+ end;
+{$endif}
+
+function SwapEndian(const AValue : ShortInt) : ShortInt;
+ begin
+ SwapEndian:=AValue;
+{$ifdef DEBUG}
+ dummy_swapendian_byte_was_used;
+{$endif}
+ end;
+
+{$ifndef cpujvm}
+function SwapEndian(const AValue : byte) : byte;
+ begin
+ SwapEndian:=AValue;
+{$ifdef DEBUG}
+ dummy_swapendian_byte_was_used;
+{$endif}
+ end;
+{$endif}
+
{$ifndef FPC_SYSTEM_HAS_SWAPENDIAN}
function SwapEndian(const AValue: SmallInt): SmallInt;{$ifdef SYSTEMINLINE}inline;{$endif}
begin
diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc
index 7d992a16e8..456bac2c5a 100644
--- a/rtl/inc/systemh.inc
+++ b/rtl/inc/systemh.inc
@@ -1025,6 +1025,9 @@ procedure MoveData(srcseg,srcoff,destseg,destoff:Word;n:Word);
Function Odd(l:Int64):Boolean;[internconst:fpc_in_const_odd];{$ifdef SYSTEMINLINE}inline;{$endif}
Function Odd(l:QWord):Boolean;[internconst:fpc_in_const_odd];{$ifdef SYSTEMINLINE}inline;{$endif}
+function SwapEndian(const AValue : byte) : byte;
+function SwapEndian(const AValue : shortint) : shortint;
+
function SwapEndian(const AValue: SmallInt): SmallInt;{$ifdef SYSTEMINLINE}inline;{$endif}
function SwapEndian(const AValue: Word): Word;{$ifdef SYSTEMINLINE}inline;{$endif}
function SwapEndian(const AValue: LongInt): LongInt;{$ifdef SYSTEMINLINE}inline;{$endif}
diff --git a/rtl/java/jsystemh.inc b/rtl/java/jsystemh.inc
index 6998fc8d43..b2d5626f0a 100644
--- a/rtl/java/jsystemh.inc
+++ b/rtl/java/jsystemh.inc
@@ -225,6 +225,8 @@ function IndexWord(const buf: array of boolean16;len:SizeInt;b:boolean16):SizeI
Function odd(l:Int64):Boolean;[internconst:fpc_in_const_odd];{$ifdef SYSTEMINLINE}inline;{$endif}
Function odd(l:QWord):Boolean;[internconst:fpc_in_const_odd]; external;
+function SwapEndian(const AValue: ShortInt): ShortInt;{$ifdef SYSTEMINLINE}inline;{$endif}
+function SwapEndian(const AValue: Byte): Byte; external;
function SwapEndian(const AValue: SmallInt): SmallInt;{$ifdef SYSTEMINLINE}inline;{$endif}
function SwapEndian(const AValue: Word): Word; external;
function SwapEndian(const AValue: LongInt): LongInt;